错误:VS Code 更新后 Codespace 在恢复模式下运行 - “重建容器”没有帮助

问题描述 投票:0回答:1

问题描述:

我一直在尝试用 VS Code 编写,但最近更新后每次打开它,都会弹出以下错误消息:

由于配置错误,此代码空间当前正在恢复模式下运行。请查看创建日志,根据需要更新您的开发容器配置,然后运行“重建容器”命令进行纠正。

此后,我无法保存文件或使用 update50/check50/submit50。

非常感谢任何帮助解决此问题的帮助。

详情:

我尝试了“Codespaces:重建容器”解决方案,同时使用“Rebuild”和“Full Rebuild”选项,但没有任何效果。

这就是我的creation.log的样子:

这就是我的 creation.log 的样子:

2024-12-01 21:12:18.084Z: Host information
2024-12-01 21:12:18.088Z: ----------------
2024-12-01 21:12:18.088Z: OS: Ubuntu 22.04.5 LTS (stable release)
2024-12-01 21:12:18.089Z: Image details: https://github.com/github/codespaces-host-images/blob/main/README.md
2024-12-01 21:12:18.090Z: ----------------

=================================================================================
2024-12-01 21:12:18.102Z: Configuration starting...
2024-12-01 21:12:18.171Z: Cloning...

===================================== WARNING ===================================
2024-12-01 21:12:18.224Z: Some properties of devcontainer.json could not be validated.
=================================================================================

=================================================================================
2024-12-01 21:12:18.224Z: Creating container...
2024-12-01 21:12:18.328Z: $ devcontainer up --id-label Type=codespaces --workspace-folder /var/lib/docker/codespacemount/workspace/63768055 --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --user-data-folder /var/lib/docker/codespacemount/.persistedshare --container-data-folder .vscode-remote/data/Machine --container-system-data-folder /var/vscode-remote --log-level trace --log-format json --update-remote-user-uid-default never --mount-workspace-git-root false --omit-config-remote-env-from-metadata --skip-non-blocking-commands --skip-post-create --expect-existing-container --config "/var/lib/docker/codespacemount/workspace/63768055/.devcontainer/devcontainer.json" --override-config /root/.codespaces/shared/merged_devcontainer.json --default-user-env-probe loginInteractiveShell --container-session-data-folder /workspaces/.codespaces/.persistedshare/devcontainers-cli/cache --secrets-file /root/.codespaces/shared/user-secrets-envs.json
2024-12-01 21:12:18.629Z: @devcontainers/cli 0.68.0. Node.js v18.20.5. linux 6.5.0-1025-azure x64.
2024-12-01 21:12:18.816Z: $ docker start b1b1ca85942a07c65dc14632acba83174db2dcf5e94490f0891815e796151032
2024-12-01 21:12:19.079Z: b1b1ca85942a07c65dc14632acba83174db2dcf5e94490f0891815e796151032

2024-12-01 21:12:19.082Z: Stop: Run: docker start b1b1ca85942a07c65dc14632acba83174db2dcf5e94490f0891815e796151032
2024-12-01 21:12:19.286Z: Outcome: success User: vscode WorkspaceFolder: /workspaces/63768055
2024-12-01 21:12:19.293Z: devcontainer process exited with exit code 0

=================================================================================
2024-12-01 21:12:20.263Z: Running blocking commands...
2024-12-01 21:12:20.302Z: $ devcontainer up --id-label Type=codespaces --workspace-folder /var/lib/docker/codespacemount/workspace/63768055 --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --user-data-folder /var/lib/docker/codespacemount/.persistedshare --container-data-folder .vscode-remote/data/Machine --container-system-data-folder /var/vscode-remote --log-level trace --log-format json --update-remote-user-uid-default never --mount-workspace-git-root false --omit-config-remote-env-from-metadata --skip-non-blocking-commands --expect-existing-container --config "/var/lib/docker/codespacemount/workspace/63768055/.devcontainer/devcontainer.json" --override-config /root/.codespaces/shared/merged_devcontainer.json --default-user-env-probe loginInteractiveShell --container-session-data-folder /workspaces/.codespaces/.persistedshare/devcontainers-cli/cache --secrets-file /root/.codespaces/shared/user-secrets-envs.json
2024-12-01 21:12:20.511Z: @devcontainers/cli 0.68.0. Node.js v18.20.5. linux 6.5.0-1025-azure x64.
2024-12-01 21:12:20.759Z: Outcome: success User: vscode WorkspaceFolder: /workspaces/63768055
2024-12-01 21:12:20.769Z: devcontainer process exited with exit code 0

