Azure / azure-linux-extensions

Linux Virtual Machine Extensions for Azure
Apache License 2.0
309 stars 255 forks source link

Azure Monitor Agent does not support Ubuntu 24.04 #1935

Open jantekb opened 4 months ago

jantekb commented 4 months ago

When installed on a vanilla Ubuntu 24.04 image, the deployment fails with the below error:

[ExtensionOperationError] Non-zero exit code: 51, /var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.31.1/./shim.sh -install [stdout] Python 3.12.3 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: ubuntu 24.04 Error: Unsupported operating system: ubuntu 24.04 [stderr] /var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.31.1/./agent.py:38: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13 import crypt

hAislt commented 4 months ago

Same here. What about those versions below? I also tried with those through TF but they are not listed in MS docs and it didn't work.

az vm extension image list-versions --publisher Microsoft.Azure.Monitor --name AzureMonitorLinuxAgent --location "EastUs"

"id": "/Subscriptions/x/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor/ArtifactTypes/VMExtension/Types/AzureMonitorLinuxAgent/Versions/1.31.1",
    "location": "eastus",
    "name": "1.31.1"
  },
  {
    "id": "/Subscriptions/x/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor/ArtifactTypes/VMExtension/Types/AzureMonitorLinuxAgent/Versions/1.5.126",
    "location": "eastus",
    "name": "1.5.126"
  },
  {
    "id": "/Subscriptions/x/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor/ArtifactTypes/VMExtension/Types/AzureMonitorLinuxAgent/Versions/1.5.127",
    "location": "eastus",
    "name": "1.5.127"
  },
  {
    "id": "/Subscriptions/x/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor/ArtifactTypes/VMExtension/Types/AzureMonitorLinuxAgent/Versions/1.5.133",
    "location": "eastus",
    "name": "1.5.133"
  },
  {
    "id": "/Subscriptions/x/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor/ArtifactTypes/VMExtension/Types/AzureMonitorLinuxAgent/Versions/1.6.2",
    "location": "eastus",
    "name": "1.6.2"
  },
  {
    "id": "/Subscriptions/x/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor/ArtifactTypes/VMExtension/Types/AzureMonitorLinuxAgent/Versions/1.7.0",
    "location": "eastus",
    "name": "1.7.0"
  },
  {
    "id": "/Subscriptions/x/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor/ArtifactTypes/VMExtension/Types/AzureMonitorLinuxAgent/Versions/1.7.1",
    "location": "eastus",
    "name": "1.7.1"
  },
  {
    "id": "/Subscriptions/x/Providers/Microsoft.Compute/Locations/eastus/Publishers/Microsoft.Azure.Monitor/ArtifactTypes/VMExtension/Types/AzureMonitorLinuxAgent/Versions/1.9.1",
    "location": "eastus",
    "name": "1.9.1"
  }
]
zaubergulasch commented 4 months ago

Same here with pfsense / FreeBSD 15 (Azure Image)

[Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.31.1] Indeterminate operating system 2024/07/15 09:48:55 [Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.31.1] Install,failed,51,Indeterminate operating system Failed to check disk usage. [stderr] /var/lib/waagent/Microsoft.Azure.Monitor.AzureMonitorLinuxAgent-1.31.1/./agent.py:38: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13 import crypt

-_-

jungsooooo commented 4 months ago

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

TheKrisSodroski commented 3 months ago

I get a similar error, where it 's complaining about 'imp' not being found. Python 3.13 on the latest 24.04 ubuntu image.

Reverting back to this image allows it to install/provision:

"imageReference": {
          "publisher": "canonical",
          "offer": "0001-com-ubuntu-server-jammy",
          "sku": "22_04-lts-gen2",
          "version": "latest"
        },
eric-desrochers commented 3 months ago

Any update on this bug ? (For reference, it's a duplicate of https://github.com/Azure/azure-linux-extensions/issues/1908)

JohnRusk commented 3 months ago

I believe that the pattern of dynamically loading waagent is probably considered deprecated now. I logged some details here: #1956 1956

DavidGarrana commented 3 months ago

With the nearing Log Analytics Agent deprecation, more than never making AMA support stable versions of Linux should be priority. Ubuntu 24.04 LTS was officially released almost 4 months ago. Can we get a date here?

DavidGarrana commented 3 months ago

I managed to run the install script manually adding 24.04. The issue isn't just related to not recognizing 24.04, the way the extension wants to install is no longer supported by Python 3.12 onwards and has been on deprecation path for quite a while.https://docs.python.org/3.10/library/imp.html

Arc agent (azcmagent) for instance, install like a deb package since first release. And that's how all Python modules will be handled from now on.

If it were just a code edit, we would get it soon(er), but as it stands, we're looking at pretty much a redesign, sadly =/

Hoping to be wrong about that though. (crossed fingers)


De: fmcrr-admin @.> Enviado: sexta-feira, 23 de agosto de 2024 02:25 Para: Azure/azure-linux-extensions @.> Cc: David Garrana Coelho @.>; Manual @.> Assunto: Re: [Azure/azure-linux-extensions] Azure Monitor Agent does not support Ubuntu 24.04 (Issue #1935)

I got the defender agent to install just by changing 22.04 to 24.04 in the install script, installed fine and is working fine. I cant do that here since its all automated, with no manual way.

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-linux-extensions/issues/1935#issuecomment-2306316414, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A2OLA2P272RH2RQJ4VRYN2DZS3BTBAVCNFSM6AAAAABKRYTJEKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBWGMYTMNBRGQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

marcurdy commented 3 months ago

I've added a pull request to fix this. https://github.com/Azure/azure-linux-extensions/pull/1964 The python changes caused all the problems.

JohnRusk commented 3 months ago

@marcurdy I think the better long-term approach is to actually remove waagent and HandlerUtil rather than fix them. I noted some details here #1956. However, as a shorter-term solution, maybe the approach you suggest is better. I'm not sure.

marcurdy commented 3 months ago

I don't know the whole story on how it works without waagent nor the internal team's priority mission, but a short-term hotfix would be nice.

anpct commented 2 months ago

Hi Team, any update on this issue, azure supports creating VMs with the Ubuntu 24.04 image but has not way of installing the monitoring agent, I would be nice if we could get at least a temporary fix for this issue quickly

gilbahat commented 2 months ago

I've added a pull request to fix this. #1964 The python changes caused all the problems.

Hi @marcurdy it looks like MS won't look at your PR until you've signed their contributor license agreement once you do, maybe they'll merge it and we'll all be free of this...

SteveBurkettNZ commented 1 week ago

Just to move the conversation forward, looks like the September release of the AMA for Linux (1.33.1) added support for Ubuntu 24.04 LTS.

hAislt commented 6 days ago

Just to move the conversation forward, looks like the September release of the AMA for Linux (1.33.1) added support for Ubuntu 24.04 LTS.

are you sure? I tried that a few weeks ago when it was released and still did not work.