pop-os / pop

A project for managing all Pop!_OS sources
https://system76.com/pop
2.47k stars 87 forks source link

ua-messaging.service Service start fails due to `RuntimeError: Could not parse /etc/os-release VERSION: 21.04 (modified to 21.04)` #1884

Open fuomag9 opened 3 years ago

fuomag9 commented 3 years ago

Distribution (run cat /etc/os-release):


NAME="Pop!_OS"
VERSION="21.04"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 21.04"
VERSION_ID="21.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=hirsute
UBUNTU_CODENAME=hirsute
LOGO=distributor-logo-pop-os

Related Application and/or Package Version (run apt policy $PACKAGE NAME):

ubuntu-advantage-tools:
  Installed: 27.2.2~21.04.1
  Candidate: 27.2.2~21.04.1
  Version table:
 *** 27.2.2~21.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu hirsute-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     26.2 500
        500 http://us.archive.ubuntu.com/ubuntu hirsute/main amd64 Packages

Issue/Bug Description:

Service start fails due to RuntimeError: Could not parse /etc/os-release VERSION: 21.04 (modified to 21.04)

This is the journalctl stack trace

Aug 27 15:14:30 pop-os systemd[1]: Starting Ubuntu Advantage APT and MOTD Messages...
Aug 27 15:14:30 pop-os python3[47374]: Traceback (most recent call last):
Aug 27 15:14:30 pop-os python3[47374]:   File "/usr/lib/ubuntu-advantage/ua_update_messaging.py", line 371, in <module>
Aug 27 15:14:30 pop-os python3[47374]:     update_apt_and_motd_messages(cfg=cfg)
Aug 27 15:14:30 pop-os python3[47374]:   File "/usr/lib/ubuntu-advantage/ua_update_messaging.py", line 352, in update_apt_and_motd_>
Aug 27 15:14:30 pop-os python3[47374]:     series = util.get_platform_info()["series"]
Aug 27 15:14:30 pop-os python3[47374]:   File "/usr/lib/python3/dist-packages/uaclient/util.py", line 336, in get_platform_info
Aug 27 15:14:30 pop-os python3[47374]:     raise RuntimeError(
Aug 27 15:14:30 pop-os python3[47374]: RuntimeError: Could not parse /etc/os-release VERSION: 21.04 (modified to 21.04)
Aug 27 15:14:30 pop-os systemd[1]: ua-messaging.service: Main process exited, code=exited, status=1/FAILURE
Aug 27 15:14:30 pop-os systemd[1]: ua-messaging.service: Failed with result 'exit-code'.
Aug 27 15:14:30 pop-os systemd[1]: Failed to start Ubuntu Advantage APT and MOTD Messages.

Steps to reproduce (if you know):

Expected behavior:

service starts (and prints motd in the terminal?)

Other Notes:

jacobgkau commented 3 years ago

Ubuntu Advantage is a service offered by Canonical for Ubuntu; it does not apply to Pop!_OS. This service does not need to start. Instead, it should probably not be installed by default. There was some discussion about this in Mattermost (~development channel) here: https://chat.pop-os.org/pop-os/pl/z91bab34atru3pp7xcmm789hio

ubuntu-advantage-tools is the package that provides this service, and it's a dependency of ubuntu-minimal. Not having it installed would require either forking ubuntu-minimal to remove that dependency, or providing an empty ubuntu-advantage-tools package without the files for the service (which would probably be easier.)

On individual systems, sudo systemctl disable ua-messaging.timer should disable the timer that attempts to start this service, which should stop the log messages without having to uninstall the service.