=================================================================================
2024-12-01 21:12:20.823Z: Configuring codespace...

=================================================================================
2024-12-01 21:12:20.824Z: Running commands...
2024-12-01 21:12:20.824Z: $ devcontainer up --id-label Type=codespaces --workspace-folder /var/lib/docker/codespacemount/workspace/63768055 --expect-existing-container --skip-post-attach --mount type=bind,source=/.codespaces/agent/mount/cache,target=/vscode --container-data-folder .vscode-remote/data/Machine --container-system-data-folder /var/vscode-remote --log-level trace --log-format json --update-remote-user-uid-default never --mount-workspace-git-root false --config "/var/lib/docker/codespacemount/workspace/63768055/.devcontainer/devcontainer.json" --override-config /root/.codespaces/shared/merged_devcontainer.json --default-user-env-probe loginInteractiveShell --container-session-data-folder /workspaces/.codespaces/.persistedshare/devcontainers-cli/cache --secrets-file /root/.codespaces/shared/user-secrets-envs.json
2024-12-01 21:12:21.188Z: @devcontainers/cli 0.68.0. Node.js v18.20.5. linux 6.5.0-1025-azure x64.
2024-12-01 21:12:21.733Z: Outcome: success User: vscode WorkspaceFolder: /workspaces/63768055
2024-12-01 21:12:21.743Z: devcontainer process exited with exit code 0

=================================================================================
2024-12-01 21:12:22.213Z: Finished configuring codespace.

这就是我的 devcontainer.json 的样子:

