Error when running kibana 7.5.1 - built_assets/dlls not found

Hi,
I'm using Kibana 7.5.1 and install it using "yarn kbn bootstrap" and running it using "yarn start".
It runs OK and works fine (BTW I am using yarn 1.21.1 and node 10.15.2)
The issue is when I run it using ./bin/kibana instead of "yarn start", it failed due to ERROR in vendors.bundle.dll.js from Terser.
Basically the issue is that "built_assets/dlls" directory should contains bunch of .js files and it only contains vendors.entry.dll.js and vendors.manifest.dll.json while many more are required according to the log file which search the files in "built_assets/dlls" directory.
What should I do and why it won't creates these files when running Kibana using ./bin/kibana?

DLLs are built once for full builds and as needed in development, I wonder if there's something confusing the two. Can you try removing the dll folder and running node scripts/kibana instead. bin/kibana and node/scripts are kibana are similar, but the bin is configured for our production workflow. I'm guessing there's NODE_ENV=production(or similar) definition in the bin check on whether to build dlls or not.

I removed the dlls folder and when running node scripts/kibana it didn't build the dlls folder and it shows like it runs and listening to my port, but when opening kibana on web browser it shows a red label message "Kibana did not load properly. Check the server output for more information".
The error is "Failed to load resource" which looking for missing dlls.

Now I have noticed that when running "yarn start" it build the dlls folder only when opening a web browser and navigating to kibana and only then I can run node scripts/kibana successfully.

But it still doesn't solve my issue because "yarn start" runs on --dev mode and I need to run it using scripts/kibana which is failed due to lack of dlls

Well, I tried to figure it out and it didn't work yet, so maybe we can do it in a different way.
When I'm running "yarn kbn bootstrap" and then "node scripts/build --rpm" I get a tarball in "target" directory which I can run using "node scripts/kibana", it works and builds the dlls. I can leave with it but the issue is that the build takes about 30 minutes!!
There is something I can do to decrease the build time to a more reasonable time?

I think it would help to understand what you're looking to accomplish. Are you wanting to run Kibana in production? If so, you should be using the downloads from our site.

Or, are you looking to make modifications of the source and product build artifacts?

Thanks for your comment.
Our front-end team using Kibana v7.5.1 and frequently modify the source by pushing new code to customize their own needs.
The idea is implementing a continuous integration process so each push will trigger a new build and auto deploy to a test environment.
So in order to accomplish that I cloned the v7.5.1 tag from GitHub, ran "yarn kbn bootstrap" (which successfully passed) and then running "node scripts/kibana" but it failed due to "ERROR in vendors.bundle.dll.js from Terser".
I can run "node scripts/kibana" only with "--dev" flag but when using "--dev" it runs behind a proxy and use a default port 5603 to route the port I configured in "config/kibana.yml" (5601) and as a result of that I can't run additional instance of Kibana on the same environment because it uses the same default port 5603 which rout to the port configured in "config/kibana.yml".
so I found this topic: https://www.elastic.co/guide/en/kibana/current/development-basepath.html
which said running "node scripts/kibana --dev" with "--no-base-path" but it does the same and this time with port 5602 so I couldn't run two instances of Kibana (--dev mode) on the same environment although I configured a different port in "config/kibana.yml" (5607).

So I tried a different way, building Kibana using "node scripts/build --rpm" (runs on centos 7) to generate a tarball (in /target directory) and it works really great! I can run even two (and more) instances on the same environment because no proxy default port is running behind the port configured in "config/kibana.yml" like happened in dev mode. Unfortunately, the build command "node scripts/build --rpm" takes ~30 minutes what makes my CI process useless.
So I tried using different flags and found that "--oss" decrease the build time to 8 minutes what makes is reasonable BUT it doesn't build the xpack which is mandatory.
So, right now I have fully automated process which perform a build and runs ~40 minutes (yarn kbn bootstrap (8 mins) + node scripts/build --rpm (30 mins) ) but I am looking how to decrease the build time or alternatively, if it can't be accomplished to be able to run it using "node scripts/kibana" without "--dev" mode.
I hope it was clear and you can help :slight_smile:

Those times sound correct. We're working on creating new build tooling which will make this more efficient but that is a few months out.

One things that will speed things up. You can run the build with --no-oss which will prevent building of the strictly OSS distribution which it sounds like you don't require.

Do you need to run with the --dev flag? node scripts/kibana will respect server.port. It's "production" development. bin/kibana is where things will get messy with it setting environment variables.

Thanks, when building it with --no-oss it save ~10 mins which is great improvement.
And how about the issue that I can't run kibana after running 'yarn kbn bootstrap' using 'node scripts/kibana' ?
The error I get is about 'vendor.dll' and the 'built_assets/dlls' directory contains only 2 files.
(when I build kibana it builds also the entire built_assets/dlls directory)

I need to run it without --dev flag which cause an error of 'vender.dll'

I am not able to reproduce the issue with node scripts/kibana. Are you running from the 7.5 branch, and are you doing anything else besides calling node scripts/kibana?

My commands:

 6751  yarn kbn clean
 6752  yarn kbn bootstrap
 6753  node scripts/kibana.js --elasticsearch.username=kibana --elasticsearch.password=changeme

Elasticsearch username/password is required since I am running Elasticsearch with yarn es snapshot and it enables security. Using --dev with Kibana automatically applies these settings.

I am using Centos7 and do exactly as follow:

  1. git clone https://github.com/elastic/kibana.git --branch=v7.5.1
  2. yarn kbn bootstrap
  3. node script/kibana
  4. Waiting few minutes and getting this error:

It works only when running node scripts/kibana --dev which is not good for me, or when I build the source and run it from target/kibana-7.5.1-SNAPSHOT-linux-x86_64.tar.gz
What do I miss?

Looks like that issue has since been resolved but I am unable to point to an exact PR. If you're running from source, you really should be running with --dev. If you want to run this in a non-dev mode you should create a build.