Vscode-remote-release: Attached container config: Protect against syntax errors in config

Created on 3 Apr 2020  路  3Comments  路  Source: microsoft/vscode-remote-release

Hello,
Since I updated Docker Desktop to 2.2.0.5(43884), "Dev Containers" terminal reports the following error when I try to open a folder in a running container:

[0 ms] Start: Resolving remote
[1 ms] Setting up container azfunc-node

[19 ms] Error: Can not add index to parent of type property
        at m (c:\Users\yvand\.vscode\extensions\ms-vscode-remote.remote-containers-0.106.0\dist\extension.js:1:52999)
        at Module.R (c:\Users\yvand\.vscode\extensions\ms-vscode-remote.remote-containers-0.106.0\dist\extension.js:1:57710)
        at c:\Users\yvand\.vscode\extensions\ms-vscode-remote.remote-containers-0.106.0\dist\extension.js:1:1049226

The exact steps are the following:

  • I attach to a running container
  • It opens succesfsully a folder by default (always the same) (it contains a NodeJS project)
  • I click "Open a folder" and choose any different folder (I tested with a new empty one)
  • It fails with the error above

I use image mcr.microsoft.com/vscode/devcontainers/typescript-node:12.
I tried to create a new container from this image but the error is the same

Docker Desktop 2.2.0.5(43884)
ms-vscode-remote.remote-wsl Version: 0.42.4

VSCode:
Version: 1.43.2 (user setup)
Commit: 0ba0ca52957102ca3527cf479571617f0de6ed50
Date: 2020-03-24T07:38:38.248Z
Electron: 7.1.11
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363

bug containers

Most helpful comment

Thank you for your hint, it was the cause of the issue.
Configuration was not valid:

{
    "workspaceFolder": "/data/dockerdev/azure-sdk-for-js",
    "extensions": [
        "dbaeumer.vscode-eslint",
        "ms-azuretools.vscode-azurefunctions",
        "ms-vscode.azure-account"
    ]"ms-vscode.azure-account"
    ]
}

I fixed the the syntax issue and it resolved the problem:

{
    "workspaceFolder": "/data/dockerdev/func-githubRepoStats",
    "extensions": [
        "dbaeumer.vscode-eslint",
        "ms-azuretools.vscode-azurefunctions",
        "ms-vscode.azure-account"
    ]
}

All 3 comments

Could you attach the config you get when you run F1 > Remote-Containers: Open Container Configuration File while attached?

Thank you for your hint, it was the cause of the issue.
Configuration was not valid:

{
    "workspaceFolder": "/data/dockerdev/azure-sdk-for-js",
    "extensions": [
        "dbaeumer.vscode-eslint",
        "ms-azuretools.vscode-azurefunctions",
        "ms-vscode.azure-account"
    ]"ms-vscode.azure-account"
    ]
}

I fixed the the syntax issue and it resolved the problem:

{
    "workspaceFolder": "/data/dockerdev/func-githubRepoStats",
    "extensions": [
        "dbaeumer.vscode-eslint",
        "ms-azuretools.vscode-azurefunctions",
        "ms-vscode.azure-account"
    ]
}

Had the same issue today, it occurred when I tried to run code /workspace/dir-2 inside vscode terminal with /workspace/dir-1 being currently open in container. When I ran Remote-Containers: Open Container Configuration File configuration file looked like this:

{
    "workspaceFolder": "/workspace/dir-1",
    "extensions": [
        "42Crunch.vscode-openapi",
        "dbaeumer.vscode-eslint",
        "donjayamanne.githistory",
        "redhat.vscode-yaml"
    ]y",
        "redhat.vscode-yaml"
    ]
}
Version: 1.46.1
Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
Date: 2020-06-17T21:17:14.222Z (6 days ago)
Electron: 7.3.1
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.5.0
Was this page helpful?
0 / 5 - 0 ratings