cloud-init clean from within /var/lib/cloud-init/instance

Bug #1795508 reported by Ryan Harper on 2018-10-01
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Chad Smith

Bug Description

Attempted to cloud-init clean from a directory clean will remove:

/var/lib/cloud/instance# cloud-init clean --logs --reboot
Traceback (most recent call last):
  File "/usr/bin/cloud-init", line 9, in <module>
    load_entry_point('cloud-init==18.3', 'console_scripts', 'cloud-init')()
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/", line 904, in main
    get_uptime=True, func=functor, args=(name, args))
  File "/usr/lib/python3/dist-packages/cloudinit/", line 2514, in log_time
    ret = func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/", line 81, in handle_clean_args
    exit_code = remove_artifacts(args.remove_logs, args.remove_seed)
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/", line 75, in remove_artifacts
    return 1
  File "/usr/lib/python3.6/", line 88, in __exit__
  File "/usr/lib/python3/dist-packages/cloudinit/", line 832, in chdir
FileNotFoundError: [Errno 2] No such file or directory: '/var/lib/cloud/instances/ce3aca12-4e37-4ef9-bc51-170db3d25881'

Related branches

Chad Smith (chad.smith) on 2019-01-25
Changed in cloud-init:
status: New → In Progress
assignee: nobody → Chad Smith (chad.smith)

This bug is fixed with commit 48955354 to cloud-init on branch master.
To view that commit see the following URL:

Changed in cloud-init:
status: In Progress → Fix Committed

This bug is believed to be fixed in cloud-init in version 19.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
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers