Problem accessing file from base URL in Kibana 7.8

I'm converting a plugin from Kibana 7.5 to 7.8. In my code I grab an .xlsx file that is stored in a data directory in the public folder of my plugin. This works in 7.5 but does not work in 7.8. I'm grabbing this file:

/kibana/plugins/my_plugin/public/data/test.xlsx

by using the URL like this:

http://localhost:5603/ghq/plugins/my_plugin/data/test.xlsx 

As I stated, this works in 7.5 but not in 7.8. Is there something special I need to do in 7.8 to allow access to this file? I posted a response to another guy with a similar question and a response he received was to do exactly what I'm doing. That user used the Kibana home plugin as an example of how to grab one of the images that is stored in the assets directory of that plugin. I can grab that image from the URL:

http://localhost:5603/ghq/plugins/home/assets/aws_metrics/screenshot.png

I can also place my test.xlsx file within the /home/public/assest/aws_metrics directory and pull it from the URL. However I cannot pull files from the URL with any plugin that I create in 7.8. Is there some server setting that I'm missing with my plugin to allow me to access files from the URL?

Hi @ssimmons
In 7.8 we are moving toward a new plugin/platform system. We will keep the legacy plugin world until 8.0.
If your plugin is already using the new platform (see https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md) then your static files are served from within the your plugin /public/assets folder and accessed through /plugins/{id}/assets/{path*} URL.

Thank you for pointing me in the right direction. I am using the new plugin/platform system. I had already tried adding an assets folder and accessing files through that folder and it is still not working for me. I created an assets folder and placed a file called icon.png in it. It still give me a 404 when I try to access this file. I'm using Kibana 7.8.0. I've created two more plugins just to test this and I'm getting a 404 with all of them. My file is located here:

/kibana/plugins/expr_example/public/assets/icon.png

And I'm trying to access it from here (my current path is qkh):

http://localhost:5603/qkh/plugins/expr_example/assets/icon.png

And it's giving me a 404 error. Is there any special permissions on the assets folder that I need to set?

I finally found the issue with not being able to access the assets folder in Kinbana 7.8. It appears to be related to the naming of the plugin. If you include underscores "_" within the plugin name, then you will not be able to access the assets folder. So I had to create a new plugin named dodequities instead of dod_equities. Now I can access the assets folder.

Good that you have found the issue, it’s important to note that the plugin id does not necessarily match the directory name. It’s the id that is used in the URL path, not the directory name, so please check your plugin id on the kibana.json file and use that in the url path

Ah, now I see. I was able to create a plugin with an underscore in the name and access the asset folder for that plugin. By default it appears to remove the underscore and camel case the next word in the plugin when creating the actual id. So the plugin I created was dod_equities and the id within the kibana.json file was set as dodEquities. I was able to access the assets folder using the id of dodEquities. Thanks for this clarification.

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