cloud-init query: /run/cloud/instance-data-sensitive.json not generated on upgrade

Bug #1798189 reported by Chad Smith on 2018-10-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Medium
Unassigned

Bug Description

/run/cloud-init/instance-data.json & instance-data-sensitive.json not regenerated on upgrade.

Between cloud-init from 18.3-9 -> 18.4.0 cloud-init transitioned from a single sensitive /run/cloud-init/instance-data.json that was read-only root to two separate files: /run/cloud-init/instance-data-sensitive.json (root readable) and /run/cloud-init/instance-data.json (world readable).

cloud-init query subcommand attempts to read the instance-data.json when getuid is non-root, and instance-data-sensitive.json when getuid is root.

Since /run/cloud-init/instance-data*json is only regenerated on reboot, "cloud-init query" after an upgrade emits the following errors

# as non-root
ubuntu@mybox $ cloud-init query --all
ERROR: Missing instance-data.json file: /run/cloud-init/instance-data.json

# as root user
ubuntu@mybox $ sudo cloud-init query --all
ERROR: Missing instance-data.json file: /run/cloud-init/instance-data-sensitive.json

Related branches

Chad Smith (chad.smith) on 2018-10-16
description: updated
Changed in cloud-init:
importance: Undecided → Medium
status: New → Confirmed
summary: - cloud-init query: /run/cloud/instance-data.json wrong perms on upgrade
+ cloud-init query: /run/cloud/instance-data.json no regenerated on
+ upgrade
Chad Smith (chad.smith) on 2018-10-17
summary: - cloud-init query: /run/cloud/instance-data.json no regenerated on
+ cloud-init query: /run/cloud/instance-data.json not regenerated on
upgrade
summary: - cloud-init query: /run/cloud/instance-data.json not regenerated on
- upgrade
+ cloud-init query: /run/cloud/instance-data-sensitive.json not generated
+ on upgrade

This bug is fixed with commit dc0be9c5 to cloud-init on branch master.
To view that commit see the following URL:
https://git.launchpad.net/cloud-init/commit/?id=dc0be9c5

Changed in cloud-init:
status: Confirmed → Fix Committed

This bug is believed to be fixed in cloud-init in version 18.5. 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