spmeesseman / vscode-taskexplorer

Run and Manage Tasks for Visual Studio Code
Other
141 stars 30 forks source link

Loads forever and finally: "Cannot reconnect. Please reload the window." #133

Closed KolyaKorruptis closed 3 years ago

KolyaKorruptis commented 3 years ago

I can run tasks via the command menu fine. But when I have Task Explorer enabled it loads forever and finally I get a pop-up: "Cannot reconnect. Please reload the window." This message only appears when I have Task Explorer enabled. I'm working on WSL and Task Explorer used to work fine with that. But since yesterday I've had to disable it,

markkirchner commented 3 years ago

The behaviour I get for the last few days is very similar: When trying to open the Task Explorer view, it "loads forever" and the view remains blank/empty the whole time. But in the end I get a popup saying "Extension host terminated unexpectedly" instead.

Additional info:

spmeesseman commented 3 years ago

shit. there was a major overhaul in the release over the weekend. FOr now, you can install an old version in the Extension view of VSCode (elipses -> Install different version), not sure how that works though, and if you'd have to unset it to receive updates in the future. I'l look into it, Ive never used WSL, and in fact theres a few tickets open saying it never worked in WSL, Ive never tested it myself.

spmeesseman commented 3 years ago

aaahhh, i think i know what it might be. therell be a new releasrhis weekend, ill try to address this. for now seemy post above and you can install an older version

spmeesseman commented 3 years ago

for WSL, do you know if the user data folder is a remote folder? (where you would find your user tasks file tasks.json)

spmeesseman commented 3 years ago

also, please enable Task Explorer logging, turn the level all theway up, and restart. then send me that output from the Task Explorer output window

KolyaKorruptis commented 3 years ago

.vscode/tasks.json is inside the WSL container, always has been, never a problem. I set the debug level to 5. This is from the Output panel [Log: Remote Extension Host]:

