Yarn kbn bootstrap fails

Hello everyone,

I have been trying to run yarn kbn bootstrap but it keeps giving me following errors.

E:\Kibana-development\kibana>yarn kbn bootstrap --force-install
yarn run v1.22.10
$ node scripts/kbn bootstrap --force-install
 info [kibana] running yarn

$ node ./preinstall_check
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "schema-utils@1.0.0" is incompatible with requested version "schema-utils@^0.3.0"
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@~3.7.2"
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@^3.3.3333"
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@^3.2.2"
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@^3.0.3"
warning Resolution field "typescript@4.0.2" is incompatible with requested version "typescript@^3.4.5"
[3/5] Fetching packages...
warning Pattern ["babel-plugin-require-context-hook@npm:babel-plugin-require-context-hook-babel7@1.0.0"] is trying to unpack in the same destination "C:\\Users\\akhil patel\\AppData\\Local\\Yarn\\Cache\\v6\\npm-babel-plugin-require-context-hook-1.0.0-1273d4cee7e343d0860966653759a45d727e815d-integrity\\node_modules\\babel-plugin-require-context-hook" as pattern ["babel-plugin-require-context-hook@^1.0.0"]. This could result in non-deterministic behavior, skipping.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.2.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "E:\\Kibana-development\\kibana\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...

I have tried to increase network timeout, tried to unset proxy but nothing works. can anyone please tell me how to resolve this issue?

Thanks in advance!

@jbudz /@tylersmalley for your inputs please .

Hi, you need a reliable internet connection to run bootstrap. What steps have you done to "increase network timeout" and "unset proxy"?

Hi Tim,

I have used the following commands.

yarn kbn bootstrap --network-timeout 100000
yarn config rm proxy

Thanks

My internet connection works fine with other tasks.

Now I am getting following errors. Not sure what to do.

error An unexpected error occurred: "EPERM: operation not permitted, open 'C:\\kibana-development\\kibana\\node_modules\\@cypress\\webpack-preprocessor\\node_modules\\.bin\\webpack'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\kibana-development\\kibana\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR [bootstrap] failed:
ERROR Error: Command failed with exit code 1: C:\Users\akhil patel\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js install --non-interactive
          at makeError (C:\kibana-development\kibana\packages\kbn-pm\dist\index.js:25071:11)
          at handlePromise (C:\kibana-development\kibana\packages\kbn-pm\dist\index.js:24006:26)
          at process._tickCallback (internal/process/next_tick.js:68:7)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Hi, I'm sorry that you are having problems with setting up the development environment. Commonly, developers on this project do not use Windows. Have you tried Git Bash or the Windows Linux Subsystem?

Unfortunately, I don't think this forum is the best place to receive help on this very specific problem. I would search for help on the tools that we're using: Yarn: https://github.com/yarnpkg/yarn/issues. I see there are a handful of both open and closed issues in this search page: Issues · yarnpkg/yarn · GitHub

Hello @tsullivan ,

Thanks for taking to time to reply on my post. yes, I was able to set up development environment using git bash.

I have one more question regarding the setup. when I run "yarn es snapshot" there are few messages I am concerned about.

   │ info [o.e.n.Node] [DESKTOP-AN41IF1] version [8.0.0-SNAPSHOT] is a pre-release version of Elasticsearch and is not suitable for production

on elastic website I am only able to download until version 7.13.

Thanks,
Akhil

Hi, @Akhil2, it seems you are on the master branch in git. This branch is where all the new Kibana code gets added and uses the version 8.0.0-SNAPSHOT.

If you want to run a 7.13 instance of Kibana from source and a 7.13 instance of Elasticsearch when you use yarn es snapshot, you should check out the 7.13 branch in git. Then run yarn kbn bootstrap again, to install the 7.13-specific set of dependencies.

Hi Tim,

sorry to bother you again. I downloaded source code for kibana 7.13.2. and when I run kibana bootstrap it gives me the following errors. This did not happen with the previous source code.

$ yarn kbn bootstrap
yarn run v1.22.1
$ node scripts/kbn bootstrap
 info [bazel_tools] installing Bazel tools
ERROR [bootstrap] failed:
ERROR Error: [bazel_tools] an error occurred when installing the Bazel tools. Please make sure you have access to npm globally installed modules on your $PATH
          at installBazelTools (E:\kibana713\kibana\kibana\packages\kbn-pm\dist\index.js:48429:13)
          at processTicksAndRejections (internal/process/task_queues.js:93:5)
          at async Object.run (E:\kibana713\kibana\kibana\packages\kbn-pm\dist\index.js:8937:5)
          at async runCommand (E:\kibana713\kibana\kibana\packages\kbn-pm\dist\index.js:59803:5)
          at async Module.run (E:\kibana713\kibana\kibana\packages\kbn-pm\dist\index.js:242:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I am using following versions for NodeJS, yarn and NPM.

NodeJS - 14.16.1
npm - 6.14.12
yarn - 1.22.1

Thanks in advance!

@tiagocosta this looks similar to an issue that popped up awhile back in the issue tracker. Any thoughts? Is there a solution for it?

@Akhil2 we have new requirements to develop on Windows. Please make sure you follow what is described at Getting started | Kibana Guide [master] | Elastic

Additionally please run the following commands to debug what is happening with the bootstrap, you probably have some kind of permission setup problem within your setup:

npm install --global @bazel/bazelisk@1.7.5

and then

bazel --version

Whatever error you got when running those two commands is the one you need to solve in order to get the bootstrap to succeed.

Hello @tiagocosta,

I tried running the following commands but it is still giving me the following errors.

akhil patel@DESKTOP-RP62F3S MINGW64 /c/TEMP/Trial/Kibana7132/kibana
$ npm install --global @bazel/bazelisk@1.7.5
C:\TEMP\Trial\Kibana7132\kibana\bazelisk -> C:\TEMP\Trial\Kibana7132\kibana\node_modules\@bazel\bazelisk\bazelisk.js
C:\TEMP\Trial\Kibana7132\kibana\bazel -> C:\TEMP\Trial\Kibana7132\kibana\node_modules\@bazel\bazelisk\bazelisk.js
npm WARN The package @elastic/apm-rum is included as both a dev and production dependency.
npm WARN The package @elastic/apm-rum-react is included as both a dev and production dependency.

+ @bazel/bazelisk@1.7.5
updated 1 package in 2.393s

akhil patel@DESKTOP-RP62F3S MINGW64 /c/TEMP/Trial/Kibana7132/kibana
$ bazel --version
FATAL: Your platform/architecture combination win32 - ia32 is not yet supported.
    You may need to compile Bazelisk yourself, or use the Python version.
    See instructions at https://github.com/bazelbuild/bazelisk/blob/master/README.md.
internal/validators.js:124
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received an instance of Promise
    at validateString (internal/validators.js:124:11)
    at normalizeSpawnArguments (child_process.js:411:3)
    at spawn (child_process.js:551:13)
    at main (C:\Users\akhil patel\AppData\Roaming\npm\node_modules\@bazel\bazelisk\bazelisk.js:55:14)
    at Object.<anonymous> (C:\Users\akhil patel\AppData\Roaming\npm\node_modules\@bazel\bazelisk\bazelisk.js:69:3)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Thanks in advance!

@Akhil2 it looks like you're trying to bootstrap in a non supported architecture on Windows. Please try in another architecture if you have the chance or follow what is described at Compiling Bazel from source - Bazel 4.1.0 in order to correctly install the tool dependency that is failing.