question

kumarkaushal-1277 avatar image
0 Votes"
kumarkaushal-1277 asked srbose-msft answered

Linuxdiagextension fails with the below error message

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://docs.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-machinesazure-virtual-machines-extension
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

srbose-msft avatar image
0 Votes"
srbose-msft answered

Hi @kumarkaushal-1277,

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.