[2021-02-09 18:23:07.695] [exthost] [info] extension host started
[2021-02-09 18:23:07.751] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch {"startup":true,"extensionId":{"value":"vscode.debug-auto-launch","_lower":"vscode.debug-auto-launch"},"activationEvent":"*"}
[2021-02-09 18:23:07.752] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/debug-auto-launch/dist/extension
[2021-02-09 18:23:07.756] [exthost] [info] ExtensionService#_doActivateExtension vscode.git {"startup":true,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
[2021-02-09 18:23:07.756] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/git/dist/main
[2021-02-09 18:23:07.801] [exthost] [info] ExtensionService#_doActivateExtension ecmel.vscode-html-css {"startup":true,"extensionId":{"value":"ecmel.vscode-html-css","_lower":"ecmel.vscode-html-css"},"activationEvent":"*"}
[2021-02-09 18:23:07.801] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/ecmel.vscode-html-css-1.9.1/dist/extension.js
[2021-02-09 18:23:07.837] [exthost] [info] ExtensionService#_doActivateExtension EditorConfig.EditorConfig {"startup":true,"extensionId":{"value":"EditorConfig.EditorConfig","_lower":"editorconfig.editorconfig"},"activationEvent":"*"}
[2021-02-09 18:23:07.837] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/editorconfig.editorconfig-0.16.4/out/editorConfigMain.js
[2021-02-09 18:23:07.854] [exthost] [info] ExtensionService#_doActivateExtension Fr43nk.seito-openfile {"startup":true,"extensionId":{"value":"Fr43nk.seito-openfile","_lower":"fr43nk.seito-openfile"},"activationEvent":"*"}
[2021-02-09 18:23:07.854] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/fr43nk.seito-openfile-1.8.7/out/extension.js
[2021-02-09 18:23:07.866] [exthost] [info] ExtensionService#_doActivateExtension ionutvmi.path-autocomplete {"startup":true,"extensionId":{"value":"ionutvmi.path-autocomplete","_lower":"ionutvmi.path-autocomplete"},"activationEvent":"*"}
[2021-02-09 18:23:07.867] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/ionutvmi.path-autocomplete-1.17.1/out/src/extension
[2021-02-09 18:23:07.871] [exthost] [info] ExtensionService#_doActivateExtension kisstkondoros.vscode-gutter-preview {"startup":true,"extensionId":{"value":"kisstkondoros.vscode-gutter-preview","_lower":"kisstkondoros.vscode-gutter-preview"},"activationEvent":"*"}
[2021-02-09 18:23:07.871] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/kisstkondoros.vscode-gutter-preview-0.26.2/dist/extension
[2021-02-09 18:23:07.891] [exthost] [info] ExtensionService#_doActivateExtension mhutchie.git-graph {"startup":true,"extensionId":{"value":"mhutchie.git-graph","_lower":"mhutchie.git-graph"},"activationEvent":"*"}
[2021-02-09 18:23:07.892] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/mhutchie.git-graph-1.28.0/out/extension.js
[2021-02-09 18:23:07.907] [exthost] [info] ExtensionService#_doActivateExtension ryu1kn.partial-diff {"startup":true,"extensionId":{"value":"ryu1kn.partial-diff","_lower":"ryu1kn.partial-diff"},"activationEvent":"*"}
[2021-02-09 18:23:07.907] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/ryu1kn.partial-diff-1.4.1/out/extension
[2021-02-09 18:23:07.947] [exthost] [info] ExtensionService#_doActivateExtension spmeesseman.vscode-taskexplorer {"startup":true,"extensionId":{"value":"spmeesseman.vscode-taskexplorer","_lower":"spmeesseman.vscode-taskexplorer"},"activationEvent":"*"}
[2021-02-09 18:23:07.947] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/spmeesseman.vscode-taskexplorer-1.30.2/out/extension
[2021-02-09 18:23:07.983] [exthost] [info] ExtensionService#_doActivateExtension Zignd.html-css-class-completion {"startup":true,"extensionId":{"value":"Zignd.html-css-class-completion","_lower":"zignd.html-css-class-completion"},"activationEvent":"*"}
[2021-02-09 18:23:07.983] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/zignd.html-css-class-completion-1.20.0/dist/extension.js
[2021-02-09 18:23:08.098] [exthost] [info] ExtensionService#_doActivateExtension vscode.npm {"startup":true,"extensionId":{"value":"vscode.npm","_lower":"vscode.npm"},"activationEvent":"workspaceContains:package.json"}
[2021-02-09 18:23:08.098] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/npm/dist/npmMain
[2021-02-09 18:23:08.122] [exthost] [info] ExtensionService#_doActivateExtension yzhang.markdown-all-in-one {"startup":true,"extensionId":{"value":"yzhang.markdown-all-in-one","_lower":"yzhang.markdown-all-in-one"},"activationEvent":"workspaceContains:README.md"}
[2021-02-09 18:23:08.122] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/yzhang.markdown-all-in-one-3.4.0/dist/extension
[2021-02-09 18:23:08.625] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode.js-debug {"startup":false,"extensionId":{"value":"ms-vscode.js-debug","_lower":"ms-vscode.js-debug"},"activationEvent":"onCommand:extension.js-debug.clearAutoAttachVariables"}
[2021-02-09 18:23:08.625] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/ms-vscode.js-debug/src/extension.js
[2021-02-09 18:23:08.812] [exthost] [info] ExtensionService#_doActivateExtension vscode.github {"startup":false,"extensionId":{"value":"vscode.github","_lower":"vscode.github"},"activationEvent":"*"}
[2021-02-09 18:23:08.812] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/github/dist/extension.js
[2021-02-09 18:23:08.879] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing {"startup":false,"extensionId":{"value":"vscode.configuration-editing","_lower":"vscode.configuration-editing"},"activationEvent":"onLanguage:jsonc"}
[2021-02-09 18:23:08.879] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/configuration-editing/dist/configurationEditingMain
[2021-02-09 18:23:08.885] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features {"startup":false,"extensionId":{"value":"vscode.json-language-features","_lower":"vscode.json-language-features"},"activationEvent":"onLanguage:jsonc"}
[2021-02-09 18:23:08.885] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/json-language-features/client/dist/node/jsonClientMain
[2021-02-09 18:23:08.936] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features {"startup":false,"extensionId":{"value":"vscode.typescript-language-features","_lower":"vscode.typescript-language-features"},"activationEvent":"onLanguage:jsonc"}
[2021-02-09 18:23:08.936] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/typescript-language-features/dist/extension
[2021-02-09 18:23:18.100] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet {"startup":false,"extensionId":{"value":"vscode.emmet","_lower":"vscode.emmet"},"activationEvent":"onStartupFinished"}
[2021-02-09 18:23:18.101] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/emmet/dist/node/emmetNodeMain
[2021-02-09 18:23:18.137] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict {"startup":false,"extensionId":{"value":"vscode.merge-conflict","_lower":"vscode.merge-conflict"},"activationEvent":"onStartupFinished"}
[2021-02-09 18:23:18.137] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/merge-conflict/dist/mergeConflictMain
[2021-02-09 18:23:18.143] [exthost] [info] ExtensionService#_doActivateExtension vscode.testing-editor-contributions {"startup":false,"extensionId":{"value":"vscode.testing-editor-contributions","_lower":"vscode.testing-editor-contributions"},"activationEvent":"onStartupFinished"}
[2021-02-09 18:23:18.143] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/testing-editor-contributions/dist/extension.js
[2021-02-09 18:23:18.148] [exthost] [info] ExtensionService#_doActivateExtension eamodio.gitlens {"startup":false,"extensionId":{"value":"eamodio.gitlens","_lower":"eamodio.gitlens"},"activationEvent":"onStartupFinished"}
[2021-02-09 18:23:18.148] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/eamodio.gitlens-11.2.1/dist/gitlens
[2021-02-09 18:23:18.289] [exthost] [info] eager extensions activated
[2021-02-09 18:23:18.443] [exthost] [info] ExtensionService#_doActivateExtension vscode.gulp {"startup":false,"extensionId":{"value":"vscode.gulp","_lower":"vscode.gulp"},"activationEvent":"onCommand:workbench.action.tasks.runTask"}
[2021-02-09 18:23:18.444] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/gulp/dist/main
[2021-02-09 18:23:18.446] [exthost] [info] ExtensionService#_doActivateExtension vscode.jake {"startup":false,"extensionId":{"value":"vscode.jake","_lower":"vscode.jake"},"activationEvent":"onCommand:workbench.action.tasks.runTask"}
[2021-02-09 18:23:18.446] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/jake/dist/main
[2021-02-09 18:23:18.448] [exthost] [info] ExtensionService#_doActivateExtension ms-azuretools.vscode-docker {"startup":false,"extensionId":{"value":"ms-azuretools.vscode-docker","_lower":"ms-azuretools.vscode-docker"},"activationEvent":"onCommand:workbench.action.tasks.runTask"}
[2021-02-09 18:23:18.448] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/ms-azuretools.vscode-docker-1.9.1/main
[2021-02-09 18:23:19.075] [exthost] [info] ExtensionService#_doActivateExtension vscode.extension-editing {"startup":false,"extensionId":{"value":"vscode.extension-editing","_lower":"vscode.extension-editing"},"activationEvent":"onLanguage:json"}
[2021-02-09 18:23:19.075] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/bin/8490d3dde47c57ba65ec40dd192d014fd2113496/extensions/extension-editing/dist/extensionEditingMain
[2021-02-09 18:23:19.089] [exthost] [info] ExtensionService#_doActivateExtension lonefy.vscode-JS-CSS-HTML-formatter {"startup":false,"extensionId":{"value":"lonefy.vscode-JS-CSS-HTML-formatter","_lower":"lonefy.vscode-js-css-html-formatter"},"activationEvent":"onLanguage:json"}
[2021-02-09 18:23:19.089] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/lonefy.vscode-js-css-html-formatter-0.2.3/out/src/extension
[2021-02-09 18:23:19.096] [exthost] [info] ExtensionService#_doActivateExtension richie5um2.vscode-sort-json {"startup":false,"extensionId":{"value":"richie5um2.vscode-sort-json","_lower":"richie5um2.vscode-sort-json"},"activationEvent":"onLanguage:json"}
[2021-02-09 18:23:19.096] [exthost] [info] ExtensionService#loadCommonJSModule file:///home/nicolai/.vscode-server/extensions/richie5um2.vscode-sort-json-1.19.2/lib/index.js
KolyaKorruptis commented 3 years ago

