microsoft / vscode-remote-release

Visual Studio Code Remote Development: Open any folder in WSL, in a Docker container, or on a remote machine using SSH and take advantage of VS Code's full feature set.
https://aka.ms/vscode-remote
Other
3.63k stars 282 forks source link

Containers: Clicking on "Starting Dev Container (show log)" doesn't show logs #7685

Open ItalyPaleAle opened 2 years ago

ItalyPaleAle commented 2 years ago

For the last couple of months, when building a dev container I am not able to see the logs anymore. Clicking on the "Starting Dev Container (show log)" button in the notification does not make the logs show up anymore

Steps to Reproduce:

  1. Reopen a folder in a dev container
  2. Click on the "Starting Dev Container (show log)" notification
    image
  3. Nothing happens

Does this issue occur when you try this locally?: N/A Does this issue occur when you try this locally and all extensions are disabled?: N/A

chrmarti commented 2 years ago

Might be https://github.com/microsoft/vscode/issues/144729. Does it work when you disable shell integration?

ItalyPaleAle commented 2 years ago

"terminal.integrated.shellIntegration.enabled": true is not enabled for me

jasonwilliams commented 2 years ago

Same is happening for me

image

I can confirm that setting "terminal.integrated.shellIntegration.enabled": false fixes it

Version: 1.66.2 Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977 Date: 2022-04-11T07:49:20.994Z Electron: 17.2.0 Chromium: 98.0.4758.109 Node.js: 16.13.0 V8: 9.8.177.11-electron.0 OS: Darwin x64 20.6.0

meganrogge commented 2 years ago

any errors in the dev tools console when this happens? @ItalyPaleAle

github-actions[bot] commented 2 years ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

ItalyPaleAle commented 2 years ago

@meganrogge Sorry for the delay, I was on vacation.

The issue is persisting and this is what I see in the console (after clicking on "Show log"): image

meganrogge commented 2 years ago

@chrmarti I don't think this is terminal related as @ItalyPaleAle has indicated it happens with or without shell integration enabled. I further can't even find where this Starting Dev Container (show log) code is

ItalyPaleAle commented 2 years ago

Yes. To be clear, the logs do appear, but only after the container has been built

ItalyPaleAle commented 2 years ago

Update: I found the same behavior with Codespaces, while clicking on the link to show the logs when building a new Codespace

jasonwilliams commented 2 years ago

Same is happening for me

image

I can confirm that setting "terminal.integrated.shellIntegration.enabled": false fixes it

Version: 1.66.2 Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977 Date: 2022-04-11T07:49:20.994Z Electron: 17.2.0 Chromium: 98.0.4758.109 Node.js: 16.13.0 V8: 9.8.177.11-electron.0 OS: Darwin x64 20.6.0

@meganrogge has this been fixed in the next release? Or do I still need to keep integrated terminal off?

meganrogge commented 2 years ago

@chrmarti I don't think this is a terminal issue. Do you?

chrmarti commented 2 years ago

Nothing changed in Remote-Containers. @ItalyPaleAle Could you append your settings?

ItalyPaleAle commented 2 years ago

Here it is. Note that this issue has been going on for at least 2-3 months:

{
    "[html]": {
      "editor.defaultFormatter": "esbenp.prettier-vscode"
    },
    "cSpell.showStatus": false,
    "cSpell.userWords": [
      "archiver",
      "cascadia",
      "ciphertext",
      "codespaces",
      "devs",
      "else",
      "else's",
      "kubernetes",
      "lifecycle",
      "roadmap",
      "uuid"
    ],
    "debug.allowBreakpointsEverywhere": true,
    "debug.onTaskErrors": "debugAnyway",
    "diffEditor.ignoreTrimWhitespace": false,
    "diffEditor.renderSideBySide": true,
    "editor.accessibilitySupport": "off",
    "editor.fontFamily": "Cascadia Code, Menlo, Monaco, 'Courier New', monospace",
    "editor.fontLigatures": true,
    "editor.fontSize": 13.5,
    "editor.fontWeight": "350",
    "editor.inlineSuggest.enabled": true,
    "editor.minimap.enabled": false,
    "editor.renderWhitespace": "trailing",
    "editor.semanticHighlighting.enabled": false,
    "editor.suggestSelection": "first",
    "editor.wordWrap": "on",
    "explorer.autoReveal": "focusNoScroll",
    "explorer.decorations.colors": false,
    "explorer.experimental.fileNesting.patterns": {
      "*.go": "$(capture).go,$(capture)_*.go",
      "*.js": "$(capture).js.map, $(capture).min.js, $(capture).d.ts",
      "*.jsx": "$(capture).js",
      "*.ts": "$(capture).js, $(capture).d.ts",
      "*.tsx": "$(capture).ts",
      "package.json": "package-lock.json, .npmrc, yarn.lock, .yarnrc",
      "tsconfig.json": "tsconfig.*.json"
    },
    "extensions.ignoreRecommendations": false,
    "files.associations": {
      "*.plist": "xml"
    },
    "git.allowForcePush": true,
    "git.confirmSync": false,
    "git.enableSmartCommit": true,
    "git.fetchOnPull": true,
    "github.copilot.enable": {
      "*": false,
      "markdown": false,
      "plaintext": true,
      "yaml": false
    },
    "githubPullRequests.createOnPublishBranch": "never",
    "gitlens.codeLens.enabled": false,
    "gitlens.currentLine.enabled": false,
    "go.alternateTools": {},
    "go.formatTool": "goimports",
    "go.lintOnSave": "off",
    "go.toolsEnvVars": {
      "CGO_CFLAGS_ALLOW": "-Xpreprocessor"
    },
    "go.toolsGopath": "~/go",
    "go.toolsManagement.autoUpdate": true,
    "go.useLanguageServer": true,
    "gopls": {},
    "html.format.endWithNewline": true,
    "html.format.preserveNewLines": false,
    "html.format.wrapLineLength": 0,
    "javascript.updateImportsOnFileMove.enabled": "never",
    "jupyter.askForKernelRestart": false,
    "keyboard.layout": "com.apple.keylayout.Italian-Pro",
    "nasc-touchbar.blockComment": true,
    "nasc-touchbar.commentLine": true,
    "nasc-touchbar.goToDefinition": false,
    "nasc-touchbar.outdent": true,
    "nasc-touchbar.rename": false,
    "nasc-touchbar.showCommands": false,
    "omnisharp.useModernNet": true,
    "polacode.backgroundColor": "#ffffff",
    "polacode.shadow": "rgba(0, 0, 0, 0.25) 0px 10px 28px",
    "polacode.transparentBackground": true,
    "python.languageServer": "Pylance",
    "redhat.telemetry.enabled": false,
    "remote.restoreForwardedPorts": true,
    "scm.autoReveal": false,
    "scm.inputFontFamily": "editor",
    "scss.lint.idSelector": "warning",
    "scss.lint.ieHack": "warning",
    "svelte.enable-ts-plugin": true,
    "svelte.plugin.svelte.format.enable": false,
    "telemetry.telemetryLevel": "off",
    "terminal.integrated.defaultLocation": "editor",
    "terminal.integrated.defaultProfile.linux": "zsh",
    "terminal.integrated.env.osx": {
      "GIT_EDITOR": "code --wait",
      "SOLARIZED_THEME": "light"
    },
    "terminal.integrated.fontFamily": "'Cascadia Code PL', 'Source Code Pro for Powerline', 'Hack Nerd Font', Cascadia Code, Menlo, Monaco, 'Courier New', monospace",
    "terminal.integrated.localEchoLatencyThreshold": 250,
    "terminal.integrated.tabs.enabled": true,
    "todo-tree.general.tags": [
      "BUG",
      "HACK",
      "FIXME",
      "TODO",
      "XXX",
      "[ ]",
      "[x]"
    ],
    "todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS)",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "window.autoDetectColorScheme": true,
    "workbench.colorTheme": "Default Light+",
    "workbench.editor.decorations.badges": false,
    "workbench.editor.decorations.colors": false,
    "workbench.editorAssociations": {
      "*.ipynb": "jupyter-notebook"
    },
    "workbench.layoutControl.enabled": true,
    "workbench.startupEditor": "newUntitledFile"
  }
chrmarti commented 2 years ago

I can reproduce with "terminal.integrated.defaultLocation": "editor".

omercnet commented 2 years ago

I can reproduce with "terminal.integrated.defaultLocation": "editor".

mine is set to "view" but also experiencing the same issue, happy to share any information you need to resolve this

Tyriar commented 1 year ago

I can also only reproduce with "terminal.integrated.defaultLocation": "editor", it eventually opens but only after the connection is finished. We must be getting blocked by something in workbench start up when trying to open a terminal editor. Easy workaround is to force the TerminalLocation.Panel for the output in the extension. Passing to you @chrmarti

fcharron commented 10 months ago

Is there a workaround that can be used right now? I'm having the same problem with some very long to build dockerfile containers, so it's annoying to have to wait until the end of the build to know what happened.

MoritzTerhechte commented 4 months ago

This issue is still persisting. No fix described here worked for me

Igetin commented 4 months ago

Still happens on VS Code 1.89.1 and Remote Development extension v0.25.0 when terminal.integrated.defaultLocation is set to "editor".

awesomebytes commented 4 months ago

Same issue here. If I add a postAttachCommand VSCode stays with "Configuring Dev Container (show log)" and never finishes and I see no log. Both with "editor" or "view" in terminal.integrated.defaultLocation and also with "terminal.integrated.shellIntegration.enabled" set to true or false.

I'm using VSCode 1.89.1 in Windows with WSL2 for my repository. I tried to update everything to the latest version.

chrmarti commented 4 months ago

Could you use https://github.com/microsoft/vscode-bisect to check what the first VS Code Insiders version is where this breaks for "view" as the location?

awesomebytes commented 4 months ago

My latest findings:

If I try my same setup in Linux, it works no problem.

Then, I tried in windows again, and I tried to make a mimimally reproducible example and... the bug didn't trigger. I came down to find that the following config:

    "runArgs": ["--init",
                "--net", "host", // Makes life easier
                // Forwarding X
                 "-v", "/tmp/.X11-unix:/tmp/.X11-unix:rw",
                 "-e", "XAUTHORITY=/tmp/.Xauthority",
                 "-v", "${localEnv:HOME}/.Xauthority:/tmp/.Xauthority"],

Somehow was (silently?) breaking. If I remove all the section from "Forwarding X" it works on Windows with WSL2.

chrmarti commented 4 months ago

Not sure how that affects the terminal. The Dev Containers extension automatically forwards X11 and Wayland displays, so the "Forwarding X" part shouldn't be needed.

awesomebytes commented 4 months ago

I have no idea how that affects anything, but with or without it, VSCode in Linux does not have this "(show log)" infinite wait. On Windows, it got stuck... and I see no errors. And any "postAttachCommand" (or other "xxxxCommand") never get executed, as if it was waiting for something. However, the container is running, as I can open an additional terminal and execute commands.

I do recognize that my bug is not exactly the same bug as described originally, and I apologize for that, but it was the closest I found at the time (I did see the "Starting Dev Container" log, but not the "Configuring Dev Container" log).

As for your comment that Dev Container already forwards X11/Wayland displays, it did not work for me until I added those lines... a few months ago when I was testing. I don't know if anything has changed up to now. Our needs have changed meanwhile and we aren't opening any graphical program anymore, so I was happy to delete those config lines (but I will need to go back into it sometime soon I suspect).

jbcpollak commented 2 months ago

I have context for this:

I am on MacOS with a devcontainer that specifies (in part):

    "mounts": [
            "source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind",
         }

My co-workers with linux hosts have no problems starting and launching the container. However, when I launch the container I get Configuring Dev Container (show log) spinning in the blue bar at the bottom of VSCode. Also, initializationCommand would run, but appeared to never terminate for me, but was fine for my Linux colleagues. My postStartCommand would not run at all.

When I comment out the above line, everything works fine for me, the container starts and my scripts run to completion.

MemoryShadow commented 1 month ago

I can also only reproduce with "terminal.integrated.defaultLocation": "editor", it eventually opens but only after the connection is finished. We must be getting blocked by something in workbench start up when trying to open a terminal editor. Easy workaround is to force the TerminalLocation.Panel for the output in the extension. Passing to you @chrmarti

How do I execute TerminalLocation.Panel?

MemoryShadow commented 1 month ago

In my tests, this problem occurs when postCreateCommand is configured in devcontainer.json in the same environment. I suspect that waiting for an option that will never return is causing this problem. Here is the parameter of my use environment:

$ podman version
Version:      3.4.4
API Version:  3.4.4
Go Version:   go1.18.1
Built:        Thu Jan  1 00:00:00 1970
OS/Arch:      linux/arm64
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy
$ apt list --installed | grep podman
podman-docker/jammy-updates,jammy-security,now 3.4.4+ds1-1ubuntu1.22.04.2 arm64 [installed]
podman-toolbox/jammy,now 0.0.99.2-2ubuntu1 arm64 [installed]
podman/jammy-updates,jammy-security,now 3.4.4+ds1-1ubuntu1.22.04.2 arm64 [installed]