Snap 8 BackGeocoding in Alpine linux Docker

The installer is not updated. There is also no updated yet, which fixes the SRTM issue.
This will come the next days.

How to update SNAP:
Update SNAP from the command line - SNAP - SNAP Wiki (atlassian.net)
Updating the desktop application is actually straight forward. However ,the following shows how to install a plugin. But the dialog allows you to update the plugins too.
Install a Plugin (.nbm file) via Plugin Manager - SNAP - SNAP Wiki (atlassian.net)

This is the document I followed without success (see above)
The list of updates is available, but the update-all command returns “Updates not found”

Ah, thanks for pointing to this. I overlooked it.
When calling it you still kept the -nogui option?

The exception reminds of this issue:
[SNAP-1367] Azul JDK does not include fonts - JIRA (atlassian.net)
This was reported here:


Probably it not the same but it has some similarities.

In Alpine docker updating also restarts in a never ending loop, nonetheless using the -nogui option.

Same for Ubuntu : never ending loop.

It’s not the same as the issue SNAP-1367. It’s does not even try to install updates as it does not found any.
Anyway, I tried to install the fonts, but it does not change anything.

A new test:

I have rebuilt the Alpine based docker image today, still no way to update to SNAP 8.0.3:

docker pull mundialis/esa-snap:s1tbx
docker run -it --rm 9ec75d7c0903 /bin/sh
/ # /usr/local/snap/bin/snap --nosplash --nogui --modules --update-all 
/usr/local/snap/bin/../platform/lib/nbexec: WARNING: environment variable DISPLAY is not set
Refreshing SNAP Supported Plugins
Refreshing SNAP Core
Refreshing SNAP Toolboxes
Will update org.csa.rstb.rstb.op.polarimetric.tools@8.0.0 to version 8.0.1
Will update org.esa.snap.snap.temporal.percentile@8.0.0 to version 8.0.3
Will update org.esa.snap.snap.unmix.ui@8.0.0 to version 8.0.3
Will update org.esa.snap.snap.pgx.reader@8.0.0 to version 8.0.3
...

Will update org.esa.snap.snap.ndvi@8.0.0 to version 8.0.3
Will update org.esa.s1tbx.s1tbx.op.calibration@8.0.0 to version 8.0.1
updates=102
Establishing a connection ...
Establishing a connection ...
SNAP Core Library
SNAP Core Library
SNAP Python Interface
SNAP Python Interface
SNAP Remote Products Repository
SNAP Remote Products Repository
SNAP NetCDF Product Reader/Writer
SNAP NetCDF Product Reader/Writer
...

NASA Blue Marble Worldmap
SNAP Help
SNAP Help


null
null


Exception in thread "main" java.lang.NullPointerException
	at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
	at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
	at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
	at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
	at sun.font.SunFontManager$2.run(SunFontManager.java:431)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.SunFontManager.<init>(SunFontManager.java:376)
	at sun.awt.FcFontManager.<init>(FcFontManager.java:35)
	at sun.awt.X11FontManager.<init>(X11FontManager.java:57)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
	at sun.font.SunFontManager.getInstance(SunFontManager.java:250)
	at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
	at sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1119)
	at javax.swing.JComponent.getFontMetrics(JComponent.java:1617)
	at javax.swing.text.PlainView.calculateLongestLine(PlainView.java:639)
	at javax.swing.text.PlainView.updateMetrics(PlainView.java:209)
	at javax.swing.text.PlainView.updateDamage(PlainView.java:527)
	at javax.swing.text.PlainView.insertUpdate(PlainView.java:451)
	at javax.swing.plaf.basic.BasicTextUI$RootView.insertUpdate(BasicTextUI.java:1610)
	at javax.swing.plaf.basic.BasicTextUI$UpdateHandler.insertUpdate(BasicTextUI.java:1869)
	at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:201)
	at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:748)
	at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:707)
	at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
	at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:669)
	at javax.swing.text.JTextComponent.setText(JTextComponent.java:1669)
	at org.netbeans.updater.UpdaterFrame.initComponents(UpdaterFrame.java:175)
	at org.netbeans.updater.UpdaterFrame.<init>(UpdaterFrame.java:128)
	at org.netbeans.updater.UpdaterFrame.main(UpdaterFrame.java:253)
