Failed to read .gitconfig: TypeError [ERR_INVALID_ARG_TYPE]: The “path” argument must be of type string. Received undefined
2026-03-08 12:26:16.255 [error] Error resolving dev container authority The “path” argument must be of type string. Received undefined
Hey, this is a known issue. We’ve seen it reported before in this thread with the exact same error. The extension team looked into it, but they can’t reproduce it consistently.
A couple of questions to help narrow this down:
Can you share the exact Cursor version? (Help > About Cursor > Copy)
Are you attaching to a local Docker container directly, or are you going through Remote SSH first?
One workaround that sometimes helps is to make sure ~/.gitconfig exists on the host machine where Docker is running:
from within that container call again Attach to running container and jump into another one
Now I get Failed to read .gitconfig
The solution is to not execute the command from containers (guests) but only from a host.
Via the normal command mode you can’t attach to a container from other containers, but if you have a keyboard shortcut set to remote-containers.attachToRunningContainerFromViewlet it will try to.
The issue comes from a nested dev container (Windows host → ssh to remote dev machine → Tries to build dev container based on a Docker image.
Under which scenario there is no way to identify whether $HOME exists as the terminal/connection is already broken at the time it stops. Even if I ssh to the remote host and run echo $HOME this is not very useful because your ssh connection might be different.
I manually set gitconfig in host and mount it in container.
BTW, vscode not have this issue, seems the problem is between cursor extension and vscode extension.
Hey, thanks for the update and for sharing the .gitconfig mount workaround. It’s helpful for other users in this thread.
Your note about the difference vs VS Code is an important signal. The issue is in our fork of the Dev Containers extension, where path resolution for $HOME breaks in certain scenarios. The team is aware of the bug, but there’s no ETA yet.
For now, mounting .gitconfig is the best workaround. We’ll update this thread if there’s a fix.