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

Unable to put slashes in devcontainer.json on Windows #154

Closed
rzhao271 opened this issue Sep 1, 2022 · 5 comments
Closed

Unable to put slashes in devcontainer.json on Windows #154

rzhao271 opened this issue Sep 1, 2022 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@rzhao271
Copy link
Contributor

rzhao271 commented Sep 1, 2022

Testing #116

On Windows 10 in devcontainer.json:
feature-ident

with the following log:

[2022-09-01T20:45:56.302Z] Stop (5 ms): Run in container: test ! -f '/root/.vscode-server-insiders/data/Machine/.writeMachineSettingsMarker' && set -o noclobber && mkdir -p '/root/.vscode-server-insiders/data/Machine' && { > '/root/.vscode-server-insiders/data/Machine/.writeMachineSettingsMarker' ; } 2> /dev/null
[2022-09-01T20:45:56.303Z] Start: Run: C:\Users\raymondzhao\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js read-configuration --workspace-folder c:\Users\raymondzhao\work\endgame\small-docker-sample --log-level debug --log-format json --config c:\Users\raymondzhao\work\endgame\small-docker-sample\.devcontainer\devcontainer.json --include-features-configuration --mount-workspace-git-root true
[2022-09-01T20:45:56.716Z] remote-containers 0.244.0.
[2022-09-01T20:45:56.716Z] Start: Run: git rev-parse --show-cdup
[2022-09-01T20:45:56.856Z] Stop (140 ms): Run: git rev-parse --show-cdup
[2022-09-01T20:45:56.868Z] * Processing feature: ./.devcontainer/foo
[2022-09-01T20:45:56.868Z] Local disk feature.
[2022-09-01T20:45:56.869Z] * Fetching feature: foo_1_file-path
[2022-09-01T20:45:56.871Z] (!) ERR: Failed to fetch feature:  
[2022-09-01T20:45:56.871Z] Error: ENOENT: no such file or directory, lstat 'c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\.devcontainer\foo'
[2022-09-01T20:45:56.885Z] Stop (582 ms): Run: C:\Users\raymondzhao\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js read-configuration --workspace-folder c:\Users\raymondzhao\work\endgame\small-docker-sample --log-level debug --log-format json --config c:\Users\raymondzhao\work\endgame\small-docker-sample\.devcontainer\devcontainer.json --include-features-configuration --mount-workspace-git-root true
[2022-09-01T20:45:56.886Z] Exit code 1
[2022-09-01T20:45:56.894Z] Command failed: C:\Users\raymondzhao\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js read-configuration --workspace-folder c:\Users\raymondzhao\work\endgame\small-docker-sample --log-level debug --log-format json --config c:\Users\raymondzhao\work\endgame\small-docker-sample\.devcontainer\devcontainer.json --include-features-configuration --mount-workspace-git-root true
[2022-09-01T20:45:56.894Z] Exit code 1

The parsing errors stopped when I converted the forward slashes to backward slashes, but then this happened:

[2022-09-01T20:39:31.353Z] * Processing feature: .\.devcontainer\foo
[2022-09-01T20:39:31.431Z] error: Error: getaddrinfo ENOTFOUND .
[2022-09-01T20:39:31.431Z] OCI manifest not found
[2022-09-01T20:39:31.431Z] (!) WARNING: Falling back to deprecated GitHub Release syntax. See https://github.com/devcontainers/spec/blob/main/proposals/devcontainer-features.md#referencing-a-feature for updated specification.
[2022-09-01T20:39:31.431Z] Github feature.
[2022-09-01T20:39:31.431Z] Invalid parse for GitHub Release feature: Follow format '<publisher>/<feature-set>/<feature>, or republish feature to OCI registry.'
[2022-09-01T20:39:31.432Z] Error: Failed to process feature .\.devcontainer\foo
[2022-09-01T20:39:31.433Z]     at nS (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:186:2882)
[2022-09-01T20:39:31.433Z]     at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
[2022-09-01T20:39:31.433Z]     at async Qs (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:186:2277)
[2022-09-01T20:39:31.433Z]     at async to (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:186:11995)
[2022-09-01T20:39:31.433Z]     at async na (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:186:10960)
[2022-09-01T20:39:31.433Z]     at async mu (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:254:2847)
[2022-09-01T20:39:31.433Z]     at async Yw (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:254:1779)
[2022-09-01T20:39:31.433Z]     at async $S (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:260:2006)
[2022-09-01T20:39:31.434Z]     at async io (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:260:3110)
[2022-09-01T20:39:31.434Z]     at async wP (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.244.0\dist\spec-node\devContainersSpecCLI.js:353:8748)
@rzhao271
Copy link
Contributor Author

