canonical / ubuntu-pro-client

Ubuntu Pro Client for offerings from Canonical
https://canonical-ubuntu-pro-client.readthedocs-hosted.com/en/latest/
GNU General Public License v3.0
52 stars 69 forks source link

Bug: esm-cache.service warnings about directory structure #3060

Closed orndorffgrant closed 2 months ago

orndorffgrant commented 3 months ago

Description of the bug

esm-cache.service warnings about directory structure

Expected behavior

esm-cache.service shouldn't log any warnings that are avoidable. We should create the full directory structure that apt expects to see.

Current behavior

The following logs from esm-cache.service

Apr 12 14:25:48 n-pro systemd[1]: Starting esm-cache.service - Update the local ESM caches...
Apr 12 14:25:48 n-pro python3[14196]: /usr/lib/python3/dist-packages/uaclient/apt.py:297: Warning: W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
Apr 12 14:25:48 n-pro python3[14196]:   apt_pkg.init()
Apr 12 14:25:48 n-pro python3[14196]: /usr/lib/python3/dist-packages/uaclient/apt.py:898: Warning: W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/preferences.d/ - DirectoryExists (2: No such file or directory)
Apr 12 14:25:48 n-pro python3[14196]:   sources_list.read_main_list()
Apr 12 14:25:48 n-pro systemd[1]: esm-cache.service: Deactivated successfully.
Apr 12 14:25:48 n-pro systemd[1]: Finished esm-cache.service - Update the local ESM caches

To Reproduce

Please include details on how to reproduce the bug.

  1. Launch a VM/Container
  2. Run apt update
  3. journalctl -u esm-cache.service

System information:

dbsavage commented 2 months ago

This exact bug occurs when running the command _pro _security-status__ should it be reported in a different bug, or is here sufficient?

To Reproduce Please include details on how to reproduce the bug.

  1. launch terminal
  2. run sudo pro security-status

System information:

  1. Ubuntu release: noble
  2. Pro Client version: 31.2.3

the output of this command starts with: sudo pro security-status _/usr/lib/python3/dist-packages/uaclient/apt.py:288: Warning: W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory) apt_pkg.init() /usr/lib/python3/dist-packages/uaclient/apt.py:270: Warning: W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/preferences.d/ - DirectoryExists (2: No such file or directory) apt_pkg.initsystem()

then ends with the normal output of the command.

orndorffgrant commented 2 months ago

Thanks for the additional information @dbsavage! This comment is sufficient. It is the same bug and should be fixed by a commit in #2858 to be released in May.