Snap module update command hangs with SNAP 7.0

I updated SNAP to 7.0 in a simple Docker recipe built on Debian (https://github.com/DHI-GRAS/docker-esa-snap). The recipe used to work fine for 6.0 and included module update with

snap --nosplash --nogui --modules --update-all

in accordance with the docs.

However, that command produces the following output:

snap --nosplash --nogui --modules --update-all
/usr/local/snap/bin/../platform/lib/nbexec: WARNING: environment variable DISPLAY is not set
Refreshing SNAP Community Extensions
Refreshing SNAP
Refreshing SNAP Extensions
Updates not found.
updates=0

and then it hangs forever, i.e. never returns and with it the rest of the build process.

Is that a bug or a transient issue like Error updating snap command line?

Hi Jonas,
that’s a known issue and mentioned at the top of the Update SNAP from the command line wiki page.
There is also a workaround mentioned.

Ah. Unfortunately I cannot follow the link to the workaround, because the issues on the snap-desktop GitHub repo are not visible for me: https://github.com/senbox-org/snap-desktop/issues/57 Could you re-post the script here or put it in a public Gist or so, please?

1 Like

Same issue. I would appreciate it here as well

Mmh, even for me it wasn’t visible anymore.

This is what was provided as workaround:

Given one has pkill installed (should be available in macOS most Linux distros by default, not sure about other BSDs though) and uses the JRE that comes with SNAP, a very crude workaround is:

snap --nosplash --nogui --modules --update-all 2>&1 | while read -r line; do
    echo "$line"
    [ "$line" = "updates=0" ] && sleep 2 && pkill -TERM -f "snap/jre/bin/java"
done

This will terminate the Java process the SNAP update launched when the line “updates=0” is printed.