cc_final_message will create /var/lib/cloud/instance as a directory if the symlink does not exist
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| cloud-init |
Fix Released
|
Undecided
|
Dan Watkins | ||
Bug Description
cc_final_message calls util.write_file, which calls ensure_dir; if nothing has caused the symlink to be created, then this means that /var/lib/
(We're seeing this in bug 1883661; I don't think it's the root cause, hence this separate bug.)
Dan,
Thanks!
https:/
https:/
I've tried to reproduce this before and never could.
I think the above are basically duplicates.
A PR for this is open at https:/
Thanks for the fix.
After applying the fix I'm getting one more error with the same test script I've mentioned in:
https:/
```
Jun 23 11:15:16 phdev cloud-init[1786]: Traceback (most recent call last):
Jun 23 11:15:16 phdev cloud-init[1786]: File "/usr/bin/
Jun 23 11:15:16 phdev cloud-init[1786]: load_entry_
Jun 23 11:15:16 phdev cloud-init[1786]: File "/usr/lib/
Jun 23 11:15:16 phdev cloud-init[1786]: get_uptime=True, func=functor, args=(name, args))
Jun 23 11:15:16 phdev cloud-init[1786]: File "/usr/lib/
Jun 23 11:15:16 phdev cloud-init[1786]: ret = func(*args, **kwargs)
Jun 23 11:15:16 phdev cloud-init[1786]: File "/usr/lib/
Jun 23 11:15:16 phdev cloud-init[1786]: util.ensure_
Jun 23 11:15:16 phdev cloud-init[1786]: File "/usr/lib/
Jun 23 11:15:16 phdev cloud-init[1786]: ensure_dir(d, mode)
Jun 23 11:15:16 phdev cloud-init[1786]: File "/usr/lib/
Jun 23 11:15:16 phdev cloud-init[1786]: os.makedirs(path)
Jun 23 11:15:16 phdev cloud-init[1786]: File "/usr/lib/
Jun 23 11:15:16 phdev cloud-init[1786]: mkdir(name, mode)
Jun 23 11:15:16 phdev cloud-init[1786]: FileExistsError: [Errno 17] File exists: '/var/lib/
Jun 23 11:15:16 phdev systemd[1]: cloud-init.service: Main process exited, code=exited, status=1/FAILURE
Jun 23 11:15:16 phdev systemd[1]: cloud-init.service: Failed with result 'exit-code'.
```
Is it okay to replicate the behavior of 'mkdir -p' for this?
A fix for this landed in https:/
Hi Shreenidhi, can you file a separate bug for that, including the tarball produced by `cloud-init collect-logs` on an affected instance, and reproduction instructions? Thanks!
Hi Dan Watkins,
Sure I'll log a separate bug with log tarball. Thanks for the response.
Hi Dan Watkins,
I created a new bug: https:/
This bug is believed to be fixed in cloud-init in version 20.3. If this is still a problem for you, please make a comment and set the state back to New
Thank you.
Tracked in Github Issues as https:/