skupperproject / skupper

Skupper is an implementation of a Virtual Application Network, enabling rich hybrid cloud communication.
http://skupper.io
Apache License 2.0
579 stars 70 forks source link

Better error messages for "skupper --platform podman init" #1397

Open jasondickerson opened 6 months ago

jasondickerson commented 6 months ago

Is your feature request related to a problem? Please describe. When running Skupper init, if there is an error it is often very generic and does not help the user understand the problem.

/usr/bin/skupper --platform podman init --ingress-host my.host Error: Error initializing Skupper - error creating skupper component: skupper-router - error creating container skupper-router: Post "http://unix/v4.0.0/libpod/containers/create" : context deadline exceeded

I have encountered this error for 2 reasons:

  1. Disk full
  2. Not enough I/O for podman to run inititialization commands before skupper hits a timeout for the podman API.

Describe the solution you'd like I would like to see better error messages that indicate the actual issue. However, I understand in this case, it requires podman to respond and give a better error message.

Describe alternatives you've considered Perhaps the timeouts for the podman commands are too short?

erwbgy commented 6 months ago

Another example of this:

$ skupper --platform podman init --ingress-host none
Podman endpoint is not available: unix:///run/user/x/podman/podman.sock

Recommendation:

        Make sure you have an active podman endpoint available.
        On most systems you can execute:

                systemctl --user enable --now podman.socket

        Alternatively you could also create your own service that runs:

                podman system service --time=0 <URI>

        You can get concrete examples through:

                podman help system service

This error message is misleading because the endpoint IS available:

$ systemctl --user status podman.socket | grep Active:
   Active: active (listening) since Sat 2024-03-02 11:48:49 GMT; 2h 3min ago

After digging through the source code I found that there is a validation error because my Podman version is too old: https://github.com/skupperproject/skupper/blob/main/client/podman/rest.go#L389.

It would be really helpful if https://github.com/skupperproject/skupper/blob/1875af65e677ba1b67fe64b3f7b9227dc4178a42/cmd/skupper/skupper_podman.go#L125 was changed to also output the actual error message.