← 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

apt-get update inside LXD build instance fails on GitHub's ubuntu-22.04 runners; maintainers traced it to Docker/LXD iptables clash, not a rockcraft bug, and point to canonical/setup-lxd and canonical/craft-actions rockcraft-pack as fix (now documented).

Suggested action: close not a bug

Reason: The logs show connectivity failures (archive.ubuntu.com:80 connection timed out, IPv6 'Network is unreachable') from inside the LXD instance, and jnsgruk identified it as 'an iptables clash on 22.04' caused by Docker's default rules, noting the reporter's whywaita/setup-lxd action 'just doesn't do the iptables stuff' unlike canonical/setup-lxd; cjdcordeiro confirmed Rockcraft 'doesn't actually depend on Docker' and that the canonical/craft-actions rockcraft-pack action already handles the clash. The reporter accepted the explanation ('Cheers!'). The repo now documents the canonical action in docs/how-to/crafting/rockcraft-pack-action.rst, so the report is an environment/configuration problem with a documented workaround rather than a rockcraft code defect — hence close_not_a_bug rather than keep_open.

Evaluated by: mr-cal-bot

Impact: 32 Quick Win: 10 Complexity: 45 Confidence: 72 Actionability: 55

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
stealth/space-bunny-alpha
Impact: 32
Quick Win: 10
Complexity: 45
Confidence: 72
Actionability: 55
close not a bug apt-get update inside LXD build instance fails on GitHub's ubuntu-22.04 runners; maintainers traced it to Docker/LXD iptables clash, not a rockcraft bug, and point to canonical/setup-lxd and canonical/craft-actions rockcraft-pack as fix (now documented).
qwen/qwen3.6-35b-a3b
Impact: 30
Quick Win: 22
Complexity: 10
Confidence: 85
Actionability: 80
close not a bug Known CI environment conflict on Ubuntu 22.04 runners where Docker and LXD iptables clash prevents apt cache updates. Maintainers provided workarounds.
qwen/qwen3.8-27b
Impact: 15
Quick Win: 13
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.

Update history

No update history recorded yet.

Related work

  • Related To: canonical/rockcraft#1005 (confidence 40%)

    Separate, later issue about apt cache/sources being stale before build-packages resolution; different root cause (stale vs unreachable mirrors) but same 'update apt cache' symptom area.

Related issues

Issue Project State Summary Similarity
#195 LXD 5.0 fails to build rocks on Ubuntu 22.04 rockcraft closed Fixed by making the temporary /dev rbind mount private; Rockcraft commit d2529169 updated craft-parts to 1.18.4, bringing the fix into Rockcraft.
76%
#27 fix: use lxd from "5.21/stable" craft-actions merged Merged #27 as commit fd0ac92, switching Rockcraft Pack from latest/stable to the LXD 5.21/stable LTS channel for reliable overlay support.
73%
#43 Packing the "hello world" example fails: 'apt-utils' has no installation candidate rockcraft closed Closed as an environment conflict, not a Rockcraft defect. Docker’s iptables rules blocked LXD networking and apt access; removing Docker or allowing forwarding resolved it.
72%
#1005 rockcraft needs to update apt sources before installing build-packages rockcraft open Rockcraft 1.15.0 could fail build-package resolution with a stale apt cache; craft-parts PR #1468 now refreshes apt metadata before marking packages.
71%