rzhao271 commented Sep 1, 2022

And in 0.252.0:

[2022-09-01T20:53:05.668Z] * Processing feature: ./foo
[2022-09-01T20:53:05.668Z] Local disk feature.
[2022-09-01T20:53:05.668Z] Local file path parse error. Resolved path must be a child of the .devcontainer/ folder.  Parsed: \c:\Users\raymondzhao\work\endgame\small-docker-sample\.devcontainer\foo
[2022-09-01T20:53:05.670Z] Error: Failed to process feature ./foo
[2022-09-01T20:53:05.670Z]     at QR (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:188:2956)
[2022-09-01T20:53:05.671Z]     at async uc (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:188:2279)
[2022-09-01T20:53:05.671Z]     at async Zs (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:188:12771)
[2022-09-01T20:53:05.671Z]     at async hc (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:188:11708)
[2022-09-01T20:53:05.671Z]     at async Wf (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:257:2847)
[2022-09-01T20:53:05.671Z]     at async pb (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:257:1779)
[2022-09-01T20:53:05.672Z]     at async DF (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:263:2006)
[2022-09-01T20:53:05.672Z]     at async to (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:263:3110)
[2022-09-01T20:53:05.672Z]     at async Ak (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:383:8108)
[2022-09-01T20:53:05.672Z]     at async Ok (c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js:383:7864)
[2022-09-01T20:53:05.697Z] Stop (3745 ms): Run: C:\Users\raymondzhao\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe --ms-enable-electron-run-as-node c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\raymondzhao\AppData\Roaming\Code - Insiders\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder c:\Users\raymondzhao\work\endgame\small-docker-sample --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\Users\raymondzhao\work\endgame\small-docker-sample --log-level debug --log-format json --config c:\Users\raymondzhao\work\endgame\small-docker-sample\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-09-01T20:53:05.698Z] Exit code 1
[2022-09-01T20:53:05.707Z] Command failed: C:\Users\raymondzhao\AppData\Local\Programs\Microsoft VS Code Insiders\Code - Insiders.exe --ms-enable-electron-run-as-node c:\Users\raymondzhao\.vscode-insiders\extensions\ms-vscode-remote.remote-containers-0.252.0\dist\spec-node\devContainersSpecCLI.js up --user-data-folder c:\Users\raymondzhao\AppData\Roaming\Code - Insiders\User\globalStorage\ms-vscode-remote.remote-containers\data --workspace-folder c:\Users\raymondzhao\work\endgame\small-docker-sample --workspace-mount-consistency cached --id-label devcontainer.local_folder=c:\Users\raymondzhao\work\endgame\small-docker-sample --log-level debug --log-format json --config c:\Users\raymondzhao\work\endgame\small-docker-sample\.devcontainer\devcontainer.json --default-user-env-probe loginInteractiveShell --remove-existing-container --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true
[2022-09-01T20:53:05.707Z] Exit code 1

@samruddhikhandale
Copy link
Member

Local file path parse error. Resolved path must be a child of the .devcontainer/ folder. Parsed: \c:\Users\raymondzhao\work\endgame\small-docker-sample.devcontainer\foo
[2022-09-01T20:53:05.670Z] Error: Failed to process feature ./foo

According the the spec, you should reference the local feature as following -

{
        // ...
        "features": {
                "./foo": {},
        }

}

@rzhao271 Can you try testing with this reference ☝️ and see if its works?

@rzhao271
Copy link
Contributor Author

rzhao271 commented Sep 1, 2022

Same error

[2022-09-01T21:18:15.425Z] * Processing feature: ./foo
[2022-09-01T21:18:15.425Z] Local disk feature.
[2022-09-01T21:18:15.425Z] Local file path parse error. Resolved path must be a child of the .devcontainer/ folder.  Parsed: \c:\Users\raymondzhao\work\endgame\small-docker-sample\.devcontainer\foo
[2022-09-01T21:18:15.426Z] Error: Failed to process feature ./foo

@chrmarti chrmarti added the bug Something isn't working label Sep 6, 2022
@joshspicer
Copy link
Member

joshspicer commented Sep 6, 2022

Thanks for the report. It also reminds we of #177, which I think should tackle alongside this

@rzhao271
Copy link
Contributor Author

rzhao271 commented Dec 7, 2022

Seems to be fixed now

@rzhao271 rzhao271 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants