Open gruyaume opened 1 year ago
I tested this with ubuntu 20.04 and I do not get this error. The error is somewhat related to the ubuntu 22.04 image / runner.
Pretty sure this is an iptables clash on 22.04
If you use the canonical/setup-lxd
action before you install rockcraft you likely won't have the same issue.
Or you can lift the iptables rules from here: https://github.com/canonical/setup-lxd/blob/90d76101915da56a42a562ba766b1a77019242fd/action.yml#L39
@jnsgruk , the example above leverages whywaita/setup-lxd@v1
, is there a difference from the canonical provided one?
@jnsgruk , the example above leverages
whywaita/setup-lxd@v1
, is there a difference from the canonical provided one?
Yeh, it just doesn't do the iptables stuff - the Ubuntu Github Actions runners that use 22.04 have a conflict where the rules that ship with docker prevent LXD containers from accessing the internet by default -- the Canonical action includes the change to iptables to ensure both work :)
Ahhh ok that's good to know. Cheers!
The fact that rockcraft depends on both docker and lxc being installed and that both those things don't play well together on Ubuntu is a bit of a pain. I'm not sure if this comment is helpful, but I'm sure I'm not the first feeling this pain.
this is a pain indeed. The thing is that Rockcraft doesn't actually depend on Docker, but most people do have it installed and is the de-facto tool for testing containers. In any case, here are some (hopefully) helpful nuggets:
I think the iptables clash might disappear if you use the Docker snap instead of the DEB.
As Jon mentioned, the LXD action already takes care of this clash, as well as the new rockcraft-pack
action: https://github.com/canonical/craft-actions/#rockcraft-pack
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.
Reference
Log: