microsoft / vscode-azurecli

VS Code extension for the Azure CLI 2.0
MIT License
71 stars 46 forks source link

No IntelliSense on Windows #53

Open azMantas opened 5 years ago

azMantas commented 5 years ago

it takes roughly about 10-15 seconds to load suggestions and what I get you can clearly see in the picture. Doesn't matter what kind of command I use, I always get the same results. Tried to run vs code as admin, reinstall both az-cli and plugin, but no help here. image

azure-cli: 2.0.66 phyton: 3.7.3 vs code: 1.35.1 win 10 1903

mcollier commented 5 years ago

Same error.

azure-cli: 2.0.70 python: 3.7.4 vs code: 1.36.1 win 10: 1809


azure-cli                         2.0.70

command-modules-nspkg               2.0.3
core                              2.0.70
nspkg                              3.0.4
telemetry                          1.0.3

Extensions:
find                               0.3.0
noelbundick                       0.0.14

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\mcollier\.azure\cliextensions'

Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.
chrmarti commented 5 years ago

Which version of the Azure CLI extension are you using?

azMantas commented 5 years ago

2.0.71

chrmarti commented 5 years ago

That's the CLI's version. What's the extensions version? (As seen in VS Code's extension viewlet.)

azMantas commented 5 years ago

0.4.6 I also tried older versions (all the way to 3.0) but none of them works smooth. With version 0.4.3 I have the best experience and have to wait for a suggestion for a few seconds or so. Is still better then nothing. Edit: Just reinstalled 0.4.6 version and everything works smooth!

chrmarti commented 5 years ago

Great, thanks!

mcollier commented 5 years ago

Reinstalling 0.4.6 did not work for me. I did recently update a few components. Here is what I currently have:

I did notice that I seem to have two Python versions on my machine. The Azure CLI reports that the python version being used is 3.6.6 at C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2. However, why I run python --version I get a version of 3.7.4. I believe the location would be my install location of C:\Program Files (x86)\Python37-32.

Additionally, when I look at the Output tab in VS Code for the Log (Extension Host), I see several log messages such as the following: [2019-08-15 09:21:55.306] [exthost] [error] [ms-vscode.azurecli] provider FAILED [2019-08-15 09:21:55.306] [exthost] [error] Python process terminated with exit code 0, signal null.

azMantas commented 5 years ago

Every single time I have to use *.azcli file, first I have to disable plugin, reload vs code, enable plugin again and it works after few seconds of "warming up"

chrmarti commented 5 years ago

Is there anything in the console (Help > Toggle Developer Tools) when it does not work?

azMantas commented 5 years ago

image

wshamroukh-zz commented 4 years ago

I have the same exact behavior here.. Sometimes it never shows suggestion at all and gets stuck at loading. I also have the same exact error in that AzMantas shared from the console

wshamroukh-zz commented 4 years ago

https://raw.githubusercontent.com/wshamroukh/images/master/Annotation%202019-09-22%20212734.png

wshamroukh-zz commented 4 years ago

@chrmarti I have been scratching my head around this issue. I have noticed that every 5-10 seconds or so the python process is exiting an a new one is created which this causes the delay in the autocompletion of Azure CLI commands. This keeps happening all the time as long as code.exe is open and a new file is open in the code.exe and the script file is Azure CLI.

This is the command that the python runs when it starts: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe" c:\Users\myUserName\.vscode\extensions\ms-vscode.azurecli-0.4.6\service\start.py "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe"

I have also noticed the same process that fails, spawns a new python process.

And when i tried to run this command from my end manually, I get this error:

"C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe" c:\Users\myUserName\.vscode\extensions\ms-vscode.azurecli-0.4.6\service\start.py "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe" Traceback (most recent call last): File "c:\Users\myUserName\.vscode\extensions\ms-vscode.azurecli-0.4.6\service\start.py", line 6, in <module> import azservice.__main__ File "c:\Users\myUserName\.vscode\extensions\ms-vscode.azurecli-0.4.6\service\azservice\__main__.py", line 370, in <module> main() File "c:\Users\myUserName\.vscode\extensions\ms-vscode.azurecli-0.4.6\service\azservice\__main__.py", line 341, in main keep_loading = load_arguments(command_table, 10) File "c:\Users\myUserName\.vscode\extensions\ms-vscode.azurecli-0.4.6\service\azservice\tooling2.py", line 87, in load_arguments cli_ctx.invocation.commands_loader.load_arguments(command) File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-6e754znd\azure-cli-core\azure\cli\core\__init__.py", line 291, in load_arguments File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-6e754znd\azure-cli-core\azure\cli\core\commands\__init__.py", line 291, in load_arguments File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-6e754znd\knack\knack\commands.py", line 97, in load_arguments File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-6e754znd\azure-cli-core\azure\cli\core\__init__.py", line 488, in default_arguments_loader File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-6e754znd\azure-cli-core\azure\cli\core\__init__.py", line 528, in get_op_handler File "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\lib\importlib\__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "C:\Users\VSSADM~1\AppData\Local\Temp\pip-install-6e754znd\azure-cli\azure\cli\command_modules\apim\custom.py", line 9, in <module> **ModuleNotFoundError: No module named 'azure.mgmt.apimanagement.models.api_management_client_enums'**