Okay, I found the log you most likely meant: output-task-explorer.log

I installed version 1.29.0 which works fine. Getting back to the current version will be simple, since there's a button on the Task Explorer entry in extension view, to do so.

GabbeV commented 3 years ago

I believe I have the same issue. I'm not using WSL. I got it to not load forever by removing this line. Seems like the problem is that the tree is recursive for some reason. image

GabbeV commented 3 years ago

The following .vscode/tasks.json in an otherwise empty folder recreates the issue for me:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "foo",
            "type": "npm",
            "script": "start",
            "path": "foo/bar"
        },
        {
            "label": "bar",
            "type": "npm",
            "script": "start"
        }
    ]
}

Removing "path": "foo/bar" solves it.

spmeesseman commented 3 years ago

@GabbeV good find, thank you for sharing...

so turning off "Group by Separator" in settings "should" have the same effect as removing that line.

@KolyaKorruptis does turning off that setting resolve the issue for you? I think maybe two separate issues, but maybe not. I think for you, its a WSL thing, and I've added a new setting in 2.0 that will skip the code that I think is causing the problem. Once we verify that turning off that new setting in 2.0 does or does not fix your issue, we can go from there. Gonna work on and release 2,0 this weekend, I've had zero time to work on it this week, pretty busy at work all day every day. But let's see if what GabbeV found does anything for you first...

