Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a container deployment fails as a result of a runtime error, the link creation stage should provide a clear error message instead of failed to Statfs "/proc/0/ns/net #2284

Open
jbemmel opened this issue Nov 6, 2024 · 5 comments

Comments

@jbemmel
Copy link
Contributor

jbemmel commented Nov 6, 2024

For a Linux container I added the following cmd line:

cmd: 'sh -c "ip route replace default via 10.2.77.1"'

During initial startup, the subnet was unavailable so the command failed:

jvanbemmel@host:~$ docker logs clab-h1
ip: RTNETLINK answers: Network unreachable

However, that's not the error I get from clab. Instead:

ERRO[0000] failed to Statfs "/proc/0/ns/net": no such file or directory
@hellt
Copy link
Member

hellt commented Nov 6, 2024

this error means that this (or another) container existed before we reached the link creation phase.
Did it?

@jbemmel
Copy link
Contributor Author

jbemmel commented Nov 6, 2024

Yes, it exists briefly and then terminates

@jbemmel
Copy link
Contributor Author

jbemmel commented Nov 6, 2024

cmd: "false" may reproduce the issue

@hellt
Copy link
Member

hellt commented Nov 6, 2024

this is "expected", since containers should not exit normally
You should use exec to run commands inside the containers, and cmd is to change the daemon command that container runs

@jbemmel
Copy link
Contributor Author

jbemmel commented Nov 6, 2024

I made a mistake, but the error message could be clearer. Containerlab shouldn't even try to access an exited container

@hellt hellt changed the title Confusing error when 'cmd' command fails When a container deployment fails as a result of a runtime error, the link creation stage should provide a clear error message instead of failed to Statfs "/proc/0/ns/net Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants