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

Can't build devcontainer for this repo. throws "invalid memory address or nil pointer dereference" #562

Closed
krikchaip opened this issue May 29, 2023 · 1 comment

Comments

@krikchaip
Copy link
Contributor

Hi, I was working with #557 last week using devcontainer. it was working fine though but when I rebuild the container today it showed me this error log.

image
[21189 ms] Start: Run: docker inspect --type image mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18
[21243 ms] local container features stored at: /Users/krikchai/.vscode/extensions/ms-vscode-remote.remote-containers-0.292.0/dist/node_modules/vscode-dev-containers/container-features
[21244 ms] Start: Run: tar --no-same-owner -x -f -
[21254 ms] * Processing feature: ghcr.io/devcontainers/features/docker-in-docker:2
[21698 ms] Start: Run: docker-credential-desktop get
[21890 ms] [httpOci] Failed to execute credential helper desktop
[22724 ms] * Fetching feature: docker-in-docker_1_oci
[23663 ms] Start: Run: docker buildx build --load --build-context dev_containers_feature_content_source=/var/folders/pb/wlgvc7w542z665vqvtdh3rmw0000gn/T/devcontainercli/container-features/0.40.0-1685346595918 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-features-3e5d80f1ef9d9b78adb7e6974739be670899db617c8d5af14dacfdf3ca097162-features -f /var/folders/pb/wlgvc7w542z665vqvtdh3rmw0000gn/T/devcontainercli/container-features/0.40.0-1685346595918/Dockerfile.extended /Users/krikchai/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x39 pc=0x103b05a00]

goroutine 1 [running]:
github.com/docker/buildx/builder.(*Builder).Validate(0x104d1e8a0?)
        github.com/docker/buildx/builder/builder.go:111 +0x20
github.com/docker/buildx/builder.New({0x104d1e8a0?, 0x14000512100}, {0x1400069f450, 0x2, 0x100010000?})
        github.com/docker/buildx/builder/builder.go:101 +0x290
github.com/docker/buildx/commands.runBuild({_, _}, {{0x16ceab051, 0x78}, {0x16ceaafd4, 0x7c}, {0x0, 0x0}, {0x105c93588, 0x0, ...}, ...})
        github.com/docker/buildx/commands/build.go:259 +0xedc
github.com/docker/buildx/commands.buildCmd.func1(0x140004ba600?, {0x14000513c00?, 0x10?, 0x10?})
        github.com/docker/buildx/commands/build.go:461 +0xd0
github.com/spf13/cobra.(*Command).execute(0x140004ba600, {0x140003b0920, 0x10, 0x10})
        github.com/spf13/cobra@v1.6.1/command.go:916 +0x5c8
github.com/spf13/cobra.(*Command).ExecuteC(0x140000d4000)
        github.com/spf13/cobra@v1.6.1/command.go:1044 +0x35c
github.com/spf13/cobra.(*Command).Execute(...)
        github.com/spf13/cobra@v1.6.1/command.go:968
github.com/docker/cli/cli-plugins/plugin.RunPlugin(0x10445bd29?, 0x140004ba300, {{0x104459f76, 0x5}, {0x10446403c, 0xb}, {0x1047a1e68, 0x7}, {0x0, 0x0}, ...})
        github.com/docker/cli@v23.0.0-rc.1+incompatible/cli-plugins/plugin/plugin.go:51 +0x154
main.runPlugin(0x10449d883?)
        github.com/docker/buildx/cmd/buildx/main.go:45 +0xcc
main.main()
        github.com/docker/buildx/cmd/buildx/main.go:62 +0xe0
[23855 ms] Error: Command failed: docker buildx build --load --build-context dev_containers_feature_content_source=/var/folders/pb/wlgvc7w542z665vqvtdh3rmw0000gn/T/devcontainercli/container-features/0.40.0-1685346595918 --build-arg _DEV_CONTAINERS_BASE_IMAGE=mcr.microsoft.com/vscode/devcontainers/javascript-node:0-18 --build-arg _DEV_CONTAINERS_IMAGE_USER=root --build-arg _DEV_CONTAINERS_FEATURE_CONTENT_SOURCE=dev_container_feature_content_temp --target dev_containers_target_stage -t vsc-features-3e5d80f1ef9d9b78adb7e6974739be670899db617c8d5af14dacfdf3ca097162-features -f /var/folders/pb/wlgvc7w542z665vqvtdh3rmw0000gn/T/devcontainercli/container-features/0.40.0-1685346595918/Dockerfile.extended /Users/krikchai/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data/empty-folder
[23855 ms]     at Tse (/Users/krikchai/.vscode/extensions/ms-vscode-remote.remote-containers-0.292.0/dist/spec-node/devContainersSpecCLI.js:1946:3264)
[23855 ms]     at rO (/Users/krikchai/.vscode/extensions/ms-vscode-remote.remote-containers-0.292.0/dist/spec-node/devContainersSpecCLI.js:1946:3200)
[23855 ms]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[23856 ms]     at async Xse (/Users/krikchai/.vscode/extensions/ms-vscode-remote.remote-containers-0.292.0/dist/spec-node/devContainersSpecCLI.js:1961:2626)
[23856 ms]     at async vh (/Users/krikchai/.vscode/extensions/ms-vscode-remote.remote-containers-0.292.0/dist/spec-node/devContainersSpecCLI.js:1961:3741)
[23856 ms]     at async gae (/Users/krikchai/.vscode/extensions/ms-vscode-remote.remote-containers-0.292.0/dist/spec-node/devContainersSpecCLI.js:2092:10213)
[23856 ms]     at async mae (/Users/krikchai/.vscode/extensions/ms-vscode-remote.remote-containers-0.292.0/dist/spec-node/devContainersSpecCLI.js:2092:9954)
[23858 ms] Exit code 1
[23859 ms] Command failed: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Users/krikchai/.vscode/extensions/ms-vscode-remote.remote-containers-0.292.0/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/krikchai/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --container-session-data-folder /tmp/devcontainers-68a694bf-edb1-4938-8064-29dc4d1fd9e31685346574069 --workspace-folder /Users/krikchai/Desktop/features --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/krikchai/Desktop/features --id-label devcontainer.config_file=/Users/krikchai/Desktop/features/.devcontainer.json --log-level debug --log-format json --config /Users/krikchai/Desktop/features/.devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[23859 ms] Exit code 1

Seems like the problem comes from docker-in-docker feature.

What I tried

  • restarted my mac
  • re-cloned the repo
  • restarted docker-desktop and reset to factory default

Environment

  • Macbook Pro M1
  • MacOS 13.4
  • docker-desktop 4.19.0
  • docker buildx v0.10.4
@krikchaip
Copy link
Contributor Author

just found the solution already. Basically you need to chown ~/.docker/buildx/activity/desktop-linux and restart docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant