Failed to enable Livepatch: failed to read machine-id

Asked by ANUPAM MITRA on 2020-09-22

Livepatch couldn't be enabled with the reason "failed to read machine-id". How to remove the impasse?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

What is the output of:

lsb_release -a; uname -a

Thanks

Revision history for this message
ANUPAM MITRA (anupammitra) said :
#2

Thanks. The output is as under.

anupam@anupam-ubuntu:~$ lsb_release -a; uname -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Release: 20.04
Codename: focal
Linux anupam-ubuntu 5.4.0-48-generic #52-Ubuntu SMP Thu Sep 10 10:58:49 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

There is a section giving your error......

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

The error message "failed to read machine-id" is slightly different from "this machine ID is already enabled with a different key or is non-unique"

But the proposed solution should help also in this case.

Revision history for this message
ANUPAM MITRA (anupammitra) said :
#7

Inadvertently I pressed the SOLVED button which I sincerely regret. But I do not know how to set it right under this situation. However, I tried all the commands, but terminal is still open since last half-an-hours. Did I commit any mistake this time?

Revision history for this message
Manfred Hampl (m-hampl) said :
#8

Which command was the last one that you started in the terminal (and which seems to be still running)?

Revision history for this message
ANUPAM MITRA (anupammitra) said :
#9

I'm giving below the outcome of the Terminal.

systemd-machine-id-setup
> Initializing machine ID from D-Bus machine ID
cat /etc/machine-id

Revision history for this message
Manfred Hampl (m-hampl) said :
#10

Is there a prompt visible in the terminal at the beginning of the last line (something like "anup@anup-pc:~$")?

Revision history for this message
ANUPAM MITRA (anupammitra) said :
#11

No, nothing like that.

Revision history for this message
Manfred Hampl (m-hampl) said :
#12

How did you start the terminal?

What happens if you abort the running commands and the terminal and try again?

Revision history for this message
ANUPAM MITRA (anupammitra) said :
#13

cp /etc/machine-id /etc/machine-id.original
cp: cannot stat '/etc/machine-id': No such file or directory

cp /var/lib/dbus/machine-id /var/lib/dbus/machine-id.original
cp: cannot stat '/var/lib/dbus/machine-id': No such file or directory

After giving third command, i.e. "nano /etc/machine-id new" (without quote) new window opened in Terminal. At top "GNU nano 4.8" and in the middle "/etc/machine-id" could be seen.

If I put fourth command "systemd-machine-id-setup" in the Terminal, then "Modified" comes at the top right hand side.

I aborted and closed the Terminal. I again tried with those commands but result is same, as narrated above. If I preferred to close the Terminal at this stage, warning message is popping up with "There is still a process running in this terminal. Closing the terminal will kill it.

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#14

You are using the wrong commands.

open a terminal

issue the command

systemd-machine-id-setup

wait for a response and a new command prompt

issue the command

cat /etc/machine-id

What happens?

Revision history for this message
ANUPAM MITRA (anupammitra) said :
#15

Thanks for your continuous support. The outcome is as under.

anupam@anupam-ubuntu:~$ systemd-machine-id-setup
Cannot open /etc/machine-id: No such file or directory
anupam@anupam-ubuntu:~$ cat /etc/machine-id
cat: /etc/machine-id: No such file or directory
anupam@anupam-ubuntu:~$

Revision history for this message
Manfred Hampl (m-hampl) said :
#16

Then try the commands

sudo touch /etc/machine-id
sudo systemd-machine-id-setup
cat /etc/machine-id

and report the results

Revision history for this message
ANUPAM MITRA (anupammitra) said :
#17

Thanks a lot Manfred Hampl. This time everything is okay. Livepatch recognised the machine id and now it is working as usual. However, the outcome is as under.

anupam@anupam-ubuntu:~$ sudo touch /etc/machine-id
[sudo] password for anupam:
anupam@anupam-ubuntu:~$ sudo systemd-machine-id-setup
Initializing machine ID from random generator.
anupam@anupam-ubuntu:~$ cat /etc/machine-id
cdc198640b69403c9ba063e6f3cd7246
anupam@anupam-ubuntu:~$

Thanks again.

Revision history for this message
ANUPAM MITRA (anupammitra) said :
#18

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Md Rahatul Islam (rahat-th3at0nic) said :
#20

Thank you so much Manfred Hampl... It solved my problem too.. take love..

Revision history for this message
leeh (backey) said :
#21

Thanks Manfred Hampl