system-image-cli tool fails on dangling symlink

Bug #1495688 reported by Ben Howard on 2015-09-14
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snappy
Critical
Oliver Grawert
Ubuntu system image
High
Barry Warsaw
system-image (Ubuntu)
High
Unassigned

Bug Description

(amd64)ubuntu@localhost:~$ system-image-cli -i
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/systemimage/helpers.py", line 253, in last_update_date
    timestamp = datetime.fromtimestamp(os.stat(LAST_UPDATE_FILE).st_mtime)
FileNotFoundError: [Errno 2] No such file or directory: '/userdata/.last_update'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/system-image-cli", line 9, in <module>
    load_entry_point('system-image==3.0.1', 'console_scripts', 'system-image-cli')()
  File "/usr/lib/python3/dist-packages/systemimage/main.py", line 289, in main
    last_update=last_update_date(),
  File "/usr/lib/python3/dist-packages/systemimage/helpers.py", line 258, in last_update_date
    for path in config.ini_files)
  File "/usr/lib/python3/dist-packages/systemimage/helpers.py", line 258, in <genexpr>
    for path in config.ini_files)
  File "/usr/lib/python3.4/pathlib.py", line 1048, in stat
    return self._accessor.stat(self)
  File "/usr/lib/python3.4/pathlib.py", line 326, in wrapped
    return strfunc(str(pathobj), *args)
FileNotFoundError: [Errno 2] No such file or directory: '/etc/system-image/config.d/00_default.ini'

Related branches

On Sep 14, 2015, at 08:40 PM, Ben Howard wrote:

>Public bug reported:
>
>
>(amd64)ubuntu@localhost:~$ system-image-cli -i
>Traceback (most recent call last):
> File "/usr/lib/python3/dist-packages/systemimage/helpers.py", line 253, in last_update_date
> timestamp = datetime.fromtimestamp(os.stat(LAST_UPDATE_FILE).st_mtime)
>FileNotFoundError: [Errno 2] No such file or directory:
>'/userdata/.last_update'

This can be an expected exception, because it's possible for
/userdata/.last_update to be missing. That case is handled, and the real
problem is here:

>During handling of the above exception, another exception occurred:
>
>Traceback (most recent call last):
> File "/usr/bin/system-image-cli", line 9, in <module>
> load_entry_point('system-image==3.0.1', 'console_scripts', 'system-image-cli')()
> File "/usr/lib/python3/dist-packages/systemimage/main.py", line 289, in main
> last_update=last_update_date(),
> File "/usr/lib/python3/dist-packages/systemimage/helpers.py", line 258, in last_update_date
> for path in config.ini_files)
> File "/usr/lib/python3/dist-packages/systemimage/helpers.py", line 258, in <genexpr>
> for path in config.ini_files)
> File "/usr/lib/python3.4/pathlib.py", line 1048, in stat
> return self._accessor.stat(self)
> File "/usr/lib/python3.4/pathlib.py", line 326, in wrapped
> return strfunc(str(pathobj), *args)
>FileNotFoundError: [Errno 2] No such file or directory: '/etc/system-image/config.d/00_default.ini'

What happened to /etc/system-image/config.d/00_default.ini? What this is
saying is that after system-image-cli started up, this config file (or its
directory) got lost or removed. That shouldn't ever happen.

Are you able to do some live debugging?

I was running "system-image-cli" via a chroot on a vanilla image; the
instance was never booted.

Barry Warsaw (barry) wrote :

On Sep 14, 2015, at 10:11 PM, Ben Howard wrote:

>I was running "system-image-cli" via a chroot on a vanilla image; the
>instance was never booted.

What does /etc/system-image/config.d look like?

seems like system-image-common 3.x stopped shipping anything in /etc in the binary deb (i see it in the 2.x series in that package but not in 3.x anymore)

Oliver Grawert (ogra) wrote :

note that we use 3.x also in the 15.04 snappy builds, so 15.04 edge is broken the same way

Oliver Grawert (ogra) wrote :

i just found that simply removing /etc/system-image/config.d/00_default.ini is enough to make it work fine (we ship a /etc/system-image/config.d/20_snappy.ini that provides all bits and pieces needed, the default.ini is a dangling symlink ... )

as a quick fix (since we are preparing a 15.04 snappy release) i'll rm that file during image build ... i'll leave the bug open since someone should examine where that dangling symlink comes from at all though.

Oliver Grawert (ogra) on 2015-09-15
Changed in snappy:
milestone: none → 15.04.3
Alexander Sack (asac) on 2015-09-15
Changed in snappy:
assignee: nobody → Oliver Grawert (ogra)
Oliver Grawert (ogra) on 2015-09-15
Changed in livecd-rootfs (Ubuntu):
assignee: nobody → Oliver Grawert (ogra)
Alexander Sack (asac) on 2015-09-15
Changed in snappy:
importance: Undecided → Critical
Oliver Grawert (ogra) on 2015-09-15
Changed in livecd-rootfs (Ubuntu):
importance: Undecided → High
status: New → Fix Committed
Changed in snappy:
status: New → Fix Committed
Barry Warsaw (barry) wrote :

If config.d/00_default.ini -- or probably any ini file -- is a dangling symlink, this bug is probably triggered.

summary: - system-image-cli tool fails on rolling/edge; missing file '/etc/system-
- image/config.d/00_default.ini
+ system-image-cli tool fails on dangling symlink
tags: added: client
Changed in system-image (Ubuntu):
importance: Undecided → High
assignee: nobody → Barry Warsaw (barry)
assignee: Barry Warsaw (barry) → nobody
Changed in ubuntu-system-image:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Barry Warsaw (barry)
milestone: none → 3.1
Alexander Sack (asac) on 2015-09-17
Changed in snappy:
status: Fix Committed → Fix Released
Barry Warsaw (barry) on 2015-09-21
Changed in ubuntu-system-image:
milestone: 3.1 → 3.0.2
status: Triaged → In Progress
Barry Warsaw (barry) wrote :

So I have a merge proposal ready to fix this problem, but as I've mentioned in LP: #1495207 two things are still mysterious:

How did you hit this bug when it's only possible in si 3.0, and that version is only available in Wily?

How is the server producing dangling symlinks?

Barry Warsaw (barry) on 2015-09-22
Changed in ubuntu-system-image:
status: In Progress → Fix Committed
Changed in system-image (Ubuntu):
status: New → Triaged
Barry Warsaw (barry) on 2015-09-30
Changed in ubuntu-system-image:
status: Fix Committed → Fix Released
Changed in system-image (Ubuntu):
milestone: none → ubuntu-15.10
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package system-image - 3.0.2-0ubuntu1

---------------
system-image (3.0.2-0ubuntu1) wily; urgency=medium

  [ CI Train Bot ]
  * New rebuild forced.

system-image (3.0.2-0ubuntu1) wily; urgency=medium

  * New upstream release.
    - LP: #1495688 - Don't crash when one of the .ini files is a dangling
      symlink.
    - d/rules: override_dh_auto_clean because otherwise, pybuild will
      remove the .egg-info files and that causes the Jenkins job in the CI
      train to fail.

 -- Barry Warsaw <email address hidden> Mon, 28 Sep 2015 21:37:45 +0000

Changed in system-image (Ubuntu):
status: Triaged → Fix Released
no longer affects: livecd-rootfs (Ubuntu)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers