# Issue with indexing in Docker container (cursor-agent)

**URL:** <https://forum.cursor.com/t/issue-with-indexing-in-docker-container-cursor-agent/132966>\
**Category:** Bug Reports\
**Tags:** cli\
**Created:** [September 8, 2025, 5:24pm UTC](https://forum.cursor.com/t/issue-with-indexing-in-docker-container-cursor-agent/132966 "2025-09-08T17:24:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladislav\_DEV](https://avatars.discourse-cdn.com/v4/letter/v/90ced4/32.png) [@Vladislav\_DEV](https://forum.cursor.com/u/Vladislav_DEV)\
**Post date:** [September 8, 2025, 5:24pm UTC](https://forum.cursor.com/t/issue-with-indexing-in-docker-container-cursor-agent/132966/1 "2025-09-08T17:24:56Z")

</div>

### Where does the bug appear (feature/product)?

Cursor CLI

### Describe the Bug

* * *

**Subject: Cursor Agent Indexing Fails with Authentication Error in Docker Container**

**Description:**

I’m experiencing an issue where cursor-agent fails to index the codebase when running inside a Docker container. The agent returns an authentication error despite having a valid CURSOR\_API\_KEY configured.

**Error logs from** `root/.cursor/projects/code-src/worker.log`:

```auto
[info] runServer
[info] Indexing now
[info] Getting tree structure for workspacePath=/code-src
[error] Indexing failed ERROR: ConnectError: [unauthenticated] Error
    at Yg (file:///root/.local/share/cursor-agent/versions/2025.09.04-fc40cd1/index-y05a0qn2.js:129:6053)
    at z0 (file:///root/.local/share/cursor-agent/versions/2025.09.04-fc40cd1/index-y05a0qn2.js:129:6458)
    at next (file:///root/.local/share/cursor-agent/versions/2025.09.04-fc40cd1/index-y05a0qn2.js:129:15541)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///root/.local/share/cursor-agent/versions/2025.09.04-fc40cd1/index-jhmwpaha.js:4:7432
    at async Object.unary (file:///root/.local/share/cursor-agent/versions/2025.09.04-fc40cd1/index-y05a0qn2.js:129:14544)
    at async Object.fastRepoInitHandshakeV2 (file:///root/.local/share/cursor-agent/versions/2025.09.04-fc40cd1/index-ahprgwys.js:1:13861)
    at async TH.index (file:///root/.local/share/cursor-agent/versions/2025.09.04-fc40cd1/index-my3wxw98.js:2:9905)
    at async I.indexNow (file:///root/.local/share/cursor-agent/versions/2025.09.04-fc40cd1/index-jhmwpaha.js:2:7135)
[error] Indexing run failed ERROR: undefined
[info] Indexing finished

```

**Environment Setup:**

My `cli-config.json`:

```json
{
  "permissions": {
    "allow": [
      "Shell(*)",
      "Read(*)",
      "Write(*)"
    ],
    "deny": []
  },
  "version": 1,
  "editor": {
    "vimMode": false
  },
  "model": {
    "modelId": "default",
    "displayModelId": "auto",
    "displayName": "Auto",
    "displayNameShort": "Auto",
    "aliases": [
      "auto"
    ]
  },
  "hasChangedDefaultModel": false,
  "privacyCache": {
    "ghostMode": true,
    "privacyMode": 2,
    "updatedAt": 1757345127362
  }
}

```

**Dockerfile:**

```dockerfile
FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN set -eux; \
    rm -rf /var/lib/apt/lists/*; \
    mkdir -p /var/lib/apt/lists/partial; \
    apt-get update -o Acquire::Retries=3 -o Acquire::http::No-Cache=true -o Acquire::http::Pipeline-Depth=0; \
    apt-get install -y --no-install-recommends \
        curl \
        bash \
        ca-certificates \
        git \
        jq; \
    apt-get clean; \
    rm -rf /var/lib/apt/lists/*

# Install Cursor CLI (cursor-agent)
RUN curl https://cursor.com/install -fsS | bash

# Ensure Cursor CLI is on PATH for all shells
ENV PATH="/root/.local/bin:$PATH"
RUN echo 'export PATH="$HOME/.local/bin:$PATH"' >> /root/.bashrc

WORKDIR /workspace

CMD ["bash", "-lc", "echo 'Cursor CLI ready. Use: docker exec -it cursor_cli bash'; tail -f /dev/null"]

```

**Docker Compose configuration:**

```yaml
cursor:
  build:
    context: ./cursor-cli
    dockerfile: Dockerfile
  container_name: cursor_cli
  env_file:
    - .env
  environment:
    - CURSOR_API_KEY=${CURSOR_API_KEY}
    - CODE_SEARCH_ROOTS=/code-src
    - NO_PROXY=api2.cursor.sh,api3.cursor.sh,repo42.cursor.sh,api4.cursor.sh,us-asia.gcpp.cursor.sh,us-eu.gcpp.cursor.sh,us-only.gcpp.cursor.sh,marketplace.cursorapi.com,cursor-cdn.com,downloads.cursor.com,anysphere-binaries.s3.us-east-1.amazonaws.com
    - no_proxy=api2.cursor.sh,api3.cursor.sh,repo42.cursor.sh,api4.cursor.sh,us-asia.gcpp.cursor.sh,us-eu.gcpp.cursor.sh,us-only.gcpp.cursor.sh,marketplace.cursorapi.com,cursor-cdn.com,downloads.cursor.com,anysphere-binaries.s3.us-east-1.amazonaws.com
  working_dir: /workspace
  volumes:
    - .:/workspace
    - ./tools/cursor/cli-config.json:/root/.cursor/cli-config.json:ro
    - "/path/to/repo:/code-src:rw"
  command: ["bash", "-lc", "echo 'Cursor ready. Try: cursor-agent status'; tail -f /dev/null"]

```

**What I’ve tried:**

1. Verified CURSOR\_API\_KEY is properly set and accessible in the container
2. Set proper permissions in cli-config.json to allow all operations
3. Added Cursor domains to NO\_PROXY environment variables
4. Installed ca-certificates in the container
5. Running `cursor-agent status` shows the agent is installed but indexing fails

**Additional Information:**

- cursor-agent version: 2025.09.04-fc40cd1
- Running on Ubuntu 22.04 base image in Docker
- The same API key works fine when used outside of Docker
- Network connectivity from container to external services is working

**Questions:**

1. Are there specific network requirements or ports that need to be exposed for cursor-agent to authenticate properly in a Docker environment?
2. Is there additional configuration needed for cursor-agent to work inside containers?
3. Are there any known issues with the authentication handshake (`fastRepoInitHandshakeV2`) when running in containerized environments?

Any guidance on resolving this authentication error would be greatly appreciated.

Thank you!

* * *

### Steps to Reproduce

Docker instructions are attached.  
Issue can be reproduced by just requesting anything via cursor-agent “Prompt”

### Operating System

Windows 10/11

### Current Cursor Version (Menu → About Cursor → Copy)

Cursor CLI Version: 2025.09.04-fc40cd1

### For AI issues: which model did you use?

Auto

---

<div class="post-metadata">

**Author:** ![condor](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/condor/32/73148_2.png) [@condor](https://forum.cursor.com/u/condor)\
**Post date:** [September 29, 2025, 11:44pm UTC](https://forum.cursor.com/t/issue-with-indexing-in-docker-container-cursor-agent/132966/2 "2025-09-29T23:44:52Z")

</div>

hi @Vladislav_DEV we have released new version with several improvements. Could you check if the issue persists also on the latest version?

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/system/32/99069_2.png) [@system](https://forum.cursor.com/u/system)\
**Post date:** [October 21, 2025, 11:45pm UTC](https://forum.cursor.com/t/issue-with-indexing-in-docker-container-cursor-agent/132966/3 "2025-10-21T23:45:46Z")

</div>

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.
