Debian-11 build process has lost its ethernet interfaces

0

We are using Yocto build-system (kirkstone) to compile images for i.MX8 based development board and we are trying to move the build process to AWS EC2 based environment for CI integration. We are currently using Debian (AMI: debian-11-amd64-20220503-998, type: t3.2xlarge) EC2 image from AWS marketplace.

We have configured the EC2 machine with one external interface that binds to public IP and the machine is able to communicate with the outside world. This is the output of the ip addr from the login shell

admin@ip-XXX-XXX-XXX-XXX:~$ ip a show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP group default qlen 1000
    link/ether XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
    altname enp0s5
    inet XXX-XXX-XXX-XXX/20 brd XXX.XXX.XXX.XXX scope global dynamic ens5
       valid_lft 2992sec preferred_lft 2992sec
    inet6 XXXX::XXXX:XXXX:XXXX:XXXX/64 scope link
       valid_lft forever preferred_lft forever

But, after we try to compile our Yocto project we get several build errors due to fetch failing as some of our recipes fail to fetch sources from outside world.

If I launch a development shell with bitbake -c devshell my-app it will no longer see the ethernet devices but only the local interface which is in down state and has no IP attached to it

admin@ip-XXX-XXX-XXX-XXX:~/yocto/build/tmp/work/x86_64-linux/my-app/1.0.0-r0/my-app-1.0.0$ ip a show
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:200:00:00:00

and I can also see that resolving outside connections no longer work

admin@ip-XXX-XXX-XXX-XXX:~/yocto/build/tmp/work/x86_64-linux/my-app/1.0.0-r0/my-app-1.0.0$ traceroute6 www.google.com
www.google.com: Temporary failure in name resolution
Cannot handle "host" cmdline arg `www.google.com' on position 1 (argc 1)

This is the output from process tree

admin@ip-XXX-XXX-XXX-XXX:~/yocto/build/tmp/work/x86_64-linux/my-app/1.0.0-r0/my-app-1.0.0$  ps f
    PID TTY      STAT   TIME COMMAND
    943 pts/1    Ss     0:00 /bin/bash
    994 pts/1    R+     0:00  \_ ps f
    758 pts/0    Ss     0:00 -bash
    830 pts/0    Sl+    0:01  \_ python3 /home/admin/yocto/sources/poky/bitbake/bin/bitbake my-app -c devshell
    941 pts/0    S+     0:00      \_ sh -c screen -r devshell_939
    942 pts/0    S+     0:00          \_ screen -r devshell_939

Another thing that seems off is that the build process has somehow lost all its groups and there is a group nogroup added

admin@ip-XXX-XXX-XXX-XXX:~/yocto/build/tmp/work/x86_64-linux/my-app/1.0.0-r0/my-app-1.0.0$ groups
admin nogroup

When running the groups from the login shell the user has admin adm dialout cdrom floppy sudo audio dip video plugdev netdev that seem to be lost when launching the development shell.

We are using the build system in multiple local development environments (based on Debian-11) and the build system is able to connect to outside world just fine so this relates to the AWS EC2 Debian image that we are using.

Why are the interfaces not displayed and how can we work-around this issue so that the build process can access the source repositories from the build environment?

asked a year ago37 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions