3

A few hours ago my Canonical Livepatch stopped working. I searched for the solution and than decided to reinstall Canonical Livepatch. Now I am getting the following error:

Failed to enable Livepatch: cannot enable machine: cannot send request: 
  Post https://livepatch.canonical.com/api/machine-tokens: EOF

I could not find anything online about this problem so I'm posting. Thanks for your time.

1
  • Same here as well. error executing enable: cannot enable machine: bad server status 401 (URL: https://livepatch.canonical.com/api/machine-tokens) server response: unauthorized Commented Aug 28, 2020 at 19:31

1 Answer 1

2

After a while i was able to find a solution, so to speak. Well, sorta. Nevertheless, it works like a charm in my particular situation.

1) sudo canonical-livepatch disable
2) sudo snap remove canonical-livepatch
3) sudo cp /etc/machine-id /etc/machine-id.original
4) sudo cp /var/lib/dbus/machine-id /var/lib/dbus/machine-id.original
5) gedit /etc/machine-id 
(remove everything and save empty machine-id)
6) sudo systemd-machine-id-setup

reboot

7) sudo snap install canonical-livepatch

Now proceed to (https://auth.livepatch.canonical.com/) and obtain the token, then

8) sudo canonical-livepatch enable [your token]

Your livepatch should work from this point pretty stable and apply necessary updates.

Source: Canonical livepatch failed when I tried to enable token

7
  • I have tried your solution but it does not work in my case. This is what I have on my terminal after applying your solution: "canonical-livepatch 9.5.5 from Canonical✓ installed" and "Successfully enabled device. Using machine-token:xxxxxxxxxxxxxxxx" but also in Software & Updates there is: "Canonical Livepatch has experienced an internal error. Please refer to wiki.ubuntu.com/Kernel/Livepatch#CommonIssues for further information." and Lifepatch status in the top bar have red exclamation mark.
    – Mao Runzhi
    Commented Aug 30, 2020 at 13:47
  • Have you tried this one, for the instance? sudo canonical-livepatch refresh By the way, can you provide the output: sudo canonical-livepatch status --verbose, systemctl status snap.canonical-livepatch.canonical-livepatchd.service and grep livepatch /var/log/syslog (upload the results on pastebin.ubuntu.com) I myself have a little to no experience, but maybe i can work out something in the meantime. Commented Aug 30, 2020 at 20:51
  • I have tried refresh which gives me following output: sudo canonical-livepatch refresh checking for patches nothing to apply kernel: 5.4.0-42.46-generic patch state: ✗ the application caused a crash last time it was applied, check system logs with journalctl -f -t canonical-livepatch patch version: 70.3 xxx@xxx:~$ journalctl -f -t canonical-livepatch No journal files were found. Anyhow here is the output:"pastebin.ubuntu.com/p/3x8yRBBvcx" Thanks.
    – Mao Runzhi
    Commented Aug 30, 2020 at 22:01
  • canonical-livepatch[883]: System contains non-livepatch tainted modules. canonical-livepatch[883]: Module may have caused kernel crash! Not inserting module. canonical-livepatch[883]: To override this warning, remove /var/snap/canonical-livepatch/common/locks/livepatch_Ubuntu_5_4_0_42_46_generic_70_70.3 Considering this lines, i presume, that you'll need to do as follows: remove livepatch_Ubuntu_5_4_0_42_46_generic_70_70.3 file. I suggest you moving it or rename, just in case. Than reboot your pc. Commented Aug 31, 2020 at 0:10
  • Removed and changed name. Rebooted. Folder "/var/snap/canonical-livepatch/common/locks" is empty but after trying commands from your previous post i have same result as before:" Aug 31 10:10:23 tze canonical-livepatch[890]: during refresh: cannot apply patches: lock file "/var/snap/canonical-livepatch/common/locks/livepatch_Ubuntu_5_4_0_42_46_generic_70_70.3" already exists"
    – Mao Runzhi
    Commented Aug 31, 2020 at 8:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .