question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

agent.py - The VM doesn't have systemctl - Ubuntu 20.04

See original GitHub issue

Still can’t update on Ubuntu 20.04. Can you please fix this. The system obviously does have systemctl. Also maybe run some automated build tests on each operating system you say you support please. Only change to this Azure Ubuntu 20.04 image is we ran “apt install python-is-python2” to get it to install initially. Below is the result of the update agent command run from Azure Monitor:

2021-10-06 19:36:46,416 - root - INFO - vmGuestHealthAgent write_status_json_and_exit() started for  : Install
2021-10-06 19:36:46,416 - root - INFO - vmGuestHealthAgent write_status_json_and_exit() succeeded for  : Install
2021-10-06 22:13:06,862 - root - INFO - FileLogger initialized successfully, logging will be at /var/log/azure/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent/vmGuestHealthAgent.log
2021-10-06 22:13:06,862 - root - INFO - ---start of dumping the buffer of logs that were printed prior to /var/log/azure/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent/vmGuestHealthAgent.log creation----
2021-10-06 22:13:06,863 - root - INFO - 2021-10-06 22:13:06: INFO: Successfully created ConsoleLogger
2021-10-06 22:13:06,863 - root - INFO - 2021-10-06 22:13:06: INFO: Starting to parse the HandlerEnvironment
2021-10-06 22:13:06,863 - root - INFO - 2021-10-06 22:13:06: INFO: Successfully parsed the HandlerEnvironment, got the following log_path : /var/log/azure/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent
2021-10-06 22:13:06,863 - root - INFO - ---end of dumping the buffer of logs that were printed prior to /var/log/azure/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent/vmGuestHealthAgent.log creation----
2021-10-06 22:13:06,868 - root - ERROR - The VM doesn't have systemctl
2021-10-06 22:13:06,870 - root - ERROR - Unsupported Operating System. OS distribution: Ubuntu OS Version: 20.04
For details, check logs in /var/log/vmGuestHealthAgent.log

Azure deployment log if you’re interested:

{
    "status": "Failed",
    "error": {
        "code": "DeploymentFailed",
        "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.",
        "details": [
            {
                "code": "Conflict",
                "message": "{\r\n  \"status\": \"Failed\",\r\n  \"error\": {\r\n    \"code\": \"ResourceDeploymentFailure\",\r\n    \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n    \"details\": [\r\n      {\r\n        \"code\": \"VMExtensionHandlerNonTransientError\",\r\n        \"message\": \"The handler for VM extension type 'Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent' has reported terminal failure for VM extension 'GuestHealthLinuxAgent' with error message: '[ExtensionOperationError] Non-zero exit code: 178, /var/lib/waagent/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent-1.0.41/./scripts/install.py\\n[stdout]\\nInitializing Logger in logger.py\\n2021-10-07 22:18:33: INFO: Successfully created ConsoleLogger\\n2021-10-07 22:18:33: INFO: Starting to parse the HandlerEnvironment\\n2021-10-07 22:18:33: INFO: Successfully parsed the HandlerEnvironment, got the following log_path : /var/log/azure/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent\\n2021-10-07 22:18:33: INFO: Logging will continue at /var/log/azure/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent/vmGuestHealthAgent.log\\n\\n\\n[stderr]\\nRunning scope as unit: Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent_1.0.41_[REDACTED].scope\\n'.\\r\\n    \\r\\n'Install handler failed for the extension. More information on troubleshooting is available at https://aka.ms/vmextensionlinuxtroubleshoot'\"\r\n      }\r\n    ]\r\n  }\r\n}"
            }
        ]
    }
}

Output of pidof command run manually:

root@[REDACTED]:/var/lib/waagent/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent-1.0.41/scripts# pidof systemd
627878

Also see related issue regarding Unsupported Operating System and missing Ubuntu 20 in constants.py: #1444

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
celeroncoolcommented, Feb 8, 2022

Hello,

Another victim of this bug, running;

  • Operating system: Linux (ubuntu 20.04)
  • Publisher: canonical
  • Offer: 0001-com-ubuntu-pro-focal
  • Plan: pro-20_04-lts-gen2
  • VM generation: V2

This bug will cause error on upgrading VM monitoring on all of our 20.04LTS VM’s.

{
    "status": "Failed",
    "error": {
        "code": "VMExtensionHandlerNonTransientError",
        "message": "The handler for VM extension type Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent' has reported terminal failure for VM extension 'GuestHealthLinuxAgent' with error message: '[ExtensionOperationError] Non-zero exit code: 178, /var/lib/waagent/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent-1.0.54/./scripts/install.py\n[stdout]\nInitializing Logger in logger.py\n2022-02-08 13:20:51: INFO: Successfully created ConsoleLogger\n2022-02-08 13:20:51: INFO: Starting to parse the HandlerEnvironment\n2022-02-08 13:20:51: INFO: Successfully parsed the HandlerEnvironment, got the following log_path : /var/log/azure/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent\n2022-02-08 13:20:51: INFO: Logging will continue at /var/log/azure/Microsoft.Azure.Monitor.VirtualMachines.GuestHealth.GuestHealthLinuxAgent/vmGuestHealthAgent.log\n\n\n[stderr]\nRunning scope as unit: install_760211a7-6602-4559-b55b-d492d1ec85b4.scope\n'.\r\n    \r\n'Install handler failed for the extension. More information on troubleshooting is available at https://aka.ms/vmextensionlinuxtroubleshoot'"
    }
}
0reactions
geraldfehringercommented, Mar 29, 2022

Still the same here on Ubuntu Server TLS 20.04 - cant be that difficult!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot the Azure Linux Agent - Virtual Machines
Before you begin. Check the agent status and version to make sure it is still supported. See Minimum version support for virtual machine...
Read more >
System has not been booted with systemd as init system (PID ...
Your release of WSL doesn't support Systemd. In this case, there are multiple workarounds available. See the Alternatives to Systemd in WSL ...
Read more >
[Fixed] "System has not been booted with systemd as init ...
Learn how to fix "System has not been booted with systemd as init system (PID 1). Can't operate." with Ubuntu Linux on WSL....
Read more >
Managing the Jenkins systemd Service on Ubuntu 20.04
Information referenced in this video:Managing the Jenkins systemd Service on CentOS 7.9https://youtu.be/MkokjTQ2ngc🗞️ Managing systemd ...
Read more >
How to Set Up SSH Keys on Ubuntu 20.04 - DigitalOcean
Generating public/private rsa key pair. · /home/ your_home /. · Enter passphrase (empty for no passphrase): · Your identification has been saved in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found