apt related unit test errors in artful, bionic

Bug #1736576 reported by Andreas Hasenack
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Landscape Client
Fix Released
Medium
Simon Poirier
landscape-client (Ubuntu)
Fix Released
Medium
Andreas Hasenack
Bionic
Fix Released
Medium
Andreas Hasenack

Bug Description

[Impact]

 * This bug is a regression in landscape-client, caused by
   apt sources being now verified by apt-secure unless explicitly
   excluded. This effectively breaks landscape package profiles,
   which uses temporary file-local (file://path) source list entry
   containing the package policy for that client.
 * This backported fix adds the "trusted" option to temporary
   file-local sources created by landscape, in order to skip
   the apt-secure validation only on those. This was previously
   the behaviour prior to yakkety.

[Test Case]

Test scenario
 * Register a client with landscape.
 * Create a package profile and associate it with the client.
 * Check the profile is applied successfully.

Additionally, test failures of the exercised code were fixed as part of
this change in landscape.package.tests.test_facade/test_changer.

[Regression Potential]

* There is no regression anticipated, the functionality using this code path
  is already non-functional.
* The affected code is only used as part of package profiles application,
  and the option is strictly for a single "file://" source, it should be
  fairly safe to change.

[Other Info]

 * Upstream commit: https://github.com/CanonicalLtd/landscape-client/commit/d640643a15414b0d8e4330179e11d5a6036a6e42

[Original Description]

I'm seeing several unit test errors in zesty, artful and bionic.

The list:
a) landscape.package.tests.test_changer.AptPackageChangerTest
all of the type:
"landscape.package.facade.ChannelError: Apt failed to reload channels ([{'distribution': './', 'type': 'deb', 'baseurl': 'file:///tmp/tmpd_58Jb', 'components': ''}])
"

b) landscape.package.tests.test_facade.AptFacadeTest
landscape.package.facade.ChannelError: Apt failed to reload channels ([{'distribution': './', 'type': 'deb', 'baseurl': 'file:///tmp/tmproQ91z', 'components': ''}])

c) landscape.package.tests.test_changer.AptPackageChangerTest
landscape.package.facade.ChannelError: Apt failed to reload channels ([{'distribution': './', 'type': 'deb', 'baseurl': 'file:///tmp/tmpLhCd_i', 'components': ''}])

d) landscape.package.tests.test_reporter.PackageReporterAptTest
landscape.package.facade.ChannelError: Apt failed to reload channels ([{'distribution': './', 'type': 'deb', 'baseurl': 'file:///tmp/tmpaHngJ2', 'components': ''}])

e) landscape.package.tests.test_skeleton.SkeletonAptTest
apt.cache.FetchFailedException: E:The repository 'file:/tmp/tmpLVhCZR ./ Release' does not have a Release file.

This was using 16.03 plus the patch from https://bugs.launchpad.net/ubuntu/+source/landscape-client/+bug/1699179

Tags: patch
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This also happens with current HEAD from github (I used c679f31be0d4b9323d1d10aac0f66c8b0a009ece)

Changed in landscape-client:
milestone: none → 18.01
Changed in landscape-client (Ubuntu):
importance: Undecided → Medium
Changed in landscape-client:
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in landscape-client (Ubuntu):
status: New → Confirmed
Revision history for this message
Simon Poirier (simpoir) wrote :
Changed in landscape-client:
status: New → In Progress
assignee: nobody → Simon Poirier (simpoir)
Simon Poirier (simpoir)
Changed in landscape-client:
status: In Progress → Fix Committed
Eric Desrochers (slashd)
summary: - apt related unit test errors in zesty, artful, bionic
+ apt related unit test errors in artful, bionic
Changed in landscape-client (Ubuntu Bionic):
assignee: nobody → Simon Poirier (simpoir)
Changed in landscape-client (Ubuntu Artful):
assignee: nobody → Simon Poirier (simpoir)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "artful.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Simon Poirier (simpoir) wrote :
Revision history for this message
Simon Poirier (simpoir) wrote :
Simon Poirier (simpoir)
description: updated
Changed in landscape-client (Ubuntu Bionic):
assignee: Simon Poirier (simpoir) → Andreas Hasenack (ahasenack)
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.9 KiB)

This bug was fixed in the package landscape-client - 18.01-0ubuntu1

---------------
landscape-client (18.01-0ubuntu1) bionic; urgency=medium

  * New upstream release 18.01:
    - Ported to python3 (LP: #1577850)
    - move Replaces/Breaks landscape-client-ui rules to landscape-common
      (LP: #1560424)
    - Add a libpam-systemd Depends if built for xenial (LP: #1590838)
    - Some units not reporting swift usage (LP: #1588404)
    - Fix missing install directories for landscape-common and drop
      usr/share/landscape as its only used and created by landscape-client.
      (LP: #1680842)
    - Fix VM detection for Xen, by returning "xen" only for paravirtualized and
      HVM hosts, not for dom0. (LP: #1601818)
    - Add an indication of truncation to process output that has been truncated
      prior to delivery to the server. (LP: #1629000)
    - add /snap/bin to the PATH when executing scripts. (LP: #1635634)
    - Save the original sources.list file when a repository profile is
      associated with a computer and restore it when the profile is removed.
      (LP: #1607529)
    - Drop the legacy HAService plugin, which is no longer used.
    - Avoid double-decoding package descriptions in build_skeleton_apt, which
      causes an error with Xenial python-apt. (LP: #1655395)
    - Remove dead dbus code and textmessage (confirmed not supported in server
      for ~2 years). (LP: #1657372)
    - Move bzr-builddeb conf file from deprecated location to debian/
      (LP: #1658796)
    - Support for new server error message about there being too many pending
      computers already (LP: #1662530)
    - Add a timestamp to the package reporter result (LP: #1674252)
    - Check if ubuntu-release-upgrader is running before apt-update (LP: #1699179)
    - Implicitly trust file-local sources managed by landscape. On upgrades,
      add the trusted flag to the landscape file-local apt source file if it's
      not there. (LP: #1736576)
    - Use local system tools to change the user's password (LP: #1743558)
  * clean up packaging and getting in sync with the new landscape version:
    - d/rules: drop extra:suggests which is unused since 13.07.1-0ubuntu2
    - Remove antique postinst code. No supported landscape-client version
      installs cronjobs anymore (since a long time).
    - d/landscape-client.docs: the README file is now a markdown file, so
      install that instead.
    - d/landscape-common.postinst: no need to single out
      /var/lib/landscape/.gnupg when fixing ownerships, just do it over
      the entire parent directory.
    - guard user and group removal via an empty .cleanup.* file in post, so we
      only remove the user/group if we were the ones who created them at
      install time.
    - lintian: remove absolute path from update-motd calls in maintainer
      scripts
    - d/rules: drop special handling for dapper, hardy and lucid, which are no
      longer supported.
    - d/rules: make sure we have an "extra:Depends=" in substvars even if it's
      empty
    - d/rules: drop dh_pycentral handling, it's obsolete
  * Dropped (already included in this version):
    - d/p/set-vm-info-to-kvm-for-aws-C5-instances.patch:
  ...

Read more...

Changed in landscape-client (Ubuntu Bionic):
status: In Progress → Fix Released
Changed in landscape-client:
status: Fix Committed → Fix Released
David Britton (dpb)
no longer affects: landscape-client (Ubuntu Artful)
Revision history for this message
Damiön la Bagh (kat-amsterdam) wrote :

This is still broken in Bionic with landscape-client
The proposed patch does not work.

landscape-client:
  Geïnstalleerd: 18.01-0ubuntu3.1
  Kandidaat: 18.01-0ubuntu3.1
  Versietabel:
 *** 18.01-0ubuntu3.1 500
        500 http://nl.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     18.01-0ubuntu3 500
        500 http://nl.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/twisted/internet/defer.py", line 653, in _runCallbacks
    current.result = callback(current.result, *args, **kw)
  File "/usr/lib/python3/dist-packages/landscape/client/package/reporter.py", line 95, in <lambda>
    result.addCallback(lambda x: self.detect_changes())
  File "/usr/lib/python3/dist-packages/landscape/client/package/reporter.py", line 543, in detect_changes
    deferred = self.detect_packages_changes()
  File "/usr/lib/python3/dist-packages/landscape/client/package/reporter.py", line 551, in detect_packages_changes
    if self._got_task or self._package_state_has_changed():
  File "/usr/lib/python3/dist-packages/landscape/client/package/reporter.py", line 577, in _package_state_has_changed
    last_changed = os.stat(f).st_mtime
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/apt/lists/_var_lib_landscape_client_package_binaries_._Packages'

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.