elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.83k stars 8.21k forks source link

Unable to bootstrap Kibana from Amazon Linux server #145470

Closed mccoey01 closed 1 year ago

mccoey01 commented 1 year ago

Kibana version: 8.5.0

Elasticsearch version: 8.5.0

Server OS version: Amazon Linux 2

Browser version: N/A

Browser OS version: N/A

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

Describe the bug: Cloned the kibana repository and attempted to 'yarn kbn bootstrap' but it fails to complete on an error validating the re2 node module

Steps to reproduce:

  1. git checkout tags/v8.5.0
  2. nvm use
  3. yarn kbn bootstrap

Expected behavior: Ability to build Kibana from source (as-is, without any changes)

Screenshots (if relevant): N/A

Errors in browser console (if relevant): N/A

Provide logs and/or server output (if relevant):

[DS\mccoey01 kibana]$ yarn kbn bootstrap
yarn run v1.22.19
$ node scripts/kbn bootstrap
[bazel] Starting local Bazel server and connecting to it...
[bazel] INFO: Invocation ID: e84d486a-d939-4519-9d57-c7b2ca99905a
[bazel] $ node ./preinstall_check
[bazel] [1/5] Validating package.json...
[bazel] [2/5] Resolving packages...
[bazel] warning Resolution field "trim@1.0.1" is incompatible with requested version "trim@0.0.1"
[bazel] warning Resolution field "typescript@4.6.3" is incompatible with requested version "typescript@^3.3.3333"
[bazel] warning Resolution field "@types/node@16.11.41" is incompatible with requested version "@types/node@^10.1.0"
[bazel] warning Resolution field "@types/node@16.11.41" is incompatible with requested version "@types/node@^14.0.10"
[bazel] warning Resolution field "@types/node@16.11.41" is incompatible with requested version "@types/node@^14.0.10"
[bazel] warning Resolution field "@types/node@16.11.41" is incompatible with requested version "@types/node@^14.0.10"
[bazel] warning Resolution field "@types/node@16.11.41" is incompatible with requested version "@types/node@^14.0.10"
[bazel] warning Resolution field "@types/node@16.11.41" is incompatible with requested version "@types/node@^14.14.31"
[bazel] warning Resolution field "typescript@4.6.3" is incompatible with requested version "typescript@^3.5.3"
[bazel] [3/5] Fetching packages...
[bazel] [4/5] Linking dependencies...
[bazel] warning " > @elastic/eui@64.0.5" has incorrect peer dependency "typescript@~4.5.3".
[bazel] warning " > @mapbox/mapbox-gl-rtl-text@0.2.3" has unmet peer dependency "mapbox-gl@>=0.32.1 <2.0.0".
[bazel] warning " > react-ace@7.0.5" has incorrect peer dependency "react@^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0".
[bazel] warning " > react-ace@7.0.5" has incorrect peer dependency "react-dom@^0.13.0 || ^0.14.0 || ^15.0.1 || ^16.0.0".
[bazel] warning " > react-intl@2.8.0" has incorrect peer dependency "react@^0.14.9 || ^15.0.0 || ^16.0.0".
[bazel] warning " > react-shortcuts@2.1.0" has incorrect peer dependency "react@^0.14.8 || ^15 || ^16".
[bazel] warning " > react-shortcuts@2.1.0" has incorrect peer dependency "react-dom@^0.14.8 || ^15 || ^16".
[bazel] warning " > react-tiny-virtual-list@2.2.0" has incorrect peer dependency "react@15.x || 16.x".
[bazel] warning " > react-virtualized@9.22.3" has incorrect peer dependency "react@^15.3.0 || ^16.0.0-alpha".
[bazel] warning " > react-virtualized@9.22.3" has incorrect peer dependency "react-dom@^15.3.0 || ^16.0.0-alpha".
[bazel] warning " > react-vis@1.8.2" has incorrect peer dependency "react@0.14.x - 16.x".
[bazel] warning " > recompose@0.30.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
[bazel] warning " > @bazel/typescript@4.6.2" has incorrect peer dependency "typescript@>=3.0.0 <4.4.0".
[bazel] warning " > @elastic/eslint-plugin-eui@0.0.2" has incorrect peer dependency "eslint@>=5, <7".
[bazel] warning "@elastic/github-checks-reporter > @octokit/rest > @octokit/plugin-request-log@1.0.4" has unmet peer dependency "@octokit/core@>=3".
[bazel] warning "@storybook/addon-storyshots > preact-render-to-string@5.1.19" has unmet peer dependency "preact@>=10".
[bazel] warning Workspaces can only be enabled in private projects.
[bazel] [5/5] Building fresh packages...
[bazel] error /home/mccoey01/Development/kibana/node_modules/re2: Command failed.
[bazel] Exit code: 1
[bazel] Command: install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || npm run rebuild
[bazel] Arguments: 
[bazel] Directory: /home/mccoey01/Development/kibana/node_modules/re2
[bazel] Output:
[bazel] Trying https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/linux-x64-93.br ...
[bazel] Writing to build/Release/re2.node ...
[bazel] The verification has failed: building from sources ...
[bazel] Building locally ...
[bazel] TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module "file:///home/mccoey01/.cache/bazel/_bazel_DS%5Cmccoey01/683ff3c4abc2a3e72223dec2b452aa88/external/nodejs_linux_amd64/bin/nodejs/lib/node_modules/npm/node_modules/is-core-module/index.js" must not include encoded "/" or "\" characters
[bazel]     at new NodeError (node:internal/errors:387:5)
[bazel]     at finalizeEsmResolution (node:internal/modules/cjs/loader:965:11)
[bazel]     at resolveExports (node:internal/modules/cjs/loader:493:14)
[bazel]     at Function.Module._findPath (node:internal/modules/cjs/loader:533:31)
[bazel]     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
[bazel]     at Function.Module._load (node:internal/modules/cjs/loader:804:27)
[bazel]     at Module.require (node:internal/modules/cjs/loader:1028:19)
[bazel]     at require (node:internal/modules/cjs/helpers:102:18)
[bazel]     at Object.<anonymous> (/home/mccoey01/.cache/bazel/_bazel_DS\mccoey01/683ff3c4abc2a3e72223dec2b452aa88/external/nodejs_linux_amd64/bin/nodejs/lib/node_modules/npm/node_modules/normalize-package-data/lib/fixer.js:5:23)
[bazel]     at Module._compile (node:internal/modules/cjs/loader:1126:14)
[bazel] node:internal/process/promises:279
[bazel]             triggerUncaughtException(err, true /* fromPromise */);
[bazel]             ^
[bazel] 
[bazel] [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
[bazel]   code: 'ERR_UNHANDLED_REJECTION'
[bazel] }
[bazel] TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module "file:///home/mccoey01/.cache/bazel/_bazel_DS%5Cmccoey01/683ff3c4abc2a3e72223dec2b452aa88/external/nodejs_linux_amd64/bin/nodejs/lib/node_modules/npm/node_modules/is-core-module/index.js" must not include encoded "/" or "\" characters
[bazel]     at new NodeError (node:internal/errors:387:5)
[bazel]     at finalizeEsmResolution (node:internal/modules/cjs/loader:965:11)
[bazel]     at resolveExports (node:internal/modules/cjs/loader:493:14)
[bazel]     at Function.Module._findPath (node:internal/modules/cjs/loader:533:31)
[bazel]     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
[bazel]     at Function.Module._load (node:internal/modules/cjs/loader:804:27)
[bazel]     at Module.require (node:internal/modules/cjs/loader:1028:19)
[bazel]     at require (node:internal/modules/cjs/helpers:102:18)
[bazel]     at Object.<anonymous> (/home/mccoey01/.cache/bazel/_bazel_DS\mccoey01/683ff3c4abc2a3e72223dec2b452aa88/external/nodejs_linux_amd64/bin/nodejs/lib/node_modules/npm/node_modules/normalize-package-data/lib/fixer.js:5:23)
[bazel]     at Module._compile (node:internal/modules/cjs/loader:1126:14)
[bazel] info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Any additional context: Seems very similar to #139598; I am able to consistently reproduce the problem. I've tried force-install, clean, reset. It fails on v8.4.1 and v8.5.0 tags. It can't find re2, so it tried to download it. I think it downloads, but then it tries to validate the download, and I guess that fails - because then it starts building locally. And the local build fails. I am able to reach the URL, https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.17.4/linux-x64-93.br, and the .br file downloads. I do see an re2 directory in home/mccoey01/Development/kibana/node_modules/

