glance-common post-install script breaks in Ussuri when /var/lib/glance/images is a PureStorage-hosted NFS share.

Bug #1929142 reported by Paul Goins
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
New
Undecided
Unassigned
Ubuntu Cloud Archive
New
Undecided
Unassigned

Bug Description

Hi,

I recently upgraded from Stein to Train successfully, and am now in the process of upgrading from Train to Ussuri. This bug hit me specifically on Ussuri.

I found that while trying to perform upgrades to switch to the bionic/ussuri packages for glance, I hit this error:

---
Setting up glance-common (2:20.0.1-0ubuntu1~cloud0) ...
chmod: changing permissions of '/var/lib/glance/images/.snapshot': Read-only file system
dpkg: error processing package glance-common (--configure):
 installed glance-common package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of python3-glance:
 python3-glance depends on glance-common (= 2:20.0.1-0ubuntu1~cloud0); however:
  Package glance-common is not configured yet.
---

/var/lib/glance/images/ is an NFS mount from a PureStorage device. It has a /var/lib/glance/images/.snapshot/ directory, and while I'm not a PureStorage expert, any attempt to write any file to that .snapshot/ directory returns "Read-only file system" errors.

Upon investigation of the postinst scripts, I noticed a delta which I believe is responsible for this.

In 19.0.4 (train):
    find /var/lib/glance -xdev -type d -exec chown glance:glance {} \;

In 20.0.1 (ussuri):
    find /var/lib/glance -exec chown glance:glance "{}" +
    find /var/lib/glance -type f -exec chmod 0640 "{}" + -o -type d -exec chmod 0750 "{}" +

I believe the "-xdev" flag likely prevented this from occuring previously, as /var/lib/glance/images/ would have been on a different filesystem than /var/lib/glance/, thus it would have been skipped.

However, the new version makes no such exclusion. And while it's OK for the images within /var/lib/glance/images/ to be chown'd/chmod'd, this fails and crashes because it also tries to modify the .snapshot directory.

Revision history for this message
Paul Goins (vultaire) wrote :

As a workaround, I had to perform the following:

* I verified that everything aside from the .snapshot directory had the correct owner and permissions, as the post-install script would have otherwise set.

* I edited /var/lib/dpkg/info/glance-common.postinst, commenting out those 2 lines.

* I ran "sudo dpkg --configure glance-common" to allow the modified post-install hook to run, and for the package to complete installation. This then allowed for packages that depended on glance-common to be upgraded afterwards.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.