fix: chown migrated legacy storage entries to dokku
`SaveEntry` and `touchMigrationFlag` wrote files via `os.WriteFile` and `os.Create` and never chowned them, so the install-time legacy-mount migration produced root-owned `legacy-*.json` files in `/var/lib/dokku/data/storage-registry/entries/`. The dokku user that runs `ps:rebuild` could not read them and every rebuild on a 0.37.x to 0.38.0 upgrade failed with permission denied. The companion `repairRegistryOwnership` pass in `TriggerInstall` rewrites ownership across the whole registry tree so installs that already ran the buggy code are fixed on the next package upgrade, since the per-app migration flag would otherwise cause `MigrateLegacyMounts` to skip the broken files forever.
This commit is contained in:
@@ -168,11 +168,7 @@ func migrateMount(appName string, mount string, phases []string) error {
|
||||
}
|
||||
|
||||
func touchMigrationFlag(appName string) error {
|
||||
f, err := os.Create(migrationFlagFile(appName))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return f.Close()
|
||||
return common.TouchFile(migrationFlagFile(appName))
|
||||
}
|
||||
|
||||
func filterMountLines(lines []string) []string {
|
||||
|
||||
Reference in New Issue
Block a user