Will update org.csa.rstb.rstb.op.polarimetric.tools@8.0.0 to version 8.0.1
Will update org.esa.snap.snap.temporal.percentile@8.0.0 to version 8.0.3
Will update org.esa.snap.snap.unmix.ui@8.0.0 to version 8.0.3
Will update org.esa.snap.snap.pgx.reader@8.0.0 to version 8.0.3
...

… endless loop. I have no clue how to fix it.

An updated SNAP 8.0.3 installer might help.

I think the one that solved the SRTM problem is included in the latest installer.
Is it possible to use the latest installer to generate the Dockers ?

There is no new installer yet: http://step.esa.int/main/download/snap-download/

Yes, there is no new installer. You can get the latest updates by updating the modules.
You can also download nbm files manually. See this thread.
.nbm files for offline install - snap - STEP Forum (esa.int)

Here @MarkWilliamMatthews explained how he solves this issue.

Here we have in docker the “endless loop” problem (see above)…

Do you suggest to modify the Dockerfile to download nbm files as done in the post you indicated?

Yes, I think the solution mark wrote is the best solution in the short or medium term.
Unfortunately, you need a desktop installation to retrieve the latest module updates.

I think there is currently no way to download modules e.g. by wget and then include them in SNAP without using the SNAP command line (Update SNAP from the command line - SNAP - SNAP Wiki (atlassian.net)).

There would be no problem to use the SNAP command line even in docker, but still there is the NullPointerException loop (see above):

Exception in thread “main” java.lang.NullPointerException
at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:774)
at sun.font.SunFontManager$2.run(SunFontManager.java:431)
at java.security.AccessController.doPrivileged(Native Method)

at org.netbeans.updater.UpdaterFrame.initComponents(UpdaterFrame.java:175)
at org.netbeans.updater.UpdaterFrame.(UpdaterFrame.java:128)
at org.netbeans.updater.UpdaterFrame.main(UpdaterFrame.java:253)

which I don’t know how to work-around.

Installing fonts didn’t help?

Using Fonts with OpenJDK / Zulu – Azul Systems

Thanks for the hint, the font addition seems to do the trick in Alpine:

docker run -it --rm mundialis/esa-snap sh
/ # apk add ttf-dejavu
...
Executing mkfontscale-1.2.1-r1.trigger
OK: 170 MiB in 71 packages

/ # /usr/local/snap/bin/snap --nosplash --nogui --modules --update-all
/usr/local/snap/bin/../platform/lib/nbexec: WARNING: environment variable DISPLAY is not set
Refreshing SNAP Supported Plugins
Refreshing SNAP Core
Refreshing SNAP Toolboxes
Will update org.csa.rstb.rstb.op.polarimetric.tools@8.0.0 to version 8.0.1
Will update org.esa.s2tbx.s2tbx.s2msi.reader@8.0.0 to version 8.0.1
Will update org.esa.snap.snap.temporal.percentile@8.0.0 to version 8.0.3
Will update org.esa.snap.snap.unmix.ui@8.0.0 to version 8.0.3
Will update org.esa.snap.snap.pgx.reader@8.0.0 to version 8.0.3
Will update org.esa.snap.snap.remote.products.repository@8.0.0 to version 8.0.3
Will update org.esa.s2tbx.s2tbx.forest.cover.change@8.0.0 to version 8.0.1
...
SNAP Standalone Tool Adapter GUI
SNAP Standalone Tool Adapter GUI
Sentinel-2 Toolbox Adapters Help
Sentinel-2 Toolbox Adapters Help


null
null


Updates not found.
updates=0
/ #

Indeed no more NullPointerException, even in Alpine!

Can I assume that the update was successful? If yes, then I’ll update the Dockerfile.

Yes, considering the log, the update should be successful.

Great!

Our Alpine-based docker images are now updated (Ubuntu still pending):

3 Likes

It’s not the same as the issue SNAP-1367. It’s does not even try to install updates as it does not found any.
Anyway, I tried to install the fonts, but it does not change anything. hellodear

We just succeeded in updating our SNAP Ubuntu-based docker container as well.
For the trick, see this GitHub commit for “update in loop”.

For choices, see:

2 Likes

Thank you Markus.

Back-Geocoding in Alpine Docker still does not work :frowning:, but it works with Ubuntu Docker :).

For those who want to use Ubuntu docker and Back-Geocoding, install the following package:
apt install libgfortran5

Thanks a lot all of you for your help !

Ah sorry - somehow I missed that lib in the Ubuntu Dockerfile. Added now, and rebuilding…