It is the same error i get in the debugging console: https://raw.githubusercontent.com/wshamroukh/images/master/Annotation%202019-09-22%20212734.png

One thing to notice here is this user (C:\Users\VSSADM~1) is not on my system. Could this be hardcoded in the python code that is running?

wshamroukh-zz commented 4 years ago

@azMantas / @chrisdias it seems this could be related to this issue? https://github.com/Azure/azure-cli/issues/10496

chrmarti commented 4 years ago

@wshamroukh You're right. Thanks for investigating. Marking as upstream issue.

wshamroukh-zz commented 4 years ago

@azMantas @mcollier - to work-around this issue, there should be the following two files underC:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\mgmt\apimanagement\models\:

api_management_client_enums.py
_api_management_client_enums.py

I had to take a copy of _api_management_client_enums.py and rename it to api_management_client_enums.py

After doing this, the Azure CLI extension on visual studio code is just working like a charm.

azMantas commented 4 years ago

First I had to update az version to get to the "apimanagement" folder. To rename or delete api_managment file makes no different in performance. I also reinstalled az cli extension - no help

mcollier commented 4 years ago

Same as @azMantas. No joy.

wshamroukh-zz commented 4 years ago

So you just get the "unknown error occurred" error? I see this error is generated from time to time when the autocompletion shows up late (5 seconds or so)

mcollier commented 4 years ago

After a few seconds, I notice the following in the "Log (Extension Host)" output window:

[2019-10-01 23:18:19.877] [exthost] [error] [ms-vscode.azurecli] provider FAILED
[2019-10-01 23:18:19.877] [exthost] [error] Python process terminated with exit code 0, signal null.
[2019-10-01 23:18:19.877] [exthost] [error] [ms-vscode.azurecli] provider FAILED
[2019-10-01 23:18:19.877] [exthost] [error] Python process terminated with exit code 0, signal null.

In the console (Help > Toggle Developer Tools), I notice the following:

console.ts:137 [Extension Host] Traceback (most recent call last):
  File "c:\Users\mcollier\.vscode-insiders\extensions\ms-vscode.azurecli-0.4.6\service\start.py", line 6, in <module>
    import azservice.__main__
  File "c:\Users\mcollier\.vscode-insiders\extensions\ms-vscode.azurecli-0.4.6\service\azservice\__main__.py", line 370, in <module>
    main()
  File "c:\Users\mcollier\.vscode-insiders\extensions\ms-vscode.azurecli-0.4.6\service\azservice\__main__.py", line 320, in main
    group_index = get_group_index(command_table)
  File "c:\Users\mcollier\.vscode-insiders\extensions\ms-vscode.azurecli-0.4.6\service\azservice\__main__.py", line 45, in get_group_index
    help = get_help(group)
  File "c:\Users\mcollier\.vscode-insiders\extensions\ms-vscode.azurecli-0.4.6\service\azservice\tooling2.py", line 102, in get_help
    HELP_CACHE[group_or_command] = yaml.load(helps[group_or_command], Loader=yaml.FullLoader)
AttributeError: module 'yaml' has no attribute 'FullLoader'
 (at Socket.spawn.process.stderr.on.data (c:\Users\mcollier\.vscode-insiders\extensions\ms-vscode.azurecli-0.4.6\out\src\azService.js:155:21))
chrmarti commented 4 years ago

@mcollier That is a different issue. Please update to the latest version of the Azure CLI and file a new issue here if the problem persists. Thanks.

mcollier commented 4 years ago

I'm running Azure CLI version 2.0.74. According to https://docs.microsoft.com/en-us/cli/azure/release-notes-azure-cli?view=azure-cli-latest, that is the latest version (as of this writing).

SimJWalter commented 3 years ago

this is still an issue, this extension doesn't work at all, just comes up with "Loading..." then nothng, and if the user cancels out of it then the log says "Err canceled"

drarsalan commented 3 years ago

Working on Ubuntu 20.04 not on windows 10

egreenspan2 commented 3 years ago

Still seeing this issue running VSCode 1.59.0 on Windows with remote ssh to Centos vm.

The following pops up in debug console in vscode every time intellisense is invoked.

console.ts:137 [Extension Host] Traceback (most recent call last): File "/usr/lib64/python3.6/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/xxx/.vscode-server/extensions/ms-vscode.azurecli-0.5.0/service/azservice/__main__.py", line 17, in <module> from azservice.tooling import GLOBAL_ARGUMENTS, initialize, load_command_table, get_help, get_current_subscription, get_configured_defaults, get_defaults, is_required, run_argument_value_completer, get_arguments, load_arguments, arguments_loaded File "/home/xxx/.vscode-server/extensions/ms-vscode.azurecli-0.5.0/service/azservice/tooling.py", line 8, in <module> from azure.cli.core import __version__ModuleNotFoundError: No module named 'azure'

"azure" module is depreciated and replaced with "individual modules per this issue