-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[REG 2.65 -> 2.66] Python crashes on startup #30792
Comments
Hi @orgads, 2.66.0 is not the latest Azure CLI(2.68.0). If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli. |
Thank you for opening this issue, we will look into it. |
It reproduces also with 2.68. The difference is Python version. It was upgraded from 3.11 to 3.12 in 2.66. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @akashkeshari. |
Duplicate of #30517 I assume this extension requires a dependency that doesn't provide a wheel, and compiling from source code fails. The extension owner should address this. |
That's not the case. Even if I only run python.exe without any arguments, it crashes. |
Then it's not related to CLI. I see you're using your own Python env, please check your env. Similar issue: #30594 |
What do you mean? I ran python executable from CLI2 directory. |
According to the log, you're calling |
az-prev is azure cli 2.66 extracted from zip. |
I see. Try this: #29630 (comment) |
The scripts are installed in <base>/Scripts, but PYTHONPATH was set to <scripts>/src, although this directory doesn't even exist. I guess the deployment used to be in src, but this is no longer the case. Setting PYTHONPATH is done to avoid conflicts with other installations of Python on the same machine. When it is set incorrectly, Python tend to crash on startup (typically when loading incompatible ctypes). Fixes Azure#28004, Azure#29630, Azure#30517, Azure#30536, Azure#30594, Azure#30700, Azure#30792.
The scripts are installed in <base>/Scripts, but PYTHONPATH was set to <scripts>/src, although this directory doesn't even exist. I guess the deployment used to be in src, but this is no longer the case. Setting PYTHONPATH is done to avoid conflicts with other installations of Python on the same machine. When it is set incorrectly Python tends to crash on startup (typically when loading incompatible ctypes). Fixes Azure#28004, Azure#29630, Azure#30517, Azure#30536, Azure#30594, Azure#30700, Azure#30792.
Dup of #29630. Proposed fix: |
The scripts are installed in <base>/Scripts, but PYTHONPATH was set to <scripts>/src, although this directory doesn't even exist. I guess the deployment used to be in src, but this is no longer the case. Setting PYTHONPATH is done to avoid conflicts with other installations of Python on the same machine. When it is set incorrectly Python tends to crash on startup (typically when loading incompatible ctypes). Fixes Azure#28004, Azure#29630, Azure#30517, Azure#30536, Azure#30594, Azure#30700, Azure#30792.
Setting PYTHONPATH is done to avoid conflicts with other installations of Python on the same machine. When it is set incorrectly Python tends to crash on startup (typically when loading incompatible ctypes). There were old scripts in <base>/Scripts, which set PYTHONPATH so that Python prefers the bundled libs over the system ones. The problem with these scripts is that they set the wrong path. But these scripts no longer seem to be used. They were replaced by new ones in wbin. The problem with those is that PYTHONPATH was not set at all in them. Update the scripts to set PYTHONPATH correctly, both for bash and cmd. Fixes Azure#28004, Azure#29630, Azure#30517, Azure#30536, Azure#30594, Azure#30700, Azure#30792.
Setting PYTHONPATH is done to avoid conflicts with other installations of Python on the same machine. When it is set incorrectly Python tends to crash on startup (typically when loading incompatible ctypes). There were old scripts in <base>/Scripts, which set PYTHONPATH so that Python prefers the bundled libs over the system ones. The problem with these scripts is that they set the wrong path. But these scripts no longer seem to be used. They were replaced by new ones in wbin. The problem with those is that PYTHONPATH was not set at all in them. Update the scripts to set PYTHONPATH correctly, both for bash and cmd. Fixes Azure#25067, Azure#28004, Azure#29630, Azure#30517, Azure#30536, Azure#30594, Azure#30700, Azure#30792.
Describe the bug
Just running python.exe makes it crash :(
Full backtrace:
Related command
az extension add --upgrade --name connectedk8s --debug
Errors
An error occurred. Pip failed with status code 3221225477. Use --debug for more information.
Issue script & Debug output
cli.azure.cli.core.extension.operations: Command '['F:\Temp\az-prev\python.exe', '-m', 'pip', 'install', '--target', 'C:\Users\orgads\.azure\cliextensions\connectedk8s', 'F:\Temp\tmpw2jpebcj\connectedk8s-1.10.5-py2.py3-none-any.whl', '-vv', '--disable-pip-version-check', '--no-cache-dir']' returned non-zero exit status 3221225477.
cli.azure.cli.core.extension.operations: Pip failed so deleting anything we might have installed at C:\Users\orgads.azure\cliextensions\connectedk8s
cli.azure.cli.core.extension.operations: An error occurred whilst updating.
cli.azure.cli.core.extension.operations: An error occurred. Pip failed with status code 3221225477. Use --debug for more information.
Expected behavior
python should work
Environment Summary
azure-cli 2.66.0 *
core 2.66.0 *
telemetry 1.1.0
Extensions:
account 0.2.5
connectedk8s 1.9.2
ssh 2.0.2
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Python location 'F:\Temp\az-prev\python.exe'
Extensions directory 'C:\Users\orgads.azure\cliextensions'
Python (Windows) 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]
Legal docs and information: aka.ms/AzureCliLegal
Additional context
No response
The text was updated successfully, but these errors were encountered: