pack_install() crashing when used in a wsgi

Bug #1227944 reported by Julian Edwards on 2013-09-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
curtin
High
Unassigned

Bug Description

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/base.py", line 86, in dispatch
    return handler(request, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/django/views/generic/detail.py", line 109, in get
    context = self.get_context_data(object=self.object)
  File "/usr/lib/python2.7/dist-packages/maasserver/views/nodes.py", line 360, in get_context_data
    context['preseed'] = mark_safe(get_preseed(node))
  File "/usr/lib/python2.7/dist-packages/maasserver/preseed.py", line 82, in get_preseed
    release=node.get_distro_series())
  File "/usr/lib/python2.7/dist-packages/maasserver/preseed.py", line 324, in render_preseed
    xinstall = pack_install(configs=[preseed], args=[installer_url])
  File "/usr/lib/python2.7/dist-packages/curtin/util.py", line 415, in pack_install
    add_files=add_files + my_files, copy_files=copy_files)
  File "/usr/lib/python2.7/dist-packages/curtin/util.py", line 327, in pack
    shutil.copy(paths['curtin_exe'], os.path.join(bindir, 'curtin'))
  File "/usr/lib/python2.7/shutil.py", line 119, in copy
    copyfile(src, dst)
  File "/usr/lib/python2.7/shutil.py", line 82, in copyfile
    with open(src, 'rb') as fsrc:
IOError: [Errno 2] No such file or directory: '/mod_wsgi'

Looks like the code in get_curtin_paths() is dodgy:

    if curtin_exe is None:
        curtin_exe = os.path.realpath(sys.argv[0])

You can't rely on sys.argv here.

Scott Moser (smoser) on 2013-10-16
Changed in curtin:
importance: Undecided → High
status: New → Fix Committed

This bug is believed to be fixed in curtin 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 curtin:
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