GabbeV commented 3 years ago

Turning off "Group with separator" seems to be a valid workaround for me 👍

spmeesseman commented 3 years ago

@GabbeV , i was looking at this tonight, I cant repro and I'm dumbfounded as to how the npm tasks without any separators in the label property are causing this. v2.0 is a major rebuild, so it may resolve this on accident, we'll see. can you reproduce it and post your log as explained in one of the posts above? and then when v2 comes out this weekend, afterwards if u can let me know if the new version behaves any differently for you I'd appreciate it. Thanks!

KolyaKorruptis commented 3 years ago

@spmeesseman Turning off "Group with separator" works for me on WSL2 in Task Explorer v1.30.2 👍

GabbeV commented 3 years ago

The issue seem to come from here. You add the subfolder to the list of files you are currently iterating over, causing you to add the subfolder to it self in the next iteration here. This creates a loop in the tree and anything trying to traverse the tree after that point will loop forever.

This tasks.json will recreate the issue as long as you have "Group with separator" turned on.

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "foo",
            "type": "npm",
            "script": "foo",
            "path": "some/path"
        },
        {
            "label": "bar",
            "type": "npm",
            "script": "bar",
            "path": "some/other/path"
        }
    ]
}

The important part is that they have different "path".

spmeesseman commented 3 years ago

well i think i have inadvertently fixed this in 2.0, because I cant reproduce no matter what. WIll release that tonight or tomorrow, if u guys can check on that again in a few days and let me know if its still an issue Id appreciate it, thanks for all the xtra info provided...

GabbeV commented 3 years ago

This issue is not fixed in version 2.0.2. The faulty code i pointed out in my last comment is still left here.

I fail to see how you can't reproduce the issue as I have tried it with a completely fresh installation of vscode with only this extension installed and all settings set to their defaults.

Here is a zip of a project that reproduce the issue. To reproduce the issue simply unpack the zip and open the folder named "task-explorer-bug" in vscode. task-explorer-bug.zip

GabbeV commented 3 years ago

Here is what goes wrong.

When entering createTaskGroupings the tree looks like this:

