← Back to issue list

Clean slate between rebuilds

View original Github issue

Metadata

Project
rockcraft
Number
#39
Type
issue
State
open
Author
valentincanonical
Labels
Created
Updated
Closed

Current evaluation

rockcraft pack fails with 'path already exists' for /root/images/bare on rebuilds. The specific umoci init bug was fixed (commit d1a5f04); the broader clean-slate-between-rebuilds concern was identified as a craft-providers/craft-application layer issue. A 2026 triage comment asks whether a tracking issue exists upstream before closing as moved.

Suggested action: keep open

Reason: The original umoci init 'path already exists' bug is confirmed fixed in current code (shutil.rmtree before umoci init in oci.py new_oci_image). The 2026 triage comment (gcomneno) correctly identifies the remaining clean-environment concern as a provider-layer issue and conditionally suggests closing as moved only if a craft-providers tracking issue exists. No such tracking issue was found, so the issue remains valid and open pending that determination.

Impact: 50 Quick Win: 17.5 Staleness: 40 Complexity: 65 Confidence: 72 Support Request: 10

Issue body

Sometimes, the `rockcraft pack` command will fail with the following error, ```sh Failed to copy image: Command '['umoci', 'init', '--layout', '/root/images/bare']' returned non-zero exit status 1. (⨯ image layout creation: path already exists: /root/images/bare) 2022-05-19 12:28:58.701 Traceback (most recent call last): 2022-05-19 12:28:58.702 File "/snap/rockcraft/x1/lib/python3.8/site-packages/rockcraft/oci.py", line 239, in _process_run 2022-05-19 12:28:58.705 subprocess.run( 2022-05-19 12:28:58.705 File "/snap/rockcraft/x1/usr/lib/python3.8/subprocess.py", line 516, in run 2022-05-19 12:28:58.705 raise CalledProcessError(retcode, process.args, 2022-05-19 12:28:58.705 subprocess.CalledProcessError: Command '['umoci', 'init', '--layout', '/root/images/bare']' returned non-zero exit status 1. 2022-05-19 12:28:58.707 Full execution log: '/root/.cache/rockcraft/log/rockcraft-20220519-122857.121178.log' ``` a way to reproduce that seem to be, 1. build a part with multiple stage packages 2. remove a package from the list 3. try to rebuild the part

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 50
Quick Win: 17.5
Staleness: 40
Complexity: 65
Confidence: 72
Support Request: 10
keep open rockcraft pack fails with 'path already exists' for /root/images/bare on rebuilds. The specific umoci init bug was fixed (commit d1a5f04); the broader clean-slate-between-rebuilds concern was identified as a craft-providers/craft-application layer issue. A 2026 triage comment asks whether a tracking issue exists upstream before closing as moved.
qwen/qwen3.6-35b-a3b
Staleness: 75
Complexity: 20
Confidence: 80
Support Request: 0
close stale Original umoci path-exists error is fixed. Broader clean slate request has been deferred to craft-providers. Inactive for ~4 months and out of scope for this repo.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 20
Confidence: 90
Support Request: 10
close stale Original umoci path error is fixed. Broader request for clean rebuilds in LXC instances is now handled by craft-providers. Issue is inactive and should be closed as moved.
qwen3.6-35b-a3b-mtp-q6
Staleness: 80
Complexity: 40
Confidence: 85
Support Request: 10
close stale Ensures a clean environment between rockcraft rebuilds to prevent leftover files and sensitive data in LXC instances. Original path-exists error fixed. Broader cleanup concern now delegated to craft-providers. Awaiting tracking issue or closure.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/rockcraft@d1a5f04 (confidence 85%)

    Commit d1a5f04 referenced in cjdcordeiro's comment as fixing the specific base:bare corner case; current oci.py confirms shutil.rmtree before umoci init.

  • Caused By: canonical/rockcraft#36 (confidence 80%)

    PR #36 (support build-base and allow 'bare' bases) introduced the base:bare code path that triggered the original path-already-exists error.

Related issues

Issue Project State Summary Similarity
#812 rockcraft insists on rebuilding part that has not changed rockcraft open Rockcraft rebuilds the mariadb part when the unrelated scripts part changes, despite no dependency between them. Reported 565 days ago with no maintainer response, labels, or activity; the rebuild logic lives in craft-parts, not rockcraft.
71%
#57 Leftover files affecting consecutive runs of "rockcraft pack" rockcraft open Rockcraft pack fails on second run after fixing an organize typo: leftover install-dir files cause a cp hard-link 'File exists' error. Maintainer asked reporter to re-test with rockcraft clean between runs; awaiting response.
70%