Azure / Azure/azure-linux-extensions

Ubuntu 20.04 does not provide /usr/bin/env python

Open
#1,284 17 comments 17 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
333
Forks
278
Avg merge
2d 9h
Merged PRs (30d)
4

Description

Hi,

The latest version of the VM extension still try to call `/usr/bin/env python`; on Ubuntu 20.04 by default, and on the official azure images, there is no ̀python` alternatives

```
Error: Code="VMExtensionHandlerNonTransientError" Message="The handler for VM extension type 'Microsoft.Azure.Diagnostics.LinuxDiagnostic' has reported terminal failure for VM extension 'bastion-run-bdu1-euw-dev-vm-linux-diagnostics' with error message: '[ExtensionOperationError] Non-zero exit code: 127, /var/lib/waagent/Microsoft.Azure.Diagnostics.LinuxDiagnostic-3.0.131/diagnostic.py -install\n[stdout]\n\n\n[stderr]\nRunning scope as unit: Microsoft.Azure.Diagnostics.LinuxDiagnostic_3.0.131_e79c79ae-31f1-4d0e-a752-eec0cfcecd4c.scope\n/usr/bin/env: ‘python’: No such file or directory\n'.\r\n \r\n'Install handler failed for the extension. More information on troubleshooting is available at https://aka.ms/VMExtensionLinuxDiagnosticsTroubleshoot'"
```

If we really want /usr/bin/env python have to
```
apt -y install python2-minimal
/usr/bin/update-alternatives --install /usr/bin/python python /usr/bin/python2 1
/usr/bin/update-alternatives --install /usr/bin/python python /usr/bin/python3 2
/usr/bin/update-alternatives --set python /usr/bin/python2
```

Best regards,

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.