resizefs fails on linux kernel versions < 2.6.26 with error : IOError: [Errno 2] No such file or directory: '/proc/2857/mountinfo'

Bug #1248625 reported by Uma Ramanan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Medium
Joshua Harlow

Bug Description

This issue was seen on Rhel versions 5.6 and 5.8 having kernel versions < 2.6.26.
Complete backtrace:

2013-11-05 18:41:56,493 - util.py[WARNING]: Running resizefs (<module 'cloudinit.config.cc_resizefs' from '/usr/lib/python2.6/site-packages/cloudinit/config/cc_resizefs.pyc'>) failed
2013-11-05 18:41:56,496 - util.py[DEBUG]: Running resizefs (<module 'cloudinit.config.cc_resizefs' from '/usr/lib/python2.6/site-packages/cloudinit/config/cc_resizefs.pyc'>) failed
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/cloudinit/stages.py", line 553, in _run_modules
    cc.run(run_name, mod.handle, func_args, freq=freq)
  File "/usr/lib/python2.6/site-packages/cloudinit/cloud.py", line 63, in run
    return self._runners.run(name, functor, args, freq, clear_on_fail)
  File "/usr/lib/python2.6/site-packages/cloudinit/helpers.py", line 197, in run
    results = functor(*args)
  File "/usr/lib/python2.6/site-packages/cloudinit/config/cc_resizefs.py", line 71, in handle
    result = util.get_mount_info(resize_what, log)
  File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 1751, in get_mount_info
    lines = load_file(mountinfo_path).splitlines()
  File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 1057, in load_file
    with open(fname, 'rb') as ifh:
IOError: [Errno 2] No such file or directory: '/proc/2857/mountinfo'

The root cause seems to be related to the fact that /proc/pid/mountinfo was introduced in linux kernel version 2.6.26 . So, older versions of the kernel would be missing this file.

Related branches

Revision history for this message
Scott Moser (smoser) wrote :

per Josh,
"/proc/pid/mountinfo was introduced in linux kernel version 2.6.26" :-/

we'll have to add a fallback path.

Joshua Harlow (harlowja)
Changed in cloud-init:
assignee: nobody → Joshua Harlow (harlowja)
Revision history for this message
Scott Moser (smoser) wrote :

fix committed in revno 894.

Changed in cloud-init:
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
Scott Moser (smoser) wrote :

fixed in 0.7.4

Changed in cloud-init:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers