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

Podman: clone repository in container volume gets error: dial unix /var/run/docker.sock: connect: permission denied #5548

Closed
leighmcculloch opened this issue Sep 5, 2021 · 1 comment
Labels
containers Issue in vscode-remote containers *duplicate Issue identified as a duplicate of another issue(s)

Comments

@leighmcculloch
Copy link

leighmcculloch commented Sep 5, 2021

  • VSCode Version: 1.60.0
  • Local OS Version: macOS 11.5.2
  • Remote OS Version: Go predefined configuration
  • Remote Extension/Connection Type: Docker (Podman)
  • Logs:
Expand for Logs
[144 ms] Remote-Containers 0.194.0 in VS Code 1.60.0 (e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff).
[143 ms] Start: Resolving Remote
[159 ms] Start: Check Docker is running
[159 ms] Start: Run: podman version --format {{.Server.APIVersion}}
[386 ms] Stop (227 ms): Run: podman version --format {{.Server.APIVersion}}
[386 ms] Server API version: 3.3.0
[386 ms] Stop (227 ms): Check Docker is running
[387 ms] Start: Run: podman volume ls -q
[506 ms] Stop (119 ms): Run: podman volume ls -q
[507 ms] Start: Run: podman volume create --label vsch.local.repository=https://github.com/stellar/experimental-payment-channels.git/tree/main --label vsch.local.repository.unique=true --label vsch.local.repository.branch=main experimental-payment-channels-main-65cdbf4f1d846b6966a54a0f866e5f4e
[633 ms] Stop (126 ms): Run: podman volume create --label vsch.local.repository=https://github.com/stellar/experimental-payment-channels.git/tree/main --label vsch.local.repository.unique=true --label vsch.local.repository.branch=main experimental-payment-channels-main-65cdbf4f1d846b6966a54a0f866e5f4e
[634 ms] Start: Run: podman ps -q -a --filter label=vsch.local.repository=https://github.com/stellar/experimental-payment-channels.git/tree/main --filter label=vsch.local.repository.volume=experimental-payment-channels-main-65cdbf4f1d846b6966a54a0f866e5f4e --filter label=vsch.local.repository.folder=experimental-payment-channels --filter label=vsch.quality=stable
[780 ms] Stop (146 ms): Run: podman ps -q -a --filter label=vsch.local.repository=https://github.com/stellar/experimental-payment-channels.git/tree/main --filter label=vsch.local.repository.volume=experimental-payment-channels-main-65cdbf4f1d846b6966a54a0f866e5f4e --filter label=vsch.local.repository.folder=experimental-payment-channels --filter label=vsch.quality=stable
[781 ms] Start: Run: podman build -f /Users/leighmcculloch/.vscode/extensions/ms-vscode-remote.remote-containers-0.194.0/scripts/volumeBootstrap.Dockerfile -t vsc-volume-bootstrap /Users/leighmcculloch/.vscode/extensions/ms-vscode-remote.remote-containers-0.194.0/scripts
STEP 1/2: FROM alpine:3.13.2
STEP 2/2: RUN apk add --no-cache        nodejs        git     openssh-client  docker-cli  docker-compose   bash    ;
--> Using cache 7f388b57a163b45a5d6cb1ec00adead6ef1075407e14d26fb5a4cb5c5ab1313a
COMMIT vsc-volume-bootstrap
--> 7f388b57a16
Successfully tagged localhost/vsc-volume-bootstrap:latest
7f388b57a163b45a5d6cb1ec00adead6ef1075407e14d26fb5a4cb5c5ab1313a
[1321 ms] Stop (540 ms): Run: podman build -f /Users/leighmcculloch/.vscode/extensions/ms-vscode-remote.remote-containers-0.194.0/scripts/volumeBootstrap.Dockerfile -t vsc-volume-bootstrap /Users/leighmcculloch/.vscode/extensions/ms-vscode-remote.remote-containers-0.194.0/scripts
[1321 ms] Cloning Github repository: stellar/experimental-payment-channels into /workspaces/experimental-payment-channels

