Cursor CLI indexing still fails inside Docker (`ConnectError: [unauthenticated]`)

Where does the bug appear (feature/product)?

Cursor CLI

Describe the Bug

Environment

  • Host: Windows 11
  • Container: Ubuntu 22.04 base image
  • Cursor CLI: 2025.11.25-d5b3271
  • Docker service definition (key bits): mounts repo at /code-src, sets CURSOR_API_KEY, CODE_SEARCH_ROOTS=/code-src, and copies a permissive cli-config.json into ~/.cursor.
  • Additional tooling installed in the image: Node.js 20, typescript and typescript-language-server (needed because the worker spawns npx typescript-language-server).

What I’m doing

  1. Build and start the cursor service via docker compose.
  2. Exec into the container (docker exec -it cursor_cli bash).
  3. Manually authenticate with cursor-agent --api-key <KEY> and confirm cursor-agent status shows “Authenticated”.
  4. Kick off indexing by running any agent command or by letting the background worker start.

Observed behavior (inside Docker)

Worker log (/root/.cursor/projects/code-src/worker.log) always ends like this:

[info] runServer socketPath=/root/.cursor/projects/code-src/worker.sock
[info] Indexing now
[info] Getting tree structure for workspacePath=/code-src
[error] Indexing failed ERROR: ConnectError: [unauthenticated] Error
    at errorFromJson (.../index.js:6267:19)
    at errorFromJsonBytes (.../index.js:6305:12)
    at next (.../index.js:6932:31)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
[error] Indexing run failed ERROR: undefined
[info] Indexing finished

The CLI command itself still works (it uses the API key directly), but the worker never manages to index /code-src, so repo search/context is unavailable.

What I verified

  • Credentials: cursor-agent status succeeds right after --api-key. I also checked /root/.cursor/credentials is populated when I log in manually.
  • Network: Followed Network Configuration tests from inside the container. TLS shows Amazon certs (no SSL inspection), HTTP/1.1 SSE and HTTP/2 bidirectional streaming both work without buffering.
  • Tooling: Installed Node.js and typescript-language-server so the worker can launch npx typescript-language-server without “tsserver not found” errors.
  • Config: Using a permissive cli-config.json with Shell/Read/Write(*) just like the one in the original forum post (and the newer version copied in /usr/local/share/cursor-cli/cli-config.json).
  • Comparison run: Repeated the exact same steps under WSL (no Docker). There indexing completes successfully; the difference appears only in the containerized environment.

Expectation

Once I log in with a valid API key and networking checks pass, the worker should be able to complete fastRepoInitHandshakeV2 and index /code-src. Instead it always dies with ConnectError: [unauthenticated].

What I need

Guidance on what else needs to be configured for Docker deployments, or confirmation that this is a known bug that still isn’t fixed. Original report (September 2025) describing the same behavior: Issue with indexing in Docker container (cursor-agent) — the new CLI version doesn’t seem to have resolved it.

Happy to provide additional sanitized logs if required.

Steps to Reproduce

Steps to reproduce

  1. Install Cursor CLI in WSL (baseline).

    • Fresh Ubuntu (WSL) shell.
    • Run curl https://cursor.com/install -fsS | bash.
    • cursor-agent --api-key <KEY> and verify cursor-agent status → “Authenticated”.
    • In any repo run cursor-agent -p "List files"; worker log stays clean and indexing completes.
  2. Set up Dockerized Cursor CLI (failing case).

    • Image: Ubuntu 22.04 with added nodejs, typescript, typescript-language-server, and the same Cursor CLI install command.
    • Service mounts repo at /code-src, sets CURSOR_API_KEY, CODE_SEARCH_ROOTS=/code-src, and copies a permissive cli-config.json into ~/.cursor.
    • Start container (docker compose up -d cursor), exec inside, run cursor-agent --api-key <KEY>cursor-agent status shows “Authenticated”.
    • Trigger indexing by running cursor-agent -p "List files" or by waiting for the background worker.
  3. Compare Worker Logs.

    • WSL run: /root/.cursor/projects/<repo>/worker.log shows normal indexing.
    • Docker run: same log immediately contains
      [info] Indexing now
      [info] Getting tree structure for workspacePath=/code-src
      [error] Indexing failed ERROR: ConnectError: [unauthenticated]
      

Expected Behavior

Expected result

Once the CLI is authenticated (confirmed by cursor-agent status) and network checks succeed, the Dockerized worker should behave like the WSL one: finish fastRepoInitHandshakeV2, index /code-src, and avoid ConnectError: [unauthenticated]. Instead, only the Docker container keeps failing, making repo indexing unusable there.

Operating System

Linux

Current Cursor Version (Menu → About Cursor → Copy)

Version: 2025.11.25-d5b3271

Does this stop you from using Cursor

No - Cursor works, but with this issue

Is there any update on this Cursor team? Even I am facing the same issue. This is still an issue with the 2025.12.17-996666f version.

Thanks for the detailed report. I’ve flagged it to the team.

@Sudarshan_V - thanks for confirming it’s still occurring on 2025.12.17-996666f version.



[info] Getting tree structure for workspacePath=/opt/cursor-agent/kb

[error] Indexing failed ERROR: ConnectError: [unauthenticated] Error

    at errorFromJson (/home/muhammad.kumbhare/.local/share/cursor-agent/versions/2026.01.02-80e4d9b/index.js:6298:19)

    at errorFromJsonBytes (/home/muhammad.kumbhare/.local/share/cursor-agent/versions/2026.01.02-80e4d9b/index.js:6336:12)

    at next (/home/muhammad.kumbhare/.local/share/cursor-agent/versions/2026.01.02-80e4d9b/index.js:6963:31)

    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)

    at async /home/muhammad.kumbhare/.local/share/cursor-agent/versions/2026.01.02-80e4d9b/index.js:280180:16

    at async Object.unary (/home/muhammad.kumbhare/.local/share/cursor-agent/versions/2026.01.02-80e4d9b/index.js:6910:20)

    at async Object.fastRepoInitHandshakeV2 (/home/muhammad.kumbhare/.local/share/cursor-agent/versions/2026.01.02-80e4d9b/index.js:7826:26)

    at async RepositoryIndexer.index (/home/muhammad.kumbhare/.local/share/cursor-agent/versions/2026.01.02-80e4d9b/index.js:251024:26)

    at async IndexingManager.indexNow (/home/muhammad.kumbhare/.local/share/cursor-agent/versions/2026.01.02-80e4d9b/index.js:279983:13)

[error] Indexing run failed ERROR: [unauthenticated] Error

I am also facing the same issue inside a Docker container.