Linuxdiagextension fails with the below error message

kumar kaushal 161 Reputation points
2021-04-13T23:52:13.363+00:00

I have created a cent OS 8.1 VM . When i try to enable diag settings on the Vm and save . I get the below error message .

Microsoft.Azure.Diagnostics.LinuxDiagnostic
Version
3. 0.131
Status
Transitioning
Status level
Info
Status message
[ExtensionOperationError] Non-zero exit code: 127, /var/lib/waagent/Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131/diagnostic.py -install [stdout] [stderr] /usr/bin/env: ‘python’: No such file or directory

I have installed yum install -y python2 . And also made use of the below command

sudo update-alternatives --remove-all python
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1

https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/diagnostics-linux

Now i see the extension provisioning failed . And in the extension.log i see the below

2021/04/13 23:42:40 [Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] Sleep 60 retry 1
2021/04/13 23:43:40 [Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] Run with timeout: rpm -qi policycoreutils-python; if [ ! $? == 0 ]; then yum install -y policycoreutils-python; fi
2021/04/13 23:43:42 [Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] Return None
2021/04/13 23:43:42 [Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] package policycoreutils-python is not installed
2021/04/13 23:43:42 Last metadata expiration check: 0:31:22 ago on Tue 13 Apr 2021 11:12:19 PM UTC.
2021/04/13 23:43:42 No match for argument: policycoreutils-python
2021/04/13 23:43:42 Error: Unable to find a match: policycoreutils-python
2021/04/13 23:43:42
2021/04/13 23:43:42 [Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] Sleep 60 retry 0
2021/04/13 23:44:43 ERROR:[Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] package policycoreutils-python is not installed
2021/04/13 23:44:43 ERROR:Last metadata expiration check: 0:31:22 ago on Tue 13 Apr 2021 11:12:19 PM UTC.
2021/04/13 23:44:43 ERROR:No match for argument: policycoreutils-python
2021/04/13 23:44:43 ERROR:Error: Unable to find a match: policycoreutils-python
2021/04/13 23:44:43 ERROR:
2021/04/13 23:44:43 ERROR:[Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] Failed to set up mdsd dependencies: package policycoreutils-python is not installed
2021/04/13 23:44:43 ERROR:Last metadata expiration check: 0:31:22 ago on Tue 13 Apr 2021 11:12:19 PM UTC.
2021/04/13 23:44:43 ERROR:No match for argument: policycoreutils-python
2021/04/13 23:44:43 ERROR:Error: Unable to find a match: policycoreutils-python
2021/04/13 23:44:43 ERROR:
2021/04/13 23:44:43 [Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] Enable,error,1,Failed to set up mdsd dependencies: package policycoreutils-python is not installed
2021/04/13 23:44:43 Last metadata expiration check: 0:31:22 ago on Tue 13 Apr 2021 11:12:19 PM UTC.
2021/04/13 23:44:43 No match for argument: policycoreutils-python
2021/04/13 23:44:43 Error: Unable to find a match: policycoreutils-python
2021/04/13 23:44:43
2021/04/13 23:44:43 [Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131] Enable,error,-1,Enabled failed

Need help as to how should i proceed further

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,601 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SRIJIT-BOSE-MSFT 4,271 Reputation points Microsoft Employee
    2021-04-15T15:24:03.023+00:00

    Hi @kumar kaushal ,

    This seems like an issue that has been going for some time. As I understand, the new release of LAD which will support python3 is expected in the summer of 2021. Ref: https://github.com/Azure/azure-linux-extensions/issues/1179#issuecomment-758635360

    Currently the only known workaround I've come across is by:

    disabling selinux (setenforce 0)
    create a fake RPM package via https://github.com/xsuchy/create-fake-rpm
    create a repo via createrepo containing the fake RPM package
    configure this repo in my yum configuration

    Ref: https://github.com/Azure/azure-linux-extensions/issues/1179#issuecomment-779302692

    No comments