TaskFolder: workspacename
    TaskFile: source: vscode, path: some/path
        TaskItem: foo
    TaskFile: source: vscode, path: some/other/path
        TaskItem: bar
  1. This loop starts iterating over the TaskFiles.
  2. It finds 2 TaskFiles with the same source and decides to create a new subfolder.
  3. The new subfolder is added to the list we are currently looping over making it the value of each in the next loop iteration.

    TaskFolder: workspacename
      TaskFile: source: vscode, path: some/path
          TaskItem: foo
      TaskFile: source: vscode, path: some/other/path
          TaskItem: bar
      TaskFile: source: vscode // new subfolder
          TaskFile: source: vscode, path: some/path
              TaskItem: foo
          TaskFile: source: vscode, path: some/other/path
              TaskItem: bar
  4. This newly created subfolder also have the same source causing it to also get added to the subfolder(itself) creating a loop in the tree.
    TaskFolder: workspacename
      TaskFile: source: vscode, path: some/path
          TaskItem: foo
      TaskFile: source: vscode, path: some/other/path
          TaskItem: bar
      TaskFile: source: vscode <-- new subfolder
          TaskFile: source: vscode, path: some/path
              TaskItem: foo
          TaskFile: source: vscode, path: some/other/path    
              TaskItem: bar
          TaskFile: source: vscode <-- new subfolder
              TaskFile: source: vscode, path: some/path
                  TaskItem: foo
              TaskFile: source: vscode, path: some/other/path    
                  TaskItem: bar
              TaskFile: source: vscode <-- new subfolder
                  TaskFile: source: vscode, path: some/path
                      TaskItem: foo
                  TaskFile: source: vscode, path: some/other/path    
                      TaskItem: bar
                  TaskFile: source: vscode <-- new subfolder
                      ...recurse forever...
spmeesseman commented 3 years ago

what u keep pointing out to me is on purpose, I'm aware of where its coming from, but thank you for spending time looking at it. Its only happening to smoe users and I cant reproduce it as I said. With your same test params. ill look back into it one day after work this week...

grloch commented 3 years ago

I downgraded my installation to version 1.30.2 and it started to work again.

spmeesseman commented 3 years ago

yes, there's definitely a problem with 2.0 and workspace tasks that are type npm and/or have a path set. @grloch can you confirm you have these type of task definition(s) in your workspace?

v2.0.3 was let go tonight to fix a few reproducible issues, I found a core issue with the asynchronous approach that 2.0 uses. I don't think it will address this particular issue, but, can one of you guys test for me since I haven't been able to reproduce yet?

mzimdars-gms-online-de commented 3 years ago

Hi Scott, I don't know if I had exactly this issue (because there was never any error message 'at the end' because it never finished), but with your fix my issue is now gone :-) Thanks for your effort, the tool really helps a lot if you have many tasks to manage! Michael

GabbeV commented 3 years ago

@spmeesseman can you help me understand what is different in your attempt at reproducing the issue?

If you use the following tasks.json file and set a breakpoint right before removeGroupedTasks. What is the contents of the folder variable?

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "foo",
            "type": "npm",
            "script": "foo",
            "path": "some/path"
        },
        {
            "label": "bar",
            "type": "npm",
            "script": "bar",
            "path": "some/other/path"
        }
    ]
}

For me it looks like this with the last TaskFile in scripts being infinitely recursive. image

If yours is recursive like mine. What prevents removeScripts from calling itself forever?

spmeesseman commented 3 years ago

is there any chance that these are the only two tasks in the workspace folder? no other npm tasks (in a package.json), etc, nothing else?

spmeesseman commented 3 years ago

i think i know what the problem is. ill look at it this weekend and try to get a fix out, been a long week at work so it wont be tonight

spmeesseman commented 3 years ago

finally figured it out, couldn't help but look at it tonight, with a week's break from it I found it right away. Ill let the fix go later tonight, or early tomorrow (GMT-4/EDT)

spmeesseman commented 3 years ago

:tada: This issue has been resolved in version 2.0.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: