Open padrepitufo opened 10 months ago
same bug with most recent release as of today (Zed 0.119.20), may not be a solution for this but here's Zscaler's current support page https://help.zscaler.com/zia/adding-custom-certificate-application-specific-trust-store
Same error, getting this when opening an Angular project and Zed tries to install the Typescript Language Server:
Language server error: TypeScript
failed to execute npm info subcommand:
stdout: "{\n \"error\": {\n \"code\": \"UNABLE_TO_GET_ISSUER_CERT_LOCALLY\",\n \"summary\": \"request to https://registry.npmjs.org/typescript failed, reason: unable to get local issuer certificate\",\n \"detail\": \"\"\n }\n}\n"
stderr: "npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY\nnpm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY\nnpm ERR! request to https://registry.npmjs.org/typescript failed, reason: unable to get local issuer certificate\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR! /Users/user/Library/Application Support/Zed/node/node-v18.15.0-darwin-x64/cache/_logs/2024-01-27T17_37_53_897Z-debug-0.log\n"
NodeJS isn't using the macOS certificate store, causing these problems. I have this in my fish shell to workaround this when working with NodeJS applications:
set -Ux NODE_EXTRA_CA_CERTS ~/company-root-ca.pem
I assume this needs to be implemented as a setting for Zed and passed to NPM, at least I couldn't find another workaround with a quick search.
Zed is currently using Node v18.15.0 as a dependency in ~/Library/Application Support/Zed/node/...
and I can confirm this env variable (NODE_EXTRA_CA_CERTS) is getting loaded correctly in to the env variables:
Despite this, the error continues
I would suggest renaming the issue, that node custom certs is not supported, as zscaler is only one specific mitm proxy. there are also other proxies that need the same configuration.
PS: makes zed unusable behind a corporate proxy
I'm running into the same issue - Zed is unusable for next-ls
the Elixir language server while behind the firewall. I have set the environment variables for the ca certificates - but they're not showing up in the logs.
There should be an env var called HEX_CACERTS_PATH
- which I've confirmed is active in my environment and shell, but not Zed.
[Next LS] NextLS v0.22.8 has initialized!
[Next LS] Log file located at /Users/xxxxxxx/ingest/server/.elixir-tools/next-ls.log
[Next LS] [extension] Credo initializing with options %NextLS.InitOpts.Extensions.Credo{enable: true, cli_options: []}
stderr: ** (Mix) httpc request failed with: {:failed_connect, [{:to_address, {~c"builds.hex.pm", 443}}, {:inet, [:inet], {:tls_alert, {:unknown_ca, ~c"TLS client: In state certify at ssl_handshake.erl:2174 generated CLIENT ALERT: Fatal - Unknown CA\n"}}}]}
stderr:
stderr: Could not install Rebar because Mix could not download metadata at https://builds.hex.pm/installs/rebar3-1.x.csv.
stderr:
[Next LS] Failed to unzip and install the bundled Elixir archive.
** (MatchError) no match of right hand side value: {"", 1}
(next_ls 0.22.8) lib/next_ls/runtime/bundled_elixir.ex:49: NextLS.Runtime.BundledElixir.install/2
(next_ls 0.22.8) lib/next_ls.ex:902: NextLS.handle_notification/2
(gen_lsp 0.10.0) lib/gen_lsp.ex:478: anonymous fn/2 in GenLSP.loop/3
(telemetry 1.2.1) /private/tmp/next-ls-20240531-10295-xqrzy1/next-ls-0.22.8/deps/telemetry/src/telemetry.erl:321: :telemetry.span/3
(gen_lsp 0.10.0) lib/gen_lsp.ex:474: anonymous fn/7 in GenLSP.loop/3
(gen_lsp 0.10.0) lib/gen_lsp.ex:553: GenLSP.attempt/4
(stdlib 5.2.3) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
[Next LS] Booting runtimes...
[Next LS] Beginning DB migration...
[Next LS] Database is on the latest version: 7
[Next LS] Finished DB migration...
[Next LS] Booting runtime for .
- elixir: /Users/xxxxxx/.cache/elixir-tools/nextls/elixir/1-17-1/bin/elixir
- zombie wrapper script: /Users/xxxxxx/Library/Application Support/.burrito/next_ls_erts-14.2.5_0.22.8/lib/next_ls-0.22.8/priv/cmd
- working_dir: /Users/xxxxxx/ingest/server
- command: /Users/xxxxx/.cache/elixir-tools/nextls/elixir/1-17-1/bin/elixir --no-halt --sname nextls-runtime-1723725088671421708 --cookie xxxxxxx -S mix loadpaths --no-compile
Environment:
LSP=nextls
NEXTLS_PARENT_PID=g1h3JW5leHQtbHMtMTcyMzcyNTA4NzkzNjk2NjIwOEBJTkw2MjE4MzYAAAEHAAAAAGa99SA=
MIX_ENV=dev
MIX_TARGET=host
MIX_BUILD_ROOT=.elixir-tools/_build
ROOTDIR=false
BINDIR=false
RELEASE_ROOT=false
RELEASE_SYS_CONFIG=false
PATH=/Users/xxxxxx/.cache/elixir-tools/nextls/elixir/1-17-1/bin:/Users/xxxx/Library/Application Support/.burrito/next_ls_erts-14.2.5_0.22.8/bin:/opt/homebrew/opt/openjdk@17/bin:/opt/homebrew/opt/openjdk/bin:/opt/homebrew/opt/openjdk@17/bin:/opt/homebrew/opt/openjdk@17/bin:/opt/homebrew/opt/openjdk@11/bin:/Users/xxxxxxx/.cache/rebar3/bin:/Users/xxxxx/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/Library/Frameworks/Python.framework/Versions/3.12/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/usr/local/go/bin:/opt/podman/bin:/Users/xxxxxxx/.cargo/bin:/Users/xxxxx/.local/bin:/Users/xxxxx/go/bin
MIX_HOME=/Users/xxxxxx/.cache/elixir-tools/nextls/elixir/1-17-1/.mix
[Next LS] Mix requires the Hex package manager to fetch dependencies
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn]
[Next LS] ** (Mix) Could not find an SCM for dependency :argon2_elixir from Ingest.MixProject
[Next LS] Runtime for folder failed to initialize
[Next LS] The runtime for has successfully shut down.
[Next LS] Client does not support window/showMessageRequest
Check for existing issues
Describe the bug / provide steps to reproduce it
Receiving the following error (with some redactions):
the log contents were (with redacted)
Environment
TLDR
Complete ( ran:
system_profiler SPHardwareDataType | pbcopy
)Hardware:
If applicable, add mockups / screenshots to help explain present your vision of the feature
If applicable, attach your
~/Library/Logs/Zed/Zed.log
file to this issue.If you only need the most recent lines, you can run the
zed: open log
command palette action to see the last 1000.