[1322 ms] Start: Run: podman run -d --mount type=volume,src=experimental-payment-channels-main-65cdbf4f1d846b6966a54a0f866e5f4e,dst=/workspaces -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
[1547 ms] Stop (225 ms): Run: podman run -d --mount type=volume,src=experimental-payment-channels-main-65cdbf4f1d846b6966a54a0f866e5f4e,dst=/workspaces -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
[1548 ms] Start: Run in container: /bin/sh
[1553 ms] Start: Launching Remote-Containers helper.
[1553 ms] Start: Run: gpgconf --list-dir agent-extra-socket
[1554 ms] Stop (1 ms): Run: gpgconf --list-dir agent-extra-socket
[1555 ms] Stop (2 ms): Launching Remote-Containers helper.
[1555 ms] Stop (2 ms): Run: gpgconf --list-dir agent-extra-socket
[1556 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-5b739faa1f21534698afff85599745d2368341b5.js' >/tmp/vscode-remote-containers-5b739faa1f21534698afff85599745d2368341b5.js
[1694 ms] 
[1694 ms] 
[1694 ms] Stop (138 ms): Run in container: cat <<'EOF-/tmp/vscode-remote-containers-5b739faa1f21534698afff85599745d2368341b5.js' >/tmp/vscode-remote-containers-5b739faa1f21534698afff85599745d2368341b5.js
[1695 ms] Start: Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-5b739faa1f21534698afff85599745d2368341b5.js' >/tmp/vscode-remote-containers-server-5b739faa1f21534698afff85599745d2368341b5.js
[1699 ms] 
[1699 ms] 
[1699 ms] Stop (4 ms): Run in container: cat <<'EOF-/tmp/vscode-remote-containers-server-5b739faa1f21534698afff85599745d2368341b5.js' >/tmp/vscode-remote-containers-server-5b739faa1f21534698afff85599745d2368341b5.js
[1699 ms] Start: Run in container: node /tmp/vscode-remote-containers-server-5b739faa1f21534698afff85599745d2368341b5.js
[1704 ms] Start: Run in container: command -v git >/dev/null 2>&1 && git config --global credential.helper '!f() { node /tmp/vscode-remote-containers-5b739faa1f21534698afff85599745d2368341b5.js $*; }; f' || true
[1707 ms] 
[1707 ms] 
[1708 ms] Stop (4 ms): Run in container: command -v git >/dev/null 2>&1 && git config --global credential.helper '!f() { node /tmp/vscode-remote-containers-5b739faa1f21534698afff85599745d2368341b5.js $*; }; f' || true
[1708 ms] Start: Run in container: # Test for /root/.ssh/known_hosts and ssh
[1711 ms] 
[1711 ms] 
[1711 ms] Stop (3 ms): Run in container: # Test for /root/.ssh/known_hosts and ssh
[1711 ms] Start: Run in container: # Copy /Users/leighmcculloch/.ssh/known_hosts to /root/.ssh/known_hosts
[1714 ms] 
[1714 ms] 
[1714 ms] Stop (3 ms): Run in container: # Copy /Users/leighmcculloch/.ssh/known_hosts to /root/.ssh/known_hosts
[1994 ms] Start: Run in container: git clone --depth 1 --branch main https://github.com/stellar/experimental-payment-channels.git .
Cloning into '.'...
remote: Enumerating objects: 85, done.
remote: Counting objects: 100% (85/85), done.
remote: Compressing objects: 100% (74/74), done.
remote: Total 85 (delta 13), reused 38 (delta 7), pack-reused 0
Receiving objects: 100% (85/85), 113.05 KiB | 1.61 MiB/s, done.
Resolving deltas: 100% (13/13), done.
[3267 ms] Stop (1273 ms): Run in container: git clone --depth 1 --branch main https://github.com/stellar/experimental-payment-channels.git .
[3666 ms] Start: Run in container: cat /workspaces/experimental-payment-channels/.devcontainer/devcontainer.json 2>/dev/null
[3670 ms] Stop (4 ms): Run in container: cat /workspaces/experimental-payment-channels/.devcontainer/devcontainer.json 2>/dev/null
[3671 ms] Start: Run in container: cat /workspaces/experimental-payment-channels/.devcontainer.json 2>/dev/null
[3674 ms] Stop (3 ms): Run in container: cat /workspaces/experimental-payment-channels/.devcontainer.json 2>/dev/null
[3675 ms] Repository stellar/experimental-payment-channels has no development container files.

[3267 ms] Start: Run in container: git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
[4184 ms] Stop (917 ms): Run in container: git config remote.origin.fetch +refs/heads/*:refs/remotes/origin/*
[4184 ms] Start: Run in container: git fetch --unshallow --tags
remote: Enumerating objects: 1502, done.
remote: Counting objects: 100% (1502/1502), done.
remote: Compressing objects: 100% (890/890), done.
remote: Total 1445 (delta 1002), reused 894 (delta 533), pack-reused 0
Receiving objects: 100% (1445/1445), 342.39 KiB | 3.85 MiB/s, done.
Resolving deltas: 100% (1002/1002), completed with 43 local objects.
From https://github.com/stellar/experimental-payment-channels
 * [new branch]      acharb-refactor-validate -> origin/acharb-refactor-validate
 * [new branch]      apidesign                -> origin/apidesign
 * [new branch]      betterexampleui          -> origin/betterexampleui
 * [new branch]      fixreconnect             -> origin/fixreconnect
 * [new branch]      issue199-1               -> origin/issue199-1
 * [new branch]      issue199-2               -> origin/issue199-2
[5960 ms] Stop (1776 ms): Run in container: git fetch --unshallow --tags
[8738 ms] Start: Run in container: cat /workspaces/experimental-payment-channels/.devcontainer/devcontainer.json 2>/dev/null
[8742 ms] Stop (4 ms): Run in container: cat /workspaces/experimental-payment-channels/.devcontainer/devcontainer.json 2>/dev/null
[8743 ms] Start: Run in container: test -f /workspaces/experimental-payment-channels/.devcontainer/Dockerfile
[8745 ms] 
[8745 ms] 
[8745 ms] Stop (2 ms): Run in container: test -f /workspaces/experimental-payment-channels/.devcontainer/Dockerfile
[8745 ms] Start: Run: podman exec -t 1e45d39413856dd80d24d5a1f0e523bc8f79a9591bb60315c2d628cfc724ae7b docker build -f /workspaces/experimental-payment-channels/.devcontainer/Dockerfile -t vsc-experimental-payment-channels-65cdbf4f1d846b6966a54a0f866e5f4e --build-arg VARIANT=1.17 --build-arg NODE_VERSION=none /workspaces/experimental-payment-channels/.devcontainer
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%22NODE_VERSION%22%3A%22none%22%2C%22VARIANT%22%3A%221.17%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=vsc-experimental-payment-channels-65cdbf4f1d846b6966a54a0f866e5f4e&target=&ulimits=null&version=1": dial unix /var/run/docker.sock: connect: permission denied
[9294 ms] Stop (549 ms): Run: podman exec -t 1e45d39413856dd80d24d5a1f0e523bc8f79a9591bb60315c2d628cfc724ae7b docker build -f /workspaces/experimental-payment-channels/.devcontainer/Dockerfile -t vsc-experimental-payment-channels-65cdbf4f1d846b6966a54a0f866e5f4e --build-arg VARIANT=1.17 --build-arg NODE_VERSION=none /workspaces/experimental-payment-channels/.devcontainer
[9295 ms] Start: Run: podman rm -f 1e45d39413856dd80d24d5a1f0e523bc8f79a9591bb60315c2d628cfc724ae7b
[9302 ms] Command failed: podman exec -t 1e45d39413856dd80d24d5a1f0e523bc8f79a9591bb60315c2d628cfc724ae7b docker build -f /workspaces/experimental-payment-channels/.devcontainer/Dockerfile -t vsc-experimental-payment-channels-65cdbf4f1d846b6966a54a0f866e5f4e --build-arg VARIANT=1.17 --build-arg NODE_VERSION=none /workspaces/experimental-payment-channels/.devcontainer
[19571 ms] Stop (10276 ms): Run: podman rm -f 1e45d39413856dd80d24d5a1f0e523bc8f79a9591bb60315c2d628cfc724ae7b
[19600 ms] Stop (18052 ms): Run in container: /bin/sh
[19614 ms] Remote-Containers server: Error: no exec session with ID a4dac955c79d12e51d6d11c2e681d0d2c085e08d1fdbe5e0986c7f97f6a35161 found: no such exec session
[19644 ms] Stop (17945 ms): Run in container: node /tmp/vscode-remote-containers-server-5b739faa1f21534698afff85599745d2368341b5.js
[19645 ms] Remote-Containers server terminated (code: 125, signal: null).

Steps to Reproduce:

  1. Install podman with brew install podman
  2. Setup a podman vm with podman machine init
  3. Start the podman vm with podman machine start
  4. Open VSCode
  5. Set podman as the executable to use for containers with "remote.containers.dockerPath": "podman"
  6. Clone Repository in Container Volume
  7. Enter stellar/experimental-payment-channels as the repo
  8. Choose Go as the predefined configuration
  9. Choose 1.17 or 1 as the version
  10. Choose none as the Node version

Does this issue occur when you try this locally?: No, this is related to containers only.
Does this issue occur when you try this locally and all extensions are disabled?: Yes

In the logs these lines seem to indicate that VSCode is trying to do something with podman that podman does not support:

[8745 ms] Start: Run: podman exec -t 1e45d39413856dd80d24d5a1f0e523bc8f79a9591bb60315c2d628cfc724ae7b docker build -f /workspaces/experimental-payment-channels/.devcontainer/Dockerfile -t vsc-experimental-payment-channels-65cdbf4f1d846b6966a54a0f866e5f4e --build-arg VARIANT=1.17 --build-arg NODE_VERSION=none /workspaces/experimental-payment-channels/.devcontainer
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%22NODE_VERSION%22%3A%22none%22%2C%22VARIANT%22%3A%221.17%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=vsc-experimental-payment-channels-65cdbf4f1d846b6966a54a0f866e5f4e&target=&ulimits=null&version=1": dial unix /var/run/docker.sock: connect: permission denied

Notably this part:

dial unix /var/run/docker.sock: connect: permission denied
@github-actions github-actions bot added the containers Issue in vscode-remote containers label Sep 5, 2021
@chrmarti
Copy link
Contributor

chrmarti commented Sep 6, 2021

Tracked as #2881.

@chrmarti chrmarti closed this as completed Sep 6, 2021
@chrmarti chrmarti added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 6, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Oct 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers *duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants