← Back to issue list

`rockcraft` crashes at the `update apt cache` step

View original Github issue

Metadata

Project
rockcraft
Number
#178
Type
issue
State
open
Author
gruyaume
Labels
Created
Updated
Closed

Current evaluation

Rockcraft fails at 'update apt cache' on GitHub ubuntu-22.04 runners due to Docker iptables rules blocking LXD container networking. Maintainers identified the root cause and pointed to canonical/setup-lxd or rockcraft-pack actions as the fix. Reporter acknowledged the solution in Jan 2023. No labels, no activity since.

Suggested action: close not a bug

Reason: Maintainer @jnsgruk identified the root cause as an iptables clash on 22.04 GitHub runners where Docker's rules block LXD container networking, and provided the fix (use canonical/setup-lxd or rockcraft-pack action). The reporter confirmed understanding ('Ahhh ok that's good to know. Cheers!'). This is an environment configuration issue, not a rockcraft bug — the apt cache failure is correctly reported by craft-providers. The documentation has since been updated with a warning about the LXD/Docker connectivity issue (docs/reuse/tutorial/setup_stable.rst, release notes 1.17), and the affected version (0.0.1.dev1) is long superseded by 1.x releases.

Impact: 15 Quick Win: 12.75 Staleness: 85 Complexity: 15 Confidence: 82 Support Request: 80

Issue body

## Overview Rockcraft fails at the `update apt cache` step when running on github's runners. ## Description We build and publish our rocks using github actions. The action to build the rock crashes with the error message `craft-providers error: Failed to update apt cache.` - Github runner version: ubuntu-latest (22.04.1) - Rockcraft version: 0+git.11f000f ## Reference - https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009 Log: ``` Run rockcraft pack --verbose Starting Rockcraft 0.0.1.dev1 Logging execution to '/home/runner/.local/state/rockcraft/log/rockcraft-20230117-16061[4](https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009#step:5:5).0[5](https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009#step:5:6)1518.log' Launching instance... craft-providers error: Failed to update apt cache. * Command that failed: 'lxc --project rockcraft exec local:rockcraft-lego-1072[6](https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009#step:5:7)[7](https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009#step:5:8)5 -- env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin ROCKCRAFT_MANAGED_MODE=1 apt-get update' * Command exit code: 100 * Command output: b'Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease\nIgn:2 http://security.ubuntu.com/ubuntu jammy-security InRelease\nIgn:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\nIgn:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\nIgn:1 http://archive.ubuntu.com/ubuntu jammy InRelease\nIgn:2 http://security.ubuntu.com/ubuntu jammy-security InRelease\nIgn:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\nIgn:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\nIgn:1 http://archive.ubuntu.com/ubuntu jammy InRelease\nIgn:2 http://security.ubuntu.com/ubuntu jammy-security InRelease\nIgn:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\nIgn:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\nErr:1 http://archive.ubuntu.com/ubuntu jammy InRelease\n Cannot initiate the connection to archive.ubuntu.com:[8](https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009#step:5:9)0 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::1[9](https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009#step:5:10)). - connect ([10](https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009#step:5:11)1: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to archive.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to archive.ubuntu.com:80 (185.125.190.36), connection timed out\nErr:2 http://security.ubuntu.com/ubuntu jammy-security InRelease\n Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to security.ubuntu.com:80 (185.125.190.36), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out\nErr:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease\n Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable)\nErr:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease\n Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable)\nReading package lists...\n' * Command standard error output: b'E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (91.189.91.39), connection timed out Could not connect to archive.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to archive.ubuntu.com:80 (185.125.190.36), connection timed out\nE: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable)\nE: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable)\nE: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease Cannot initiate the connection to security.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Cannot initiate the connection to security.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Could not connect to security.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to security.ubuntu.com:80 (185.125.190.36), connection timed out Could not connect to security.ubuntu.com:80 (91.189.91.39), connection timed out\nE: Some index files failed to download. They have been ignored, or old ones used instead.\n' Full execution log: '/home/runner/.local/state/rockcraft/log/rockcraft-20230[11](https://github.com/canonical/lego-rock/actions/runs/3941060880/jobs/6742971009#step:5:12)7-160614.051518.log' Error: Process completed with exit code 1. ```

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 15
Quick Win: 12.75
Staleness: 85
Complexity: 15
Confidence: 82
Support Request: 80
close not a bug Rockcraft fails at 'update apt cache' on GitHub ubuntu-22.04 runners due to Docker iptables rules blocking LXD container networking. Maintainers identified the root cause and pointed to canonical/setup-lxd or rockcraft-pack actions as the fix. Reporter acknowledged the solution in Jan 2023. No labels, no activity since.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 10
Confidence: 95
Support Request: 90
close not a bug Rockcraft fails to update apt cache inside LXC containers on GitHub Actions Ubuntu 22.04 runners due to an iptables conflict between Docker and LXD. Maintainers identified the root cause and provided workarounds. Issue is inactive.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 10
Confidence: 95
Support Request: 90
close not a bug Rockcraft fails to update apt cache inside LXC containers on Ubuntu 22.04 GitHub Actions runners due to Docker and LXD iptables conflicts. Maintainers identified the root cause and provided configuration workarounds using the canonical setup-lxd action.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 10
Confidence: 90
Support Request: 95
close not a bug Rockcraft crashes updating apt cache on Ubuntu 22.04 GitHub runners due to Docker/LXD iptables conflicts. Resolved via workarounds: use canonical/setup-lxd action or apply specific iptables rules. Issue remains open but effectively closed.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#195 LXD 5.0 fails to build rocks on Ubuntu 22.04 rockcraft closed LXD 5.0 caused rockcraft pack failures due to shared mount propagation breaking fuse-overlayfs. The issue was resolved by applying mount --make-rprivate to prevent unmount propagation. Fix verified and closed after Rockcraft integration.
74%
#27 fix: use lxd from "5.21/stable" craft-actions merged Merged a fix switching the LXD channel from latest/stable to 5.21/stable. This resolves Rockcraft overlay compatibility issues and aligns with the recommended LTS release. Approved by two reviewers with a three-file change.
73%
#43 Packing the "hello world" example fails: 'apt-utils' has no installation candidate rockcraft closed Closed by author as a container runtime issue. The package failure originated from LXD/Docker environment configuration rather than Rockcraft itself. The report was abandoned as a software bug.
73%
#7 fix: upgrade LXD to an existing channel craft-actions merged Merged following approval and CI checks. Updated the rockcraft action to use the latest/stable LXD channel, replacing the unavailable 5.9/stable version to align with upstream Rockcraft.
73%
#638 Client.Timeout exceeded while awaiting headers rockcraft open Network timeout (Client.Timeout) when LXD container installs snapd during rockcraft pack, hitting api.snapcraft.io. 776 days old, 0 comments, no labels, no maintainer response. Transient network error on rockcraft 1.5.3.
71%