snapcraft clean with additional arguments doesn't clean anything

Bug #1839014 reported by Ian Johnson on 2019-08-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
High
Chris Patterson

Bug Description

When calling `snapcraft clean`, the multipass VM is deleted as expected. However, when calling with additional arguments such as `snapcraft clean xyz`, then a multipass VM is launched, but no data is sent to the VM from the project so it fails with a stack trace like this:

$ snapcraft clean xyz
Launching a VM.
[Errno 2] No such file or directory: '/root/project'
We would appreciate it if you anonymously reported this issue.
No other data than the traceback and the version of snapcraft in use will be sent.
Would you like to send this error data? (Yes/No/Always/View) [no]: view
Traceback (most recent call last):
  File "/snap/snapcraft/3270/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==3.7.1', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/3270/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/3270/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/3270/lib/python3.5/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/snap/snapcraft/3270/lib/python3.5/site-packages/snapcraft/cli/_command.py", line 85, in invoke
    return super().invoke(ctx)
  File "/snap/snapcraft/3270/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/3270/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/3270/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 317, in clean
    project = get_project(is_managed_host=build_environment.is_managed_host)
  File "/snap/snapcraft/3270/lib/python3.5/site-packages/snapcraft/cli/_options.py", line 106, in get_project
    os.chdir(os.path.expanduser(os.path.join("~", "project")))
FileNotFoundError: [Errno 2] No such file or directory: '/root/project'
We would appreciate it if you anonymously reported this issue.
No other data than the traceback and the version of snapcraft in use will be sent.
Would you like to send this error data? (Yes/No/Always/View) [no]:

Sergio Schvezov (sergiusens) wrote :

Nice find!

Changed in snapcraft:
importance: Undecided → High
status: New → Triaged
assignee: nobody → Chris Patterson (cjp256)
Chris Patterson (cjp256) wrote :
Changed in snapcraft:
status: Triaged → In Progress
Changed in snapcraft:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers