Kibana Plugin error : "Elastic did not load properly. Check the server output for more information."

Hi !

ES Version - 8.10.2
Kibana version - 8.10.2

So i have written a plugin to add to kibana. and i did this in kibana 8.10.2 dev only.

it works perfectly in my wsl (my dev env).
when i use "yarn build" and use it, my kibana setup on my windows doesnt open and i get

"Elastic did not load properly. Check the server output for more information."

and checking the console log

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src '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:42 ^ A single error about an inline script not firing due to content security policy is expected!
:5601/66404/bundles/plugin/visevent/1.0.0/visevent.plugin.js:1 
        
        
        Failed to load resource: net::ERR_CONTENT_DECODING_FAILED

checking online for solutions on the net and forum, i have set csp.strict to false in my kibana.yml

server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["http://localhost:9200"]
elasticsearch.username: "kibana_system"
elasticsearch.password: "w2i7j*UcSYHialiJCeV9"
csp.strict: false

i also read on one of the issues in the kibana git talking abt openssl legacy support.

this is my package.json file

  "name": "visevent",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "bootstrap": "yarn kbn bootstrap && yarn install",
    "build": "NODE_OPTONS=--openssl-legacy-provider yarn plugin-helpers build",
    "dev": "node --openssl-legacy-provider ../../scripts/plugin_helpers dev",
    "plugin-helpers": "node ../../scripts/plugin_helpers",
    "kbn": "node ../../scripts/kbn"
  },
  "dependencies": {
    "html2canvas": "^1.4.1",
    "vis-data": "^7.1.7",
    "vis-network": "^9.1.9"
  }
}

this is a project i am doing. not a proper official production or so.
so i dont really care for security as long as it works and i can take screenshots to include in my report.

When i remove the plugin and start es and kibana, it works. so i know the problem is when the plugin comes into the picture.

Kindly requesting some help! Thanks in advance

1 Like

Hi Srinivasa,

For solving the error = Error: error:0308010C:digital envelope routines::unsupported

You just have to add "export NODE_OPTIONS=--openssl-legacy-provider &&" to plugin-helpers script
Like this:

{
  "name": "test",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "bootstrap": "yarn kbn bootstrap && yarn install",
    "build": "yarn plugin-helpers build",
    "dev": "yarn plugin-helpers dev",
    "plugin-helpers": "export NODE_OPTIONS=--openssl-legacy-provider  && node ../../scripts/plugin_helpers",
    "kbn": "node ../../scripts/kbn"
  }
}

If your plugin has a UI then you have to open a separate terminal , navigate to the root of plugin.
and run

yarn dev --watch

Keep this terminal open.

And on new terminal run:

yarn start --run-examples

Let me know if you are still facing the same issue.

Hi @Sanskar_Panchal

Thank you so much for your response. I actually got everything working.

I added the csp.rules allowing inline and the csp blocking issue got solved.

As for the decoding problem, i just deleted the "<plugin_name>.br " files inside the plugin root>target>public folder
and it started working

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