Repository navigation
Conversation
Restoring an uploaded archive into a newly created Compose volume copied the owner and mode of the temporary extract directory onto the volume root, assuming the archive's root entry had been applied to it. Docker's copy skips that entry for an existing directory, so the root always ended up root:root 0777. Take the uid, gid, and mode from the archive's root entry instead, and set them with plain chown and chmod rather than a shell pipeline. Refs getarcaneapp#4885 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
🔍 Code ReviewPR #4887 · 🤖 Claude Opus 5.5 (High) · T3 Code (Claude Code) · Round 1 of 3 |
kmendell
approved these changes
Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Merge order: this PR, then getarcaneapp/tools#22 (adds
chown/chmodto the tools image). This one alone changes nothing until the tools image haschown. The tools change alone would make restores succeed with a world-writableroot:root 0777volume root, which is why this goes first.Checklist
mainbranchm.*()) (no new strings)What This PR Implements
Fixes: #4885 (together with the tools PR)
When
UploadAndRestorerestores into a newly created Compose volume (project copy/move with volumes, and the planned project import), it tried to give the volume root the archive root's owner and mode. It did that by copying them from the temp extract dir. ButCopyToContainerdoesn't apply the archive's./entry to an existing directory, andmkdirin the tools image creates the temp dir as777. So the root always becameroot:root 0777, and a999:999 0700Postgres root wasn't preserved. With today's tools image the step fails earlier withchown: not found.Changes Made
volume/children/backup/children/restore/service.go: keep the archive's first header (already read for validation). When it's the root dir entry, set/volumeto its uid:gid and mode with plainchownandchmodexecs, so there's noshpipeline orstat. Archives without a root entry keep Docker's default root.Testing Done
just format go,just lint backend(0 issues),go build -tags exclude_frontend ./...,go test ./internal/volume/....mkdirplusdocker cpof an archive whose./is0/0 drwxr-xr-x, the temp dir is still0:0 777.Additional Context
tools:latestonce it has one (getVolumeHelperImagedoesn't pull it again). Existing installs only get the newchown/chmodafter that image is refreshed, for example withdocker pull ghcr.io/getarcaneapp/tools:latest. That predates this PR.AI Tool Used (if applicable)
Claude Code (Claude Opus 5.5) investigated this, wrote the change and drafted this description, at my direction.
🤖 Generated with Claude Code
📸 Evidence
Before
main@8612ea241→ Afterfix/4885-restore-volume-root-from-archive@f368357b9· seeded test project evidence-shop on a sandbox Docker engine; volume root set to 999:999 0700 like a Postgres data volume; no private data🔌 Restoring into a new Compose volume (project import)
📸 Captured by Claude Opus 5.5 (High) · T3 Code (Claude Code) · Arcane images built with docker/Dockerfile; tools image built with getarcaneapp/tools
just build(#22) · 2026-11-18 22:43 UTCDisclaimer Greptiles Reviews use AI, make sure to check over its work.
To better help train Greptile on our codebase, if the comment is useful and valid Like the comment, if its not helpful or invalid Dislike
To have Greptile Re-Review the changes, mention
greptileai.

Confidence Score: 5/5
The PR appears safe to merge in the stated order, before tools#22.Summary
New Compose volumes now take their root owner and permissions from the archive’s first entry when it describes the root directory.
No actionable issues found. Tests were not run. Access to the related repositories was denied, so their compatibility could not be fully checked.
Reviews (1) · Last reviewed commit: "fix: restore a new volume's root owner a..." · Reviewed by Greptile