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

"Error running command <command>: Canceled." when adding folder via extension to VS Code with folder open #109991

Closed
bryceitoc9 opened this issue Nov 5, 2020 · 9 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@bryceitoc9
Copy link

bryceitoc9 commented Nov 5, 2020

  • VSCode Version: 1.50.1
  • OS Version: Windows 10 (v.1909, build 18363.1139)

Steps to Reproduce:

  1. Open VS Code and open a folder. Do not create a workspace.
  2. Activate an extension
  3. Execute a command from the activated extension that adds a workspace folder to VS Code via the vscode.workspace.updateWorkspaceFolders call
  4. Receive error notification via toast:

Error running command <command name>: Canceled. This is likely caused by the extension that contributes <command name>

  1. Observe the following:
  • All output channels tied to any extension are removed and appear to reboot
  • Open treeviews provided by the extension don't appear to restart
  • If you have an output channel tied to the extension open, the dropdown swaps to "Tasks" but the content shown in the output channel doesn't update. Clicking the dropdown and clicking another output channel loads that output channel's output correctly (including Tasks)
  1. Side notes:
  • If a user has no folders open, VS Code fully restarts (expected)
  • If a user has a workspace open with 1+ folders (instead of just a folder open), the extension behaves as expected without the error message.

Does this issue occur when all extensions are disabled?: No, error is specifically generated by extensions adding workspace folders.

@vscodebot
Copy link

vscodebot bot commented Nov 5, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@bpasero
Copy link
Member

bpasero commented Nov 10, 2020

I cannot reproduce. With a simple hello world extension, I run this code and it works fine:

vscode.workspace.updateWorkspaceFolders(0, undefined, { uri: vscode.Uri.file('/Users/bpasero/Desktop/test-ts/src/test') });

You will have to come up with minimal reproducible steps.

As for your issues pointed out in 5 and 6, could you please file individual issues so that in here we focus on the "error running command" problem?

@bpasero bpasero added the info-needed Issue requires more information from poster label Nov 10, 2020
@bryceitoc9
Copy link
Author

This is the line in the workflow that triggers the error: https://github.com/aws/aws-toolkit-vscode/blob/master/src/lambda/commands/importLambda.ts#L97 ; unfortunately, you'll need to have an AWS account with a downloadable Lambda function to test it directly.

The helper function that that line calls is here: https://github.com/aws/aws-toolkit-vscode/blob/5d1f1807d9b9546e6ccc0ef1728d6303a6cedb89/src/shared/utilities/workspaceUtils.ts#L35

@bpasero
Copy link
Member

bpasero commented Nov 10, 2020

I am sorry but we are not diagnosing issues in other extensions code.

@bryceitoc9
Copy link
Author

I'll see if I can strip this out into a minimal extension, but this is definitely reproducible in this case on both Mac and Windows.

re: your test, does any code after the updateWorkspaceFolders execute?

@bpasero
Copy link
Member

bpasero commented Nov 10, 2020

@bryceitoc9 no, it is the only code in the command. Note that we restart the extension host in certain cases and maybe that is the source of all the issues you describe? No code can execute after that if it happens.

See #69335

@bryceitoc9
Copy link
Author

I'll see if I can play around with this in the next week or so but that does sound like it might be the root cause. 👍ed it in the meanwhile, thanks!

@bpasero
Copy link
Member

bpasero commented Nov 10, 2020

Sounds good 👍

@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants
@bpasero @bryceitoc9 and others