elasticmachine commented 1 year ago

Pinging @elastic/kibana-operations (Team:Operations)

mccoey01 commented 1 year ago

The cause of this error was the \ in the file:///home/mccoey01/.cache/bazel/_bazel_DS%5Cmccoey01/ directory.

"DS\mccoey01" is my username, and looks like that path is the result of bazel using ${whoami} in building up the cache directory. I was able to edit the .bazelrc file, and change bazel to override that directory using startup --output_user_root=~/.cache/bazel/mccoey01_user_dir

Now I am able to get beyond that point, but it's failing with another error, for [bazel] SystemError [ERR_SYSTEM_ERROR]: [BABEL]: A system error occurred: uv_os_homedir returned ENOENT (no such file or directory) (While processing: /home/mccoey01/.cache/bazel/mccoey01_user_dir/683ff3c4abc2a3e72223dec2b452aa88/sandbox/linux-sandbox/15/execroot/kibana/node_modules/@babel/preset-env/lib/index.js)

/home/mccoey01/.cache/bazel/mccoey01_user_dir/683ff3c4abc2a3e72223dec2b452aa88 - and it is writing other things to that directory, but there is no 'sandbox' directory in that path

Ikuni17 commented 1 year ago

@mccoey01 are you still experiencing this issue? Using the Amazon Linux 2 image from six days ago, I was able to setup and run Kibana from source without any extra configuration.

Ikuni17 commented 1 year ago

Closing due to inactivity and unable to reproduce. If this is still an issue feel free to reopen.