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

Python 3.12 support missing #1908

Open
xordux opened this issue Apr 2, 2024 · 3 comments
Open

Python 3.12 support missing #1908

xordux opened this issue Apr 2, 2024 · 3 comments

Comments

@xordux
Copy link

xordux commented Apr 2, 2024

When I try to install AzureMonitorAgent, I get following error:

PS C:\Users\rohitrawat> az vm extension set --name AzureMonitorLinuxAgent --publisher Microsoft.Azure.Monitor --ids "/subscriptions/80248fc1-bf75-48f2-b344-23988088df3f/resourceGroups/lisa-On-Demand-test-20240402-110548-746-e0/providers/Microsoft.Compute/virtualMachines/lisa-On-Demand-test-20240402-110548-746-e0-n0" --enable-auto-upgrade true
(VMExtensionHandlerNonTransientError) The handler for VM extension type 'Microsoft.Azure.Monitor.AzureMonitorLinuxAgent' has reported terminal failure for VM extension 'AzureMonitorLinuxAgent' with error message: '[ExtensionOperationError] Non-zero exit code: 51, /var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.30.3/./shim.sh -install
[stdout]
Python 3.12.0
Importing utils failed with error: No module named 'imp'
Unable to initialize waagent log because of exception name 'waagent' is not defined
Info: Azure Monitoring Agent for Linux started to handle.
Error: Unsupported operating system: azurelinux 3.0
Error: Unsupported operating system: azurelinux 3.0


[stderr]
/var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.30.3/./agent.py:38: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
  import crypt
'.

'Install handler failed for the extension. More information on troubleshooting is available at https://aka.ms/vmextensionlinuxtroubleshoot'
Code: VMExtensionHandlerNonTransientError
Message: The handler for VM extension type 'Microsoft.Azure.Monitor.AzureMonitorLinuxAgent' has reported terminal failure for VM extension 'AzureMonitorLinuxAgent' with error message: '[ExtensionOperationError] Non-zero exit code: 51, /var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.30.3/./shim.sh -install
[stdout]
Python 3.12.0
Importing utils failed with error: No module named 'imp'
Unable to initialize waagent log because of exception name 'waagent' is not defined
Info: Azure Monitoring Agent for Linux started to handle.
Error: Unsupported operating system: azurelinux 3.0
Error: Unsupported operating system: azurelinux 3.0


[stderr]
/var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.30.3/./agent.py:38: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
  import crypt
'.

'Install handler failed for the extension. More information on troubleshooting is available at https://aka.ms/vmextensionlinuxtroubleshoot'

The OS has Python 3.12 and this seems to be issue with imp module being removed in python 3.12 [link]

I am facing same issue with other extension LinuxDiagnostic

@aadhar-agarwal
Copy link

aadhar-agarwal commented May 23, 2024

Hi @NarineM, I see you made #1904. Could you please help take a look at the PR again? :)

imp has been deprecated in Python 3.12

@eric-desrochers
Copy link

Any update on this bug ?

@JohnRusk
Copy link
Member

I believe the pattern of dynamically loading wwagent is probably considered obsolete. I logged some details here #1956

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants