Git Credential Helper in Dev Container

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

Git Credential Helper Not Working in Dev Container

Problem Summary

The Git credential helper configured by Cursor fails to authenticate Git operations in Dev Container environments. Git operations fall back to password authentication, which fails because GitHub no longer accepts passwords. The credential helper cannot communicate with the Cursor server due to a broken IPC socket connection.

Environment Details

  • Cursor Version: 2.4.21
  • OS: Debian GNU/Linux 12 (bookworm) - running in Dev Container
  • Git Version: 2.39.5
  • Container Type: Dev Container

Steps to Reproduce

  1. Open a project in Cursor using a Dev Container
  2. Sign in to GitHub through Cursor’s GitHub Pull Requests extension
  3. Attempt to pull/push from terminal: git pull
  4. Git prompts for password authentication instead of using OAuth

Error Messages

Terminal Output

fatal: could not read Password for 'https://[email protected]/repo.git': No such device or address

Credential Helper Error (when testing directly)

Unable to connect to VS Code Dev Containers extension.
Error in request Error: connect ECONNREFUSED /tmp/vscode-remote-containers-ipc-[uuid].sock
    at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1611:16) {
  errno: -111,
  code: 'ECONNREFUSED',
  syscall: 'connect',
  address: '/tmp/vscode-remote-containers-ipc-[uuid].sock'
}

Root Cause Analysis

  1. Credential Helper Configuration: Git is configured with a credential helper that points to:

    /root/.cursor-server/bin/[server-id]/node /tmp/vscode-remote-containers-[uuid].js git-credential-helper
    
  2. Missing Environment Variable: The credential helper script requires REMOTE_CONTAINERS_IPC environment variable to be set, but it’s not set in the container environment.

  3. Stale IPC Socket: The IPC socket file exists (/tmp/vscode-remote-containers-ipc-[uuid].sock) but connections are refused (ECONNREFUSED), indicating the socket is stale or the server isn’t listening on it.

  4. Server Mismatch: The credential helper references an old server path ([old-server-id]) while the actual running server is different ([current-server-id]).

Configuration Details

Git Credential Helper (System Level)

credential.helper=!f() { /root/.cursor-server/bin/[server-id]/node /tmp/vscode-remote-containers-[uuid].js git-credential-helper $*; }; f

IPC Socket File

/tmp/vscode-remote-containers-ipc-[uuid].sock
- Type: Socket file (srwxr-xr-x)
- Last modified: [date] (stale)
- Connection: ECONNREFUSED when attempting to connect

Environment Variables Check

  • REMOTE_CONTAINERS_IPC: Not set (required by credential helper script)
  • VSCODE_IPC_HOOK_CLI: Set to /tmp/vscode-ipc-[uuid].sock

Attempted Solutions

  1. :white_check_mark: Signed in through GitHub Pull Requests extension - authentication works for extension features
  2. :cross_mark: Reconnected container multiple times - didn’t fix credential helper
  3. :cross_mark: Updated credential helper to use current server path - still fails due to IPC connection issue
  4. :cross_mark: Manually set REMOTE_CONTAINERS_IPC environment variable - connection still refused
  5. :white_check_mark: Workaround: Installed GitHub CLI (gh) and configured it as credential helper - this works

Expected Behavior

When signed in to GitHub through Cursor’s GitHub Pull Requests extension, Git operations (pull, push, fetch) should automatically use the OAuth token without prompting for credentials.

Workaround

Install GitHub CLI and configure it as the Git credential helper:

# Install GitHub CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list
apt-get update && apt-get install -y gh

# Authenticate
gh auth login

# Configure Git to use GitHub CLI
git config --local credential.helper '!gh auth git-credential'

Additional Notes

  • The GitHub Pull Requests extension authentication works correctly
  • The issue is specifically with Git CLI operations in terminal
  • The credential helper script exists and is executable, but cannot communicate with the Cursor server
  • This appears to be a Dev Container-specific issue

Request

Please fix the Git credential helper in Dev Container environments to:

  1. Properly set the REMOTE_CONTAINERS_IPC environment variable
  2. Ensure the IPC socket connection is active and working
  3. Update credential helper paths when the server instance changes
  4. Fall back gracefully or provide better error messages when the credential helper fails

Steps to Reproduce

Steps to Reproduce

  1. Open a project in Cursor using a Dev Container
  2. Sign in to GitHub through Cursor’s GitHub Pull Requests extension
  3. Attempt to pull/push from terminal: git pull
  4. Git prompts for password authentication instead of using OAuth

Expected Behavior

Expected Behavior

When signed in to GitHub through Cursor’s GitHub Pull Requests extension, Git operations (pull, push, fetch) should automatically use the OAuth token without prompting for credentials.

Operating System

Linux

Version Information

Cursor Version: 2.4.21

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor
No - Cursor works, but with this issue

1 Like

Hey, thanks for the report. This is a known issue with the credential helper in devcontainers.

Here’s a workaround that works for many users:

  • Install the GitHub Pull Requests extension if you don’t have it yet
  • Open the Command Palette with Ctrl + Shift + P and choose Sign out
  • Then choose Sign in with GitHub and log in
  • Rebuild the container: Rebuild Server and Reload Container

After that, git commands should work.

Your workaround with GitHub CLI is also a great option if the first method doesn’t help.

The team is aware of this IPC socket issue. There’s no specific ETA yet, but your report helps us prioritize it. Let me know if the workaround doesn’t work.