canonical / setup-lxd

A GitHub Action to install & configure LXD on a runner.
20 stars 8 forks source link

Networking issue? #11

Open juju4 opened 11 months ago

juju4 commented 11 months ago

I tried to use this action in my ansible role test workflow but have issue with network. can't reach Internet. https://github.com/juju4/ansible-MISP/actions/runs/6441408680/job/17491174418

Could you advise where to look?

I initially considered a conflict with docker0 and delete interface but it does not seem so. And it seems you are already handling a workaround. ip address, route and nftables seems fine both inside container and for host lxdbr0 (see lxd information section from workflow run). is dhclient call required after image launch? seems so with distribution variation (ex: debian https://github.com/juju4/ansible-MISP/actions/runs/6441458364/job/17491273105 vs https://github.com/juju4/ansible-MISP/actions/runs/6441458364/job/17491273160).

Thanks

simondeziel commented 4 months ago

@juju4 unfortunately those actions runs have since expired. If you still run into networking issues, could please provide provide access to fresh logs?

juju4 commented 4 months ago

I triggered a new action run https://github.com/juju4/ansible-MISP/actions/runs/9049980407

simondeziel commented 4 months ago

@juju4 thanks for adding those debug steps to your workflow. It seems the guest instance doesn't get any IPv4, just IPv6:

2024-05-12T08:15:28.6588868Z sudo lxc exec $LXDGUEST -- ip address
...
2024-05-12T08:15:30.7014350Z 6: eth0@if7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
2024-05-12T08:15:30.7015393Z     link/ether 00:16:3e:9e:89:38 brd ff:ff:ff:ff:ff:ff link-netnsid 0
2024-05-12T08:15:30.7021452Z     inet6 fd42:cd5a:a2c1:db1e:216:3eff:fe9e:8938/64 scope global tentative dynamic mngtmpaddr 
2024-05-12T08:15:30.7022102Z        valid_lft forever preferred_lft forever
2024-05-12T08:15:30.7027067Z     inet6 fe80::216:3eff:fe9e:8938/64 scope link 
2024-05-12T08:15:30.7027824Z        valid_lft forever preferred_lft forever

It's still unclear (to me) why they couldn't get a DHCP lease from dnsmasq as the firewall rules seem to allow DHCP requests made on lxdbr0 (iifname "lxdbr0" udp dport 67 accept).

simondeziel commented 3 months ago

Interestingly, looking at the Debian bullseye run, it was able to obtain an IP but still couldn't ping 8.8.8.8.

There seems to be some other weirdness with those containers:

2024-05-12T08:15:16.2633119Z + sudo lxc exec default-debian-bullseye -- 'ansible -i inventory --connection=local -m setup localhost'
2024-05-12T08:15:16.3451614Z Error: Command not found
2024-05-12T08:15:16.3472446Z + true
2024-05-12T08:15:16.3473493Z + sudo lxc exec default-debian-bullseye -- 'systemctl -l --no-pager status'
2024-05-12T08:15:16.4372407Z Error: Command not found
2024-05-12T08:15:16.4391695Z + true
2024-05-12T08:15:16.4392671Z + sudo lxc exec default-debian-bullseye -- 'systemctl -l --no-pager --failed'
2024-05-12T08:15:16.5255181Z Error: Command not found
2024-05-12T08:15:16.5274397Z + true