← Back to team overview

group.of.nepali.translators team mailing list archive

[Bug 1701325] Re: attempt to read dmi data can cause warning and stacktrace in logs in a container.

 

This bug is believed to be fixed in cloud-init in 17.1. If this is still
a problem for you, please make a comment and set the state back to New

Thank you.

** Changed in: cloud-init
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of नेपाली
भाषा समायोजकहरुको समूह, which is subscribed to Xenial.
Matching subscriptions: Ubuntu 16.04 Bugs
https://bugs.launchpad.net/bugs/1701325

Title:
  attempt to read dmi data can cause warning and stacktrace in logs in a
  container.

Status in cloud-init:
  Fix Released
Status in cloud-init package in Ubuntu:
  Fix Released
Status in cloud-init source package in Xenial:
  Fix Released
Status in cloud-init source package in Zesty:
  Fix Released

Bug description:
  === Begin SRU Template ===
  [Impact]
  lxc containers would show warnings in /var/log/cloud-init.log.
  This was because attempts were made to read dmi information from
  inside the (unpriviledged) container.  Such attempts to read
  dmi data like /sys/class/dmi/id/product_serial would then result
  in an attempt to run dmidecode which would also fail.

  [Test Case]
  To test this, simply
  a.) create an lxd instance from a image with -proposed version of cloud-init
     $ release=xenial
     $ ref=$release-1701325
     $ lxc-proposed-snapshot --proposed --publish $release $ref
     $ lxc launch $ref $name
  b.) lxc exec $name -- grep WARN /var/log/cloud-init.log

  [Regression Potential]
  A regression caused by this change is possible on some system where
  systemd identified the system as a container but the container platform provided
  simulated/virtualized dmi information in /sys/class/dmi/id.

  The check for for container is done with:
    systemd-detect-virt --quite --container

  [Other Info]
  Upstream commit at
    https://git.launchpad.net/cloud-init/commit/?id=4d9f24f5c3

  This was actually a regression of the upstream fix for bug 1691772.
  That never entered a stable Ubuntu release.  The testing here is
  actually a test against regression.
  The upstream commit for that change is at
    https://git.launchpad.net/cloud-init/commit/?id=802e7cb2da

  lxc-proposed-snapshot is
    https://git.launchpad.net/~smoser/cloud-init/+git/sru-info/tree/bin/lxc-proposed-snapshot
  It publishes an image to lxd with proposed enabled and cloud-init upgraded.
  === End SRU Template ===

  
  I launched an instance of artful.
  Looked in /var/log/cloud-init.log and saw:
  2017-06-29 16:00:15,222 - util.py[DEBUG]: Reading from /sys/class/dmi/id/product_serial (quiet=False)
  2017-06-29 16:00:15,222 - util.py[WARNING]: failed read of /sys/class/dmi/id/product_serial
  2017-06-29 16:00:15,223 - util.py[DEBUG]: failed read of /sys/class/dmi/id/product_serial
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2359, in _read_dmi_syspath
      key_data = load_file(dmi_key_path, decode=False)
    File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1283, in load_file
      with open(fname, 'rb') as ifh:
  PermissionError: [Errno 13] Permission denied: '/sys/class/dmi/id/product_serial'
  2017-06-29 16:00:15,225 - util.py[DEBUG]: Running command ['/usr/sbin/dmidecode', '--string', 'system-serial-number'] with allowed return codes [0] (shell=False, capture=True)
  2017-06-29 16:00:15,228 - util.py[DEBUG]: failed dmidecode cmd: ['/usr/sbin/dmidecode', '--string', 'system-serial-number']
  Unexpected error while running command.
  Command: ['/usr/sbin/dmidecode', '--string', 'system-serial-number']
  Exit code: 1
  Reason: -
  Stdout: -
  Stderr: /sys/firmware/dmi/tables/smbios_entry_point: Permission denied
          /dev/mem: No such file or directory

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: cloud-init 0.7.9-197-gebc9ecbc-0ubuntu1
  ProcVersionSignature: Ubuntu 4.10.0-22.24-generic 4.10.15
  Uname: Linux 4.10.0-22-generic x86_64
  ApportVersion: 2.20.5-0ubuntu5
  Architecture: amd64
  Date: Thu Jun 29 16:47:51 2017
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   LANG=C.UTF-8
  SourcePackage: cloud-init
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1701325/+subscriptions