Plugin startup fails in V7.9 but works in 7.3

My cbsa plugin fails on startup. It fails at xpackMainPlugin.registerFeature in init.js with the following message " FATAL Error: Feature cbsa specifies app entries which are not granted to any privileges: cbsa,kibana". I tried a number of combinations as shown in:

What exactly is this error trying to tell me?
Why does it work in 7.3 and not in 7.9? (Checked the docs. Nothing obvious in Change Log).
My code is shown below. What changes are required?

      const xpackMainPlugin = server.plugins.xpack_main;
      if (xpackMainPlugin) {
        const featureId = 'cbsa';

        xpackMainPlugin.registerFeature({
          id: featureId,
          name: i18n.translate('cbsa.featureRegistry.featureName', {
            defaultMessage: 'cbsa',
          }),
          navLinkId: featureId,
          icon: 'questionInCircle',
          app: [featureId, 'kibana'],
          catalogue: [],
          privileges: {
            all: {
              api: [],
              savedObject: {
                all: [],
                read: [],
              },
              ui: ['show'],
            },
            read: {
              api: [],
              savedObject: {
                all: [],
                read: [],
              },
              ui: ['show'],
            },
          },
        });
      }

Kibana internals have changed a lot from 7.3 to 7.9. Plugins that work in 7.3 may not work in 7.9. Does cbsa plugin support 7.9?

Nathan,
I have used Eui Framework all the way through. From what i read , major changes will happen in 8.0. Given what i have provided, where is the best place to look?'m trying to get cbsa plugin to work under 7.9. Thats the point.

Try adding the line app: [featureId, 'kibana'],

below the line all: {

and

below the line read: {

Andrea,
Thanks for taking the time to respond. Well, one more step forward. Adding these line now allows the plugin to start up without the previous error message. However , when the plugin is invoked , it simplu loos. When i look at the console, i get the following error message:

*refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.

bootstrap.js:11 ^ A single error about an inline script not firing due to content security policy is expected!

So it pretty obvious that the ```
xpackMainPlugin.registerFeature({

needs to be setup properly. I'm running teh free or public domain version at this time. Will be getting licensed in the near future.

sorry for the late reply, you have to use plugins.features.registerFeature instead of server.plugins.xpack_main.registerFeature as written here https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md#plugin-services

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.