Skip to content

Commit 9b0a7ba

Browse files
committed
trial-1: retrieve some more logs for next trial
Signed-off-by: Ansuman Sahoo <anshumansahoo500@gmail.com>
1 parent 939f413 commit 9b0a7ba

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

hack/test-templates.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,22 @@ if [[ -n ${CHECKS["container-engine"]} ]]; then
397397
limactl shell "$NAME" $sudo $CONTAINER_ENGINE pull --quiet ${nginx_image}
398398
limactl shell "$NAME" $sudo $CONTAINER_ENGINE run -d --name nginx -p 127.0.0.1:8080:80 ${nginx_image}
399399

400-
timeout 3m bash -euxc "until curl -f --retry 30 --retry-connrefused http://127.0.0.1:8080; do sleep 3; done"
400+
if ! timeout 3m bash -euxc "until curl -f --retry 30 --retry-connrefused http://127.0.0.1:8080; do sleep 3; done"; then
401+
INFO "=== DEBUG: port forwarding failed ==="
402+
limactl shell "$NAME" $sudo $CONTAINER_ENGINE logs nginx || true
403+
limactl shell "$NAME" ss -tlnp | grep 8080 || true
404+
limactl shell "$NAME" ps aux | grep rootlesskit | grep -v grep || true
405+
limactl shell "$NAME" bash -c 'cat /run/user/$(id -u)/containerd-rootless/child_pid 2>/dev/null' || true
406+
limactl shell "$NAME" sudo bash -c 'CHILD=$(cat /run/user/$(id -u $(logname))/containerd-rootless/child_pid 2>/dev/null) && [ -n "$CHILD" ] && echo "nsenter curl 127.0.0.1:80:" && nsenter -t "$CHILD" -n curl -sf --max-time 5 http://127.0.0.1:80 || echo "FAILED"' || true
407+
limactl shell "$NAME" sudo bash -c 'CHILD=$(cat /run/user/$(id -u $(logname))/containerd-rootless/child_pid 2>/dev/null) && [ -n "$CHILD" ] && nsenter -t "$CHILD" -n ss -tlnp' || true
408+
limactl shell "$NAME" bash -c 'echo "shell netns: $(readlink /proc/self/ns/net)"; CHILD=$(cat /run/user/$(id -u)/containerd-rootless/child_pid 2>/dev/null); [ -n "$CHILD" ] && echo "child($CHILD) netns: $(readlink /proc/$CHILD/ns/net)"; for p in $(pgrep slirp4netns); do echo "slirp4netns($p) netns: $(readlink /proc/$p/ns/net)"; done' || true
409+
limactl shell "$NAME" curl -sf --max-time 5 http://127.0.0.1:8080 || true
410+
limactl shell "$NAME" journalctl --user -u containerd --no-pager -n 100 || true
411+
limactl shell "$NAME" bash -c 'if command -v rootlessctl >/dev/null; then rootlessctl --socket /run/user/$(id -u)/containerd-rootless/api.sock list-ports; fi' || true
412+
INFO "=== END DEBUG ==="
413+
ERROR "Port forwarding to nginx container on 127.0.0.1:8080 failed"
414+
exit 1
415+
fi
401416

402417
limactl shell "$NAME" $sudo $CONTAINER_ENGINE rm -f nginx
403418

0 commit comments

Comments
 (0)