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

AzureRM Tools extension prevents PowerShell extension from loading #1016

Closed
brandubh opened this issue Sep 1, 2017 · 24 comments
Closed

AzureRM Tools extension prevents PowerShell extension from loading #1016

brandubh opened this issue Sep 1, 2017 · 24 comments
Labels
Issue-Bug A bug to squash.
Milestone

Comments

@brandubh
Copy link

brandubh commented Sep 1, 2017

System Details

  • Operating system name and version: Windows 10 (1703) 15063.540
  • VS Code version: 1.16.0-insider
  • PowerShell extension version: 1.4.1
  • Output from $PSVersionTable:
    Name Value

PSVersion 5.1.15063.502
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.502
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Copy / paste the following commands into the PowerShell Integrated Console, and paste the output here:

 code -v
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ code -v
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS> $pseditor.EditorServicesVersion
PS> code --list-extensions --show-versions
code : The term 'code' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is
correct and try again.
At line:1 char:1
+ code --list-extensions --show-versions
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (code:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.15063.502
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.502
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
[logs.zip](https://github.com/PowerShell/vscode-powershell/files/1270431/logs.zip)

SerializationVersion           1.1.0.1

Issue Description

Basically the extension after the latest insider updates doesn't work anymore (no F8, no auto complete, and so on), in the output window I can read:
[8:58:45] Language server starting...
[8:58:45] Language server startup failed.

Attached Logs

I attach the logs, but they're empty

@brandubh
Copy link
Author

brandubh commented Sep 8, 2017

Still present with extension 1.4.2

2017-9-8 12:09:12 [NORMAL] - Visual Studio Code v1.17.0-insider 64-bit
2017-9-8 12:09:12 [NORMAL] - PowerShell Extension v1.4.2
2017-9-8 12:09:12 [NORMAL] - Operating System: Windows 64-bit

2017-9-8 12:09:12 [NORMAL] - Language server starting...
2017-9-8 12:09:12 [NORMAL] - Language server startup failed.

@reg-c
Copy link

reg-c commented Sep 8, 2017

Hi, I am having the same problem here:

Windows 10 (1703) 15063.540

$PSVersionTable:
PSVersion 5.1.15063.502
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.502
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

2017-9-8 14:03:35 [NORMAL] - Visual Studio Code v1.16.0 64-bit
2017-9-8 14:03:35 [NORMAL] - PowerShell Extension v1.4.2
2017-9-8 14:03:35 [NORMAL] - Operating System: Windows 64-bit

2017-9-8 14:03:35 [NORMAL] - Language server starting...
2017-9-8 14:03:35 [NORMAL] - Language server startup failed.

@MarvTheRobot
Copy link

Me too:

I'd upload the logs, but they are empty. I've changed the logging level to Verbose, still empty.

Name Value


PSVersion 5.1.15063.502
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.502
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

2017-9-8 09:58:50 [NORMAL] - Visual Studio Code v1.17.0-insider 64-bit
2017-9-8 09:58:50 [NORMAL] - PowerShell Extension v1.4.2
2017-9-8 09:58:50 [NORMAL] - Operating System: Windows 64-bit

2017-9-8 09:58:50 [NORMAL] - Language server starting...
2017-9-8 09:58:50 [NORMAL] - Language server startup failed.
2017-9-8 12:07:00 [NORMAL] -

Shutting down language client...
2017-9-8 12:09:13 [NORMAL] -

Shutting down language client...
2017-9-8 12:09:40 [NORMAL] -

Shutting down language client...

@daviwil
Copy link
Contributor

daviwil commented Sep 8, 2017

Thanks all! @Jaykul also reported this issue to me recently but I haven't yet figured out why it's happening. The logs you've all pasted are a good starting point for investigation so I'll take a look today.

@daviwil daviwil added this to the 1.4.3 milestone Sep 8, 2017
@daviwil
Copy link
Contributor

daviwil commented Sep 8, 2017

By the way, does this problem occur for you when using VS Code Stable 1.16.0 which was released yesterday, or only in the latest Insiders builds?

@MarvTheRobot
Copy link

MarvTheRobot commented Sep 8, 2017

For me it happens on both Stable and Insiders. Fully removed extension and re-installed, same issue. Just fails to load Editor Services and doesn't seem to create any log files.

@daviwil
Copy link
Contributor

daviwil commented Sep 8, 2017

Damn, not sure what happened there. Seems like it's not launching PowerShell at all. Can you try adding this setting to see if it makes any difference?

"powershell.powerShellExePath": "C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe"

@MarvTheRobot
Copy link

@daviwil , thats seems to have worked for me. The default is just "" (I can't remember if it was that normally. Adding the direct path has put everything back to how it was prior to 1.4.2

@daviwil
Copy link
Contributor

daviwil commented Sep 8, 2017

Thanks a lot for confirming! I'll see if I can get a fix out for that today.

@reg-c
Copy link

reg-c commented Sep 11, 2017

@daviwil adding the powerShellExePath doesn't work for me in the 1.16.0 build, however the extension works with the latest insider build without any changes

@richardrobberse
Copy link

@daviwil adding the powerShellExePath didn't work for me either, I'm on the 1.16 build.

@aydeisen
Copy link

@daviwil ditto for me. I'm running VSCode 1.16 on Windows 10 1703, and adding powershell.powerShellExePath. I was hoping it was from switching VSCode from x86 to x64, but neither enabling the x86 PowerShell nor switching back to 32-bit VSCode resolved the issue

@aydeisen
Copy link

aydeisen commented Sep 11, 2017

@daviwil I got the vscode-PowerShell extension to work after disabling the 'Azure Tools for Visual Studio Code' extension by 'bradygaster', which is installed as part of the 'Azure Extension Pack' by 'Microsoft'.
https://github.com/bradygaster/azure-tools-vscode

@richardrobberse
Copy link

@aydeisen This worked for me too, thanks for the tip!

@reg-c
Copy link

reg-c commented Sep 12, 2017

@aydeisen removing the Azure tools also fixed powershell for me. And now after I added the msazurermtools.azurerm-vscode-tools extension again PowerShell still works...

@aydeisen
Copy link

aydeisen commented Sep 12, 2017

@cjrege: that extension doesn't look right. It was the bradygaster.azuretoolsforvscode-1.2.9 extension that was the issue. The ms-vscode.powershell-1.4.2 extension continued to work with all of the other Azure extensions included with the ms-vscode.vscode-azureextensionpack

@daviwil
Copy link
Contributor

daviwil commented Sep 12, 2017

Hey all, thanks a lot for the investigation! It definitely turns out that the Azure Tools for VS Code extension (or more accurately, one of its dependencies) is causing this issue. They use the AppInsights SDK for Node.js which hijacks some standard Node.js APIs to provide instrumentation. Their wrapper of the filesystem module is causing an error to be thrown in a way that prevents the PowerShell extension from being loaded.

I've included some more details here: https://github.com/bradygaster/azure-tools-vscode/issues/46#issuecomment-328999603

Currently trying to find a workaround, I'll ship a patch update as soon as I have something.

@daviwil daviwil changed the title Extension stopped working in latest builds AzureRM Tools extension prevents PowerShell extension from loading Sep 13, 2017
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Sep 13, 2017
…on conflict

This change fixes an issue that was illuminated by the AzureRM Tools
extension where the `fs.appendFile` method provided by Node.js was not
being called with the correct number of parameters.

The AzureRM Tools extension loads up the AppInsights SDK for Node.js
which in turn loads a module called Zone.js.  Zone.js replaces built-in
Node.js modules like `fs` to instrument their function calls.  The
instrumented version of that module was not as permissive on our missing
`appendFile` parameter so it threw an exception which ultimately
prevented the PowerShell extension from loading.

This issue was fixed by populating the `callback` parameter of the
`appendFile` function so that the instrumented wrapper operates
correctly.
@daviwil daviwil mentioned this issue Sep 13, 2017
daviwil added a commit to daviwil/vscode-powershell that referenced this issue Sep 13, 2017
…on conflict

This change fixes an issue that was illuminated by the AzureRM Tools
extension where the `fs.appendFile` method provided by Node.js was not
being called with the correct number of parameters.

The AzureRM Tools extension loads up the AppInsights SDK for Node.js
which in turn loads a module called Zone.js.  Zone.js replaces built-in
Node.js modules like `fs` to instrument their function calls.  The
instrumented version of that module was not as permissive on our missing
`appendFile` parameter so it threw an exception which ultimately
prevented the PowerShell extension from loading.

This issue was fixed by populating the `callback` parameter of the
`appendFile` function so that the instrumented wrapper operates
correctly.
@daviwil
Copy link
Contributor

daviwil commented Sep 13, 2017

Just shipped 1.4.3 with a fix for this issue, let me know how it goes for you!

@aydeisen
Copy link

@daviwil I can confirm that the Integrated terminal, along with the PowerShell extension, are now loading properly with bradygaster's Azure Tools for Visual Studio Code enabled.

Thanks for the quick turnaround.

@daviwil
Copy link
Contributor

daviwil commented Sep 13, 2017

Fantastic, thanks for confirming, and thanks again for the diagnostic assistance!

@brandubh
Copy link
Author

Great! It solves the issue. Thx a mil.

@adarobin
Copy link

adarobin commented Oct 3, 2017

@daviwil There is still something weird going on with this extension on macOS. I have to disable the Azure Tools for Visual Studio extension to get the PowerShell Integrated Console to display anything. If I don't disable that extension, the PowerShell Integrated Console just sits like this forever:
screen shot 2017-10-03 at 9 09 19 am

The verbose logs don't seem to contain anything useful:

EditorServices.log
vscode-powershell.log

@andystumph
Copy link

I still experienced it on 1.4.3 as well. Had to disable Azure Tools to get the integrated console to launch. Running on Windows 8.1 though.

@aydeisen
Copy link

aydeisen commented Oct 3, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash.
Projects
None yet
Development

No branches or pull requests

8 participants