Yarn kbn bootstrap failing for Kibana version 8.5.1

I am getting below error while "yarn kbn bootstrap" for kibana version 8.5.1

[bazel] Traceback (most recent call last):
[bazel]   File "/Users/sunil/Documents/workspace/kibana/node_modules/node-gyp/gyp/gyp_main.py", line 42, in <module>
[bazel]     import gyp  # noqa: E402
[bazel]     ^^^^^^^^^^
[bazel]   File "/Users/sunil/Documents/workspace/kibana/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 9, in <module>
[bazel]     import gyp.input
[bazel]   File "/Users/sunil/Documents/workspace/kibana/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 19, in <module>
[bazel]     from distutils.version import StrictVersion
[bazel] ModuleNotFoundError: No module named 'distutils'
[bazel] Repository rule yarn_install defined at:
[bazel]   /private/var/tmp/_bazel_sunil/0cbb3d74df4fb74e34393ac1190d3475/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl:956:31: in <toplevel>
[bazel] ERROR: An error occurred during the fetch of repository 'npm':

[bazel] ERROR: /Users/sunil/Documents/workspace/kibana/WORKSPACE.bazel:47:13: fetching yarn_install rule //external:npm: Traceback (most recent call last):
[bazel]         File "/private/var/tmp/_bazel_sunil/0cbb3d74df4fb74e34393ac1190d3475/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 949, column 13, in _yarn_install_impl
[bazel]                 fail("yarn_install failed: %s (%s)" % (result.stdout, result.stderr))
[bazel] Error in fail: yarn_install failed: $ node ./preinstall_check

bazel] ERROR: Analysis of target '//packages:build' failed; build aborted: 
[bazel] INFO: Elapsed time: 147.795s
[bazel] INFO: 0 processes.
[bazel] 
 HINT 
 HINT If experiencing problems with node_modules try `yarn kbn bootstrap --force-install` or as last resort `yarn kbn reset && yarn kbn bootstrap`
 HINT 
 ERROR  [bootstrap] failed: [bazel] exited with code [1]
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This looks like a typical node-gyp problem on Windows where you're lacking the right Python version etc.
Please see GitHub - nodejs/node-gyp: Node.js native addon build tool

1 Like

Thanks for reply - Milton
Issue has been fixed after adding python 3.11.0 version
I am able to bootstrap Kibana version 8.5.1 using Python version 3.11.0 now

For now come across next issue - i.e.

after starting elasticsearch 8.5.1 (bin/elasticsearch) it is showing below message on terminal,

2024-05-16T22:36:33,888][WARN ][o.e.x.s.t.n.SecurityNetty4HttpServerTransport] [Sunils-MacBook-Pro.local] http client did not trust this server's certificate, closing connection Netty4HttpChannel{localAddress=/[0:0:0:0:0:0:0:1]:9200, remoteAddress=/[0:0:0:0:0:0:0:1]:51183}

the connectivity between kibana & elasticsearch is not happening,
I suspect there is some configuration setting need to be done.

Let me know if somebody have idea regarding the same.

I am not able to generate new token for elasticsearch, getting below error,

Sunils-MacBook-Pro:elasticsearch-8.5.1 sunil$ bin/elasticsearch-create-enrollment-token -s kibana
18:15:57.105 [main] WARN  org.elasticsearch.common.ssl.DiagnosticTrustManager - failed to establish trust with server at [9.243.168.40]; the server provided a certificate with subject name [CN=Sunils-MacBook-Pro.local], fingerprint [d74d21111aca249c7a4c86193f4d6683b343edde], no keyUsage and extendedKeyUsage [serverAuth]; the session uses cipher suite [TLS_AES_256_GCM_SHA384] and protocol [TLSv1.3]; the certificate has subject alternative names [IP:fe80:0:0:0:0:0:0:1,IP:fe80:0:0:0:814:6bff:fe8e:d2d6,IP:fe80:0:0:0:c326:819e:7545:4de2,IP:fe80:0:0:0:e00e:db05:2505:212e,IP:9.243.233.9,IP:fe80:0:0:0:bcd0:74ff:fe2c:967e,IP:fe80:0:0:0:ce81:b1c:bd2c:69e,IP:192.168.0.101,DNS:localhost,IP:0:0:0:0:0:0:0:1,IP:127.0.0.1,IP:fe80:0:0:0:1b95:2151:6cd0:be21,IP:fe80:0:0:0:cda:e747:b493:3a85,DNS:Sunils-MacBook-Pro.local]; the certificate is issued by [CN=Elasticsearch security auto-configuration HTTP CA]; the certificate is signed by (subject [CN=Elasticsearch security auto-configuration HTTP CA] fingerprint [e86bde77935695bb22a870180ce76244867d11da] {trusted issuer}) which is self-issued; the [CN=Elasticsearch security auto-configuration HTTP CA] certificate is trusted in this ssl context ([xpack.security.http.ssl (with trust configuration: Composite-Trust{JDK-trusted-certs,StoreTrustConfig{path=certs/http.p12, password=<non-empty>, type=PKCS12, algorithm=PKIX}})])
java.security.cert.CertificateException: No subject alternative names matching IP address 9.243.168.40 found
	at sun.security.util.HostnameChecker.matchIP(HostnameChecker.java:164) ~[?:?]
	at sun.security.util.HostnameChecker.match(HostnameChecker.java:101) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:458) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:432) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:238) ~[?:?]
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:132) ~[?:?]
	at org.elasticsearch.common.ssl.DiagnosticTrustManager.checkServerTrusted(DiagnosticTrustManager.java:82) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1335) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1226) ~[?:?]
	at sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1169) ~[?:?]
	at sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396) ~[?:?]
	at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480) ~[?:?]
	at sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:458) ~[?:?]
	at sun.security.ssl.TransportContext.dispatch(TransportContext.java:201) ~[?:?]
	at sun.security.ssl.SSLTransport.decode(SSLTransport.java:172) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1510) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1425) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:455) ~[?:?]
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:426) ~[?:?]
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:578) ~[?:?]
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:187) ~[?:?]
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142) ~[?:?]
	at org.elasticsearch.xpack.core.common.socket.SocketAccess.lambda$doPrivileged$0(SocketAccess.java:42) ~[?:?]
	at java.security.AccessController.doPrivileged(AccessController.java:569) ~[?:?]
	at org.elasticsearch.xpack.core.common.socket.SocketAccess.doPrivileged(SocketAccess.java:41) ~[?:?]
	at org.elasticsearch.xpack.core.security.CommandLineHttpClient.execute(CommandLineHttpClient.java:178) ~[?:?]
	at org.elasticsearch.xpack.core.security.CommandLineHttpClient.execute(CommandLineHttpClient.java:112) ~[?:?]
	at org.elasticsearch.xpack.security.tool.BaseRunAsSuperuserCommand.checkClusterHealthWithRetries(BaseRunAsSuperuserCommand.java:214) ~[?:?]
	at org.elasticsearch.xpack.security.tool.BaseRunAsSuperuserCommand.execute(BaseRunAsSuperuserCommand.java:127) ~[?:?]
	at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54) ~[elasticsearch-8.5.1.jar:8.5.1]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:85) ~[elasticsearch-cli-8.5.1.jar:8.5.1]
	at org.elasticsearch.cli.Command.main(Command.java:50) ~[elasticsearch-cli-8.5.1.jar:8.5.1]
	at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64) ~[cli-launcher-8.5.1.jar:8.5.1]

ERROR: Failed to determine the health of the cluster.