Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the global scope git config (~/gitconfig) is an empty file, it cannot be attached to a dev container. #10084

Open
tun24 opened this issue Jul 20, 2024 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers

Comments

@tun24
Copy link

tun24 commented Jul 20, 2024

Attachment failed when starting devcontainer after removing all globally scoped git settings.
This only occurs when the git config file (~/.gitconfig) is an empty file.
It does not occur if there is no file or if the file is more than 1 byte.

  • VSCode Version:1.91.1
  • Local OS Version: Windows 11 Pro 23H2
  • Remote OS Version: Ubuntu 22.04.3 LTS(WSL)
  • Remote Extension/Connection Type: Containers

Steps to Reproduce:

  1. Create devcontainer.json
    https://code.visualstudio.com/docs/devcontainers/create-dev-container#_create-a-devcontainerjson-file
  2. Create empty git config file
    mv ~/.gitconfg{,.back.devcontainer}
    touch ~/.gitconfig
  3. Open devcontainer in VSCode
result:
[2930 ms] Start: Run in container: # Copy /home/ubuntu/.gitconfig to /home/node/.gitconfig
[2948 ms] Container server did not launch or terminated: Error: unexpected end of parent stream
        at Ii.destroy (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:26638)
        at Ii.write (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:27379)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:29482
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:14866
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17539
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:23891
        at r (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17487)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17532
        at Object.cb (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:24002)
        at l (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:21998)
        at u (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:22260)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:22343
        at s (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:30:5371)
        at Socket.<anonymous> (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:30:5472)
        at Socket.emit (node:events:514:28)
        at addChunk (node:internal/streams/readable:376:12)
        at readableAddChunk (node:internal/streams/readable:349:9)
        at Readable.push (node:internal/streams/readable:286:10)
        at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
[2948 ms] Keep-alive process ended.
[2948 ms] Error reading shell environment.
[2948 ms] Error: unexpected end of parent stream
        at Ii.destroy (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:26638)
        at Ii.write (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:27379)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:29482
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:14866
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17539
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:23891
        at r (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17487)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17532
        at Object.cb (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:24002)
        at l (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:21998)
        at u (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:22260)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:22343
        at s (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:30:5371)
        at Socket.<anonymous> (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:30:5472)
        at Socket.emit (node:events:514:28)
        at addChunk (node:internal/streams/readable:376:12)
        at readableAddChunk (node:internal/streams/readable:349:9)
        at Readable.push (node:internal/streams/readable:286:10)
        at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
[2949 ms] Start: Run in container: mkdir -p '/tmp/devcontainers-540eaddc-29ed-4d3b-a7ee-73da6cf7b8c11721452087070' && cat > '/tmp/devcontainers-540eaddc-29ed-4d3b-a7ee-73da6cf7b8c11721452087070/env-loginInteractiveShell.json' << 'envJSON'
[2950 ms] Failed to cache user env: Shell server failed: Error: unexpected end of parent stream
        at Ii.destroy (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:26638)
        at Ii.write (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:27379)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:29482
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:14866
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17539
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:23891
        at r (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17487)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17532
        at Object.cb (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:24002)
        at l (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:21998)
        at u (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:22260)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:22343
        at s (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:30:5371)
        at Socket.<anonymous> (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:30:5472)
        at Socket.emit (node:events:514:28)
        at addChunk (node:internal/streams/readable:376:12)
        at readableAddChunk (node:internal/streams/readable:349:9)
        at Readable.push (node:internal/streams/readable:286:10)
        at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
[2952 ms] Start: Run in container: umask 077 && XRD="/tmp/user/$(id -u)" && mkdir -p $XRD && echo $XRD
[2959 ms] Shell server failed: Error: unexpected end of parent stream
        at Ii.destroy (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:26638)
        at Ii.write (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:27379)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:29482
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:14866
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17539
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:23891
        at r (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17487)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:17532
        at Object.cb (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:24002)
        at l (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:21998)
        at u (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:22260)
        at c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:27:22343
        at s (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:30:5371)
        at Socket.<anonymous> (c:\Users\user\.vscode\extensions\ms-vscode-remote.remote-containers-0.375.1\dist\extension\extension.js:30:5472)
        at Socket.emit (node:events:514:28)
        at addChunk (node:internal/streams/readable:376:12)
        at readableAddChunk (node:internal/streams/readable:349:9)
        at Readable.push (node:internal/streams/readable:286:10)
        at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
[2963 ms] Host server: packet-stream asked to read after closed { value: { code: 0, signal: null }, end: false, req: -16 }
packet-stream asked to read after closed { value: { code: null, signal: 'SIGPIPE' }, end: false, req: -96 }
packet-stream asked to read after closed { value: { code: 0, signal: null }, end: false, req: -101 }
packet-stream asked to read after closed { value: { code: 0, signal: null }, end: false, req: -67 }
[3011 ms] Host server: packet-stream asked to read after closed { value: { code: null, signal: 'SIGPIPE' }, end: false, req: -117 }
[3039 ms] Host server terminated (code: 0, signal: null).

Does this issue occur when you try this locally?: Yee
Does this issue occur when you try this locally and all extensions are disabled?: Yes

@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Jul 20, 2024
@chrmarti
Copy link
Contributor

Unfortunately I cannot reproduce it. Could you append your devcontainer.json?

@chrmarti chrmarti added the info-needed Issue requires more information from poster label Jul 22, 2024
@tun24
Copy link
Author

tun24 commented Jul 23, 2024

Here is the devcontainer.json I used for verification.
devcontainer.json

Full logs of success and failure will also be included.
We reinstalled Ubuntu 24.04 on WSL and installed Docker Engine to verify.

  • On success: ~/.gitconfig is not an empty file
    success.log

  • On failure: ~/.gitconfig is an empty file
    failed.log

@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers
Projects
None yet
Development

No branches or pull requests

2 participants