@@ -394,21 +394,25 @@ if [[ -n ${CHECKS["container-engine"]} ]]; then
394394 ERROR " \" ${CONTAINER_ENGINE} info\" failed"
395395 exit 1
396396 fi
397+ <<< <<< < HEAD
398+ =======
399+ # Log rootlesskit network driver for debugging (#5030)
400+ # shellcheck disable=SC2016
401+ limactl shell " $NAME " bash -c ' pgrep -a rootlesskit | head -1 | grep -oP -- "--net=\S+" || echo "rootlesskit not found"' || true
402+ >>>>>>> b87b0cfb (trial-4: retireve runc logs)
397403 limactl shell " $NAME " $sudo $CONTAINER_ENGINE pull --quiet ${nginx_image}
398404 limactl shell " $NAME " $sudo $CONTAINER_ENGINE run -d --name nginx -p 127.0.0.1:8080:80 ${nginx_image}
399405
400406 if ! timeout 3m bash -euxc " until curl -f --retry 15 --retry-connrefused http://127.0.0.1:8080; do sleep 3; done" ; then
401407 INFO " === DEBUG: port forwarding failed (#5030) ==="
402- # Container state (full inspect, first 80 lines)
408+ # Container state (inspect, first 80 lines)
403409 limactl shell " $NAME " $sudo $CONTAINER_ENGINE inspect nginx 2>&1 | head -80 || true
404410 # Container logs (stdout+stderr)
405411 limactl shell " $NAME " $sudo $CONTAINER_ENGINE logs nginx 2>&1 || true
406- # Run nginx in foreground to see actual startup error
407- limactl shell " $NAME " $sudo $CONTAINER_ENGINE run --rm --name nginx-debug ${nginx_image} sh -c ' nginx -g "daemon off;" 2>&1 & PID=$!; sleep 5; kill $PID 2>/dev/null; wait $PID 2>/dev/null' || true
408- # What's listening inside the rootlesskit child namespace
409- limactl shell " $NAME " bash -c ' CHILD=$(cat /run/user/$(id -u)/containerd-rootless/child_pid 2>/dev/null); [ -n "$CHILD" ] && sudo nsenter -t "$CHILD" -n ss -tlnp || echo "no child_pid"' || true
410- # Rootlesskit network driver confirmation
411- limactl shell " $NAME " bash -c ' pgrep -a rootlesskit | head -1' || true
412+ # OCI runtime (runc) log -- contains the REAL reason container failed to start
413+ limactl shell " $NAME " bash -c ' CID=$(' " $sudo " ' ' " $CONTAINER_ENGINE " ' inspect nginx --format "{{.Id}}" 2>/dev/null); for f in ~/.local/share/containerd/io.containerd.runtime.v2.task/default/$CID/log.json /home/*/.local/share/containerd/io.containerd.runtime.v2.task/default/$CID/log.json; do [ -f "$f" ] && echo "=== $f ===" && cat "$f"; done' || true
414+ # Containerd journal as the rootless user
415+ limactl shell " $NAME " sudo bash -c ' U=$(logname); machinectl shell --uid="$U" .host /bin/bash -c "journalctl --user -u containerd --no-pager -n 100" 2>/dev/null || sudo -u "$U" XDG_RUNTIME_DIR=/run/user/$(id -u "$U") journalctl --user -u containerd --no-pager -n 100' || true
412416 INFO " === END DEBUG ==="
413417 ERROR " Port forwarding to nginx container on 127.0.0.1:8080 failed"
414418 exit 1
0 commit comments