Kibana: Unknown app error when opening a hidden app UI route

Created on 31 Oct 2018  路  2Comments  路  Source: elastic/kibana

Kibana version:
6.2.4 and 6.4.2

Elasticsearch version:
6.2.4 and 6.4.2

Server OS version:
Ubuntu 18

Browser version:
Chrome 69

Browser OS version:
Ubuntu 18

Original install method (e.g. download page, yum, from source, etc.):

git clone https://github.com/elastic/kibana.git

Describe the bug:
I created a hidden plugin (there is no icon in the left navbar). But I can't access a UI route.
When I put this URL in browser http://localhost:5601/ncz/app/alert, I get

{"statusCode":404,"error":"Not Found","message":"Unknown app alert"}

Though, I see my app server log among Kibana logs

server    log   [11:37:47.023] [info][alert] starting...

And the UI route is accessible if hidden: false in index.js.

module.exports = function (kibana) {
  return new kibana.Plugin({
    name: 'alert',
    require: [
      'kibana',
      'elasticsearch',
    ],
    uiExports: {
      navbarExtensions: [],
      apps: [{
        title: 'alert',
        id: 'alert',
        description: 'It is a test hidden app',
        hidden: false,
        main: 'plugins/alert/app.js',
      }]
    },
    init: require('./server/init')
  });
};

Steps to reproduce:

  1. git clone [email protected]:sergibondarenko/alert.git
  2. cd alert
  3. npm install && npm install -g gulp
  4. gulp sync --kibanahomepath=/path/to/kibana
  5. cd elasticsearch
  6. ./bin/elasticsearch
  7. cd kibana
  8. npm start
  9. Open a WEB browser and put this URL http://localhost:5601/joy/app/alert

Expected behavior:
I should see a blank page with description like this
screenshot from 2018-10-31 15-41-20
I see the following error instead

{"statusCode":404,"error":"Not Found","message":"Unknown app alert"}

Screenshots (if relevant):
screenshot from 2018-10-31 15-45-03

Errors in browser console (if relevant):
No console errors. There is only network error
screenshot from 2018-10-31 15-45-46

Provide logs and/or server output (if relevant):
I see correct server info log from my app

server    log   [14:28:50.499] [info][alert] starting...

Any additional context:

The app full code is on GitHub.

index.js

module.exports = function (kibana) {
  return new kibana.Plugin({
    name: 'alert',
    require: [
      'kibana',
      'elasticsearch'
    ],
    uiExports: {
      apps: [{
        title: 'alert',
        id: 'alert',
        description: 'It is an extension',
        hidden: true,
        main: 'plugins/alert/app.js',
      }]
    },
    init: require('./server/init')
  });
};

init.js

import { once } from 'lodash';

const init = once(function (server) {
  server.log(['info', 'alert'], 'starting...');
});

export default function (server, options) {
  if (server.plugins.elasticsearch.status.state === 'green') {
    init(server);
  } else {
    server.plugins.elasticsearch.status.on('change', () => {
      if (server.plugins.elasticsearch.status.state === 'green') {
        init(server);
      }
    });
  }
};

app.js

require('ui/routes').enable();
require('ui/routes').when('/', {
  template: require('plugins/alert/templates/root_template.html'),
  controller: 'RootController',
});

const app = require('ui/modules').get('apps/alert', []);
app.controller('RootController', function ($scope) {
  $scope.description = 'alert';
});
Core

Most helpful comment

If you just want to hide the icon in the nav use listed: false, not hidden: true. Hidden intentionally disables access via the app route.

All 2 comments

same issue was logged here as well: https://discuss.elastic.co/t/is-it-possible-to-have-a-hidden-plugin-with-ui/154835

cc @elastic/kibana-platform

If you just want to hide the icon in the nav use listed: false, not hidden: true. Hidden intentionally disables access via the app route.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stacey-gammon picture stacey-gammon  路  74Comments

AlexIoannides picture AlexIoannides  路  138Comments

stigdescamps picture stigdescamps  路  88Comments

rashidkpc picture rashidkpc  路  116Comments

bquartier picture bquartier  路  79Comments