zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
51k stars 3.16k forks source link

Copilot not starting #18004

Open DMEvanCT opened 2 months ago

DMEvanCT commented 2 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

  1. Open Zed
  2. Click login with Copilot
  3. Error occurs
  4. Reinstall Copilot

Environment

Apple M1 Max 32 GB Ram 2021

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

Zed.log

2024-09-18T08:40:13.970671-04:00 [INFO] Language server with id 0 sent unhandled notification LogMessage:
{
  "level": 0,
  "message": "[DEBUG] [agent] [2024-09-18T12:40:13.968Z] Agent service starting",
  "metadataStr": "[DEBUG] [agent] [2024-09-18T12:40:13.968Z]",
  "extra": [
    "Agent service starting"
  ]
}
2024-09-18T08:40:13.97186-04:00 [INFO] Language server with id 0 sent unhandled notification client/registerCapability:
{
  "registrations": [
    {
      "id": "2366269e-f966-464a-a9e7-ef26aac74fed",
      "method": "workspace/didChangeWorkspaceFolders",
      "registerOptions": {}
    }
  ]
}
notpeter commented 2 months ago
  1. Can you please edit your description to include a copy of your system specs (cmd-shift-p, "zed: copy system specs to clipboard").
  2. Can you expand further on Error occurs / Reinstall Copilot?

What is the error (there's nothing of note in the log provided)?

nicpaimnt commented 1 month ago

I have a similar if not the same problem

Environment

Apple M2 mac book air 16 GB Ram 2023

Zed about

Zed: v0.156.1 (Zed)
OS: macOS 15.0.1
Memory: 16 GiB
Architecture: aarch64
image

clicking reinstall copilots does 'something' for a couple of seconds and back to the same icon with a little cross and the same popup.

relevant settings

   "features": {
    "copilot": true
  },
  "show_copilot_suggestions": true,
  "copilot": {
    "disabled_globs": [".env", "examples/**"]
  },

log

0 verbose cli /opt/homebrew/Cellar/node/22.5.1/bin/node /opt/homebrew/bin/npm
1 info using npm@10.8.2
2 info using node@v22.5.1
3 silly config load:file:/opt/homebrew/lib/node_modules/npm/npmrc
4 silly config load:file:/.npmrc
5 silly config load:file:/Users/n/Library/Application Support/Zed/node/blank_user_npmrc
6 silly config load:file:/Users/n/Library/Application Support/Zed/node/blank_global_npmrc
7 verbose title npm info vscode-langservers-extracted
8 verbose argv "info" "--cache" "/Users/n/Library/Application Support/Zed/node/cache" "--userconfig" "/Users/n/Library/Application Support/Zed/node/blank_user_npmrc" "--globalconfig" "/Users/n/Library/Application Support/Zed/node/blank_global_npmrc" "vscode-langservers-extracted" "--json" "--fetch-retry-mintimeout" "2000" "--fetch-retry-maxtimeout" "5000" "--fetch-timeout" "5000"
9 verbose logfile logs-max:10 dir:/Users/n/Library/Application Support/Zed/node/cache/_logs/2024-10-14T06_26_42_031Z-
10 verbose logfile /Users/n/Library/Application Support/Zed/node/cache/_logs/2024-10-14T06_26_42_031Z-debug-0.log
11 silly logfile start cleaning logs, removing 2 files
12 silly logfile done cleaning log files
13 http fetch GET https://registry.npmjs.org/vscode-langservers-extracted attempt 1 failed with UNABLE_TO_GET_ISSUER_CERT_LOCALLY
14 http fetch GET https://registry.npmjs.org/vscode-langservers-extracted attempt 2 failed with UNABLE_TO_GET_ISSUER_CERT_LOCALLY
15 http fetch GET https://registry.npmjs.org/vscode-langservers-extracted attempt 3 failed with UNABLE_TO_GET_ISSUER_CERT_LOCALLY
16 verbose type system
17 verbose stack FetchError: request to https://registry.npmjs.org/vscode-langservers-extracted failed, reason: unable to get local issuer certificate
17 verbose stack     at ClientRequest.<anonymous> (/opt/homebrew/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
17 verbose stack     at ClientRequest.emit (node:events:520:28)
17 verbose stack     at _destroy (node:_http_client:875:13)
17 verbose stack     at onSocketNT (node:_http_client:895:5)
17 verbose stack     at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
18 error code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
19 error errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
20 error request to https://registry.npmjs.org/vscode-langservers-extracted failed, reason: unable to get local issuer certificate
21 verbose cwd /
22 verbose os Darwin 24.0.0
23 verbose node v22.5.1
24 verbose npm  v10.8.2
25 verbose exit 1
26 verbose code 1
27 error A complete log of this run can be found in: /Users/n/Library/Application Support/Zed/node/cache/_logs/2024-10-14T06_26_42_031Z-debug-0.log

Note I also observe an error from the json language server when running settings

Language server error: json-language-server

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/vscode-langservers-extracted failed, reason: unable to get local issuer certificate\",\n    \"detail\": \"\"\n  }\n}\n"
stderr: "npm error code UNABLE_TO_GET_ISSUER_CERT_LOCALLY\nnpm error errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY\nnpm error request to https://registry.npmjs.org/vscode-langservers-extracted failed, reason: unable to get local issuer certificate\nnpm error A complete log of this run can be found in: /Users/n/Library/Application Support/Zed/node/cache/_logs/2024-10-14T06_26_42_031Z-debug-0.log\n"
-- stderr--

HTH

notpeter commented 1 month ago

@nicpaimnt I believe your issue is unrelated and likely caused by a mitm proxy (e.g. corporate proxy which unwraps SSL). Please open a new issue instead of hijacking this one.

nicpaimnt commented 1 month ago

@nicpaimnt I believe your issue is unrelated and likely caused by a mitm proxy (e.g. corporate proxy which unwraps SSL). Please open a new issue instead of hijacking this one.

Ok fair enough but I get the same at home and at work. At work I'm straight on a 5G router and at home I'm on a private fibre line. I really don't see a mitm proxy here. Do as you will, it was working before.

Edit: And btw I have installed 153.7 and language servers and copilot work fine. So, strange mitm proxy issue that is.

Edit 2: moving on from the snark, the last version to work is 154.4. As of 155.2 it stopped working. Going by the stable releases on the website. For now I'll stick to 154.4 and disable auto updates.

notpeter commented 1 month ago

Good to know you've found a working version. Apologies for the mitm proxy snark. Since OP (@DMEvanCT) is AWOL, this can be your issue now.

We've recently made some significant changes in main in our http_client which may have inadvertently fixed this. If you were willing, you could build zed and see if you're still having the issue.

Alternatively, if you (or someone else who runs into this issue) did a git bisect between 0.154.4 and 0.155.2 we could potentially identify the offending commit.

DMEvanCT commented 1 month ago

I can give that a shot.

wangl-cc commented 1 month ago

I had the same issue with being ‘unable to get a local issuer certificate,’ and after bisecting the code, I found that the first faulty commit was 3ba071b993099cdd9365f2223dd41fabf26df266, which enabled the use of the system node. I fixed it by reinstalling ca-certificates. I hope this helps others facing the same issue.