{
  "$schema": "https://raw.githubusercontent.com/microsoft/vscode-dev-containers/main/schema/devContainer.schema.json",
  "customizations": {
    "vscode": {
      "extensions": [
        "/opt/cs50/extensions/explain50-1.0.0.vsix",
        "/opt/cs50/extensions/cs50-0.0.1.vsix",
        "/opt/cs50/extensions/design50-1.0.0.vsix",
        "/opt/cs50/extensions/ddb50-2.0.0.vsix",
        "/opt/cs50/extensions/phpliteadmin-0.0.1.vsix",
        "/opt/cs50/extensions/style50-0.0.1.vsix",
        "cs50.extension-uninstaller",
        "inferrinizzard.prettier-sql-vscode",
        "mathematic.vscode-pdf",
        "ms-azuretools.vscode-docker",
        "ms-ceintl.vscode-language-pack-bg",
        "ms-ceintl.vscode-language-pack-cs",
        "ms-ceintl.vscode-language-pack-de",
        "ms-ceintl.vscode-language-pack-es",
        "ms-ceintl.vscode-language-pack-fr",
        "ms-ceintl.vscode-language-pack-hu",
        "ms-ceintl.vscode-language-pack-it",
        "ms-ceintl.vscode-language-pack-ja",
        "ms-ceintl.vscode-language-pack-ko",
        "ms-ceintl.vscode-language-pack-pl",
        "ms-ceintl.vscode-language-pack-pt-br",
        "ms-ceintl.vscode-language-pack-ru",
        "ms-ceintl.vscode-language-pack-zh-hans",
        "ms-ceintl.vscode-language-pack-zh-hant",
        "ms-python.autopep8",
        "ms-python.python",
        "ms-vscode.cpptools",
        "ms-vscode.hexeditor",
        "ms-vsliveshare.vsliveshare",
        "redhat.java",
        "vscjava.vscode-java-debug",
        "vsls-contrib.gitdoc"
      ],
      "settings": {
        "[python]": {
          "editor.defaultFormatter": "ms-python.autopep8"
        },
        "accessibility.signals.terminalBell": {
          "sound": "on"
        },
        "breadcrumbs.enabled": false,
        "C_Cpp.autocomplete": "disabled",
        "C_Cpp.clang_format_fallbackStyle": "{ AllowShortFunctionsOnASingleLine: Empty, BraceWrapping: { AfterCaseLabel: true, AfterControlStatement: true, AfterFunction: true, AfterStruct: true, BeforeElse: true, BeforeWhile: true }, BreakBeforeBraces: Custom, ColumnLimit: 100, IndentCaseLabels: true, IndentWidth: 4, SpaceAfterCStyleCast: true, TabWidth: 4 }",
        "C_Cpp.codeFolding": "disabled",
        "C_Cpp.debugShortcut": false,
        "C_Cpp.dimInactiveRegions": false,
        "C_Cpp.doxygen.generateOnType": false,
        "C_Cpp.enhancedColorization": "enabled",
        "C_Cpp.errorSquiggles": "disabled",
        "C_Cpp.formatting": "clangFormat",
        "cs50.watchPorts": [
          5000,
          8080,
          8082,
          8787
        ],
        "diffEditor.diffAlgorithm": "advanced",
        "diffEditor.ignoreTrimWhitespace": false,
        "editor.autoClosingQuotes": "never",
        "editor.colorDecorators": false,
        "editor.emptySelectionClipboard": false,
        "editor.folding": false,
        "editor.foldingHighlight": false,
        "editor.formatOnSave": false,
        "editor.guides.indentation": false,
        "editor.hover.enabled": false,
        "editor.lightbulb.enabled": "off",
        "editor.matchBrackets": "never",
        "editor.minimap.enabled": false,
        "editor.mouseWheelZoom": true,
        "editor.occurrencesHighlight": "off",
        "editor.parameterHints.enabled": false,
        "editor.quickSuggestions": {
          "comments": "off",
          "other": "off",
          "strings": "off"
        },
        "editor.renderWhitespace": "selection",
        "editor.selectionHighlight": false,
        "editor.semanticTokenColorCustomizations": {
          "[GitHub Dark Default]": {
            "rules": {
              "type": "#FF7E76"
            }
          },
          "[GitHub Light Default]": {
            "rules": {
              "type": "#D2343F"
            }
          }
        },
        "editor.stickyScroll.enabled": false,
        "editor.suggestOnTriggerCharacters": false,
        "explorer.autoOpenDroppedFile": false,
        "explorer.compactFolders": false,
        "extension-uninstaller.uninstall": [
          "Codeium.codeium",
          "Codeium.codeium-enterprise-updater",
          "github.copilot",
          "github.copilot-nightly",
          "ms-toolsai.vscode-jupyter-cell-tags",
          "tabnine.tabnine-vscode"
        ],
        "extensions.ignoreRecommendations": true,
        "files.autoSave": "afterDelay",
        "files.autoSaveDelay": 1000,
        "files.exclude": {
          "**/.*": true
        },
        "files.insertFinalNewline": true,
        "files.trimTrailingWhitespace": true,
        "files.watcherExclude": {
          "**/.git/objects/**": true,
          "**/.git/subtree-cache/**": true,
          "**/node_modules/*/**": true
        },
        "git.autofetch": true,
        "git.decorations.enabled": false,
        "git.terminalAuthentication": true
      }
    }
  },
  "forwardPorts": [
    5000,
    5900,
    6081,
    8080,
    8082,
    8787
  ],
  "image": "ghcr.io/cs50/codespace:c5be161759c41c4609941ea6cfdeddeda44ae0ac",
  "mounts": [
    {
      "source": "/var/run/docker.sock",
      "target": "/var/run/docker-host.sock",
      "type": "bind"
    }
  ],
  "postCreateCommand": "/opt/cs50/bin/postCreateCommand",
  "postStartCommand": "/opt/cs50/bin/postStartCommand",
  "remoteEnv": {
    "CS50_GH_USER": "${localEnv:GITHUB_USER}",
    "LANG": "${localEnv:CS50_LANG}",
    "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
    "TZ": "${localEnv:CS50_TZ}"
  }
}

提前谢谢您!

json visual-studio-code cs50 rebuild github-codespaces
1个回答
0
投票

在您发布此内容的同时,我也遇到了同样的问题。从那以后我每天都尝试重建它,今天早上就成功了。我怀疑这是更新的问题,正在等待查看它是否会自行修复。我建议尝试再次进行完全重建

© www.soinside.com 2019 - 2024. All rights reserved.