fiji / dockerfiles

Fiji Dockerfiles for Docker builds.
https://registry.hub.docker.com/u/fiji/fiji/
8 stars 9 forks source link

Error running update #21

Closed BioinfoTongLI closed 2 years ago

BioinfoTongLI commented 3 years ago

Hello,

I am getting an error with both tag latest and fiji-openjdk-8 Here is my Dockerfile

FROM fiji/fiji:fiji-openjdk-8                                                   
RUN /opt/fiji/entrypoint.sh --update add-update-site BigStitcher https://sites.imagej.net/BigStitcher/
RUN /opt/fiji/entrypoint.sh --update update

The last action throws this error:

Error while executing the main() method of class 'net.imagej.updater.CommandLine':
java.util.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: Error reading configuration file
    at java.util.ServiceLoader.fail(ServiceLoader.java:232)
    at java.util.ServiceLoader.parse(ServiceLoader.java:309)
    at java.util.ServiceLoader.access$200(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
    at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
    at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
    at java.nio.charset.Charset$1.getNext(Charset.java:350)
    at java.nio.charset.Charset$1.hasNext(Charset.java:365)
    at java.nio.charset.Charset$2.run(Charset.java:410)
    at java.nio.charset.Charset$2.run(Charset.java:407)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.nio.charset.Charset.lookupViaProviders(Charset.java:406)
    at java.nio.charset.Charset.lookup2(Charset.java:477)
    at java.nio.charset.Charset.lookup(Charset.java:464)
    at java.nio.charset.Charset.forName(Charset.java:528)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.findCharsetNameFor(Encodings.java:386)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.findCharsetNameFor(Encodings.java:422)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.loadEncodingInfo(Encodings.java:450)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.<init>(Encodings.java:308)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.<init>(Encodings.java:296)
    at com.sun.org.apache.xml.internal.serializer.Encodings.<clinit>(Encodings.java:564)
    at com.sun.org.apache.xml.internal.serializer.ToStream.<init>(ToStream.java:134)
    at com.sun.org.apache.xml.internal.serializer.ToXMLStream.<init>(ToXMLStream.java:67)
    at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.<init>(ToUnknownStream.java:143)
    at com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory.getSerializationHandler(TransletOutputHandlerFactory.java:159)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:445)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.setResult(TransformerHandlerImpl.java:146)
    at net.imagej.updater.XMLFileWriter.createHandler(XMLFileWriter.java:279)
    at net.imagej.updater.XMLFileWriter.write(XMLFileWriter.java:147)
    at net.imagej.updater.FilesCollection.write(FilesCollection.java:433)
    at net.imagej.updater.CommandLine.update(CommandLine.java:574)
    at net.imagej.updater.CommandLine.update(CommandLine.java:515)
    at net.imagej.updater.CommandLine.update(CommandLine.java:511)
    at net.imagej.updater.CommandLine.main(CommandLine.java:1452)
    at net.imagej.updater.CommandLine.main(CommandLine.java:1375)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:279)
    at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:186)
    at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)
Caused by: java.io.FileNotFoundException: /opt/fiji/Fiji.app/jars/jcodings-1.0.27.jar (No such file or directory)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:225)
    at java.util.zip.ZipFile.<init>(ZipFile.java:155)
    at java.util.jar.JarFile.<init>(JarFile.java:166)
    at java.util.jar.JarFile.<init>(JarFile.java:103)
    at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:84)
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
    at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:152)
    at java.net.URL.openStream(URL.java:1045)
    at java.util.ServiceLoader.parse(ServiceLoader.java:304)
    ... 40 more

Any thoughts?

Cheers! Tong

joshmoore commented 3 years ago

Hi @BioinfoTongLI,

thanks for the heads up. What happens if you build the image locally? Does the issue go away? If so, happy to release a new version ASAP.

All the best, ~Josh

BioinfoTongLI commented 3 years ago

Hi @joshmoore,

I just ran local docker build in fiji-openjdk-8 and got:

Step 15/15 : RUN ./entrypoint.sh --headless --ij2 --console --run ./demo.py 'name="test"'
 ---> Running in 5bc1e3bc7138
Dec 03, 2020 1:49:46 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Error while executing the main() method of class 'net.imagej.Main':
java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:278)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:229)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:192)
    at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:164)
    at org.scijava.Context.<init>(Context.java:278)
    at org.scijava.Context.<init>(Context.java:234)
    at org.scijava.Context.<init>(Context.java:174)
    at org.scijava.Context.<init>(Context.java:160)
    at net.imagej.ImageJ.<init>(ImageJ.java:77)
    at net.imagej.Main.main(Main.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:291)
    at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:198)
    at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:89)
Caused by: java.lang.NullPointerException
    at java.util.ArrayList.addAll(ArrayList.java:583)
    at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:193)
    at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:163)
    at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:315)
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:267)
    ... 16 more
The command '/bin/sh -c ./entrypoint.sh --headless --ij2 --console --run ./demo.py 'name="test"'' returned a non-zero code: 1

However the update above worked well:

Step 11/15 : RUN ./entrypoint.sh --update edit-update-site ImageJ https://update.imagej.net/
 ---> Running in 7789b5185436
Updating the index of available files (Updating from ImageJ site: https://u...
Updating from ImageJ site: https://update.imagej.net/ done
Updating the index of available files (Updating from Fiji site: https://upd...
Updating from Fiji site: https://update.fiji.sc/ done
Updating the index of available files (Updating from Java-8 site: https://s...
Updating from Java-8 site: https://sites.imagej.net/Java-8/ done

Done: Checksummer

Removing intermediate container 7789b5185436
 ---> 4585bdcbff34
Step 12/15 : RUN ./entrypoint.sh --update edit-update-site Fiji https://update.fiji.sc/
 ---> Running in 1c619fb9cb13
Updating the index of available files (Updating from ImageJ site: https://u...
Updating from ImageJ site: https://update.imagej.net/ done
Updating the index of available files (Updating from Fiji site: https://upd...
Updating from Fiji site: https://update.fiji.sc/ done
Updating the index of available files (Updating from Java-8 site: https://s...
Updating from Java-8 site: https://sites.imagej.net/Java-8/ done

Done: Checksummer

Removing intermediate container 1c619fb9cb13
 ---> 7cf66542291c
Step 13/15 : RUN ./entrypoint.sh --update edit-update-site Java-8 https://sites.imagej.net/Java-8/

It seems that a new version would be great!

Best, Tong

joshmoore commented 3 years ago

Kicking off the build process. (Already thinking about a Github action...)

imagesc-bot commented 3 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/fiji-fails-to-launch-after-update/44582/8

joshmoore commented 3 years ago

I'm see the same error trying to build. Posted to image.sc.

BioinfoTongLI commented 3 years ago

Ok, will follow that up - Sorry, not used to report everything on image.sc yet, will do that in the future.

hinerm commented 3 years ago

@BioinfoTongLI

Sorry, not used to report everything on image.sc yet, will do that in the future.

Cross-posting is fine! No worries.

java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService

This is because a Fiji plugin, FilamentDetector, was mistakenly uploaded to the core Java-8 update site despite depending on JavaFX.

I'm removing it from the update site for now.

joshmoore commented 3 years ago

Thanks, @hinerm ! ❀️

joshmoore commented 3 years ago

@hinerm, it may be unrelated then (or a secondary issue?):

Trying to build a new image I still see:

Step 15/15 : RUN ./entrypoint.sh --headless --ij2 --console --run ./demo.py 'name="test"'
 ---> Running in cb35fa5d2c4e
Dec 16, 2020 10:57:03 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Error while executing the main() method of class 'net.imagej.Main':
java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:278)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:229)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:192)
    at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:164)
    at org.scijava.Context.<init>(Context.java:278)
    at org.scijava.Context.<init>(Context.java:234)
    at org.scijava.Context.<init>(Context.java:174)
    at org.scijava.Context.<init>(Context.java:160)
    at net.imagej.ImageJ.<init>(ImageJ.java:77)
    at net.imagej.Main.main(Main.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:291)
    at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:198)
    at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:89)
Caused by: java.lang.NullPointerException
    at java.util.ArrayList.addAll(ArrayList.java:583)
    at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:193)
    at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:163)
    at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:315)
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:267)
    ... 16 more
The command '/bin/sh -c ./entrypoint.sh --headless --ij2 --console --run ./demo.py 'name="test"'' returned a non-zero code: 1
make: *** [fiji-openjdk-8] Error 1

like https://github.com/fiji/dockerfiles/issues/21#issuecomment-738008552

and trying to build @BioinfoTongLI's Dockerfile:

FROM fiji/fiji:fiji-openjdk-8
RUN /opt/fiji/entrypoint.sh --update add-update-site BigStitcher https://sites.imagej.net/BigStitcher/
RUN /opt/fiji/entrypoint.sh --update update

I see:

plugins/quality_estimation-0.2.0.jar done
Done: Downloading...

Done: Downloading...

Error while executing the main() method of class 'net.imagej.updater.CommandLine':
java.util.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: Error reading configuration file
    at java.util.ServiceLoader.fail(ServiceLoader.java:232)
    at java.util.ServiceLoader.parse(ServiceLoader.java:309)
    at java.util.ServiceLoader.access$200(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
...
Caused by: java.io.FileNotFoundException: /opt/fiji/Fiji.app/jars/jcodings-1.0.27.jar (No such file or directory)
    at java.util.zip.ZipFile.open(Native Method)
...
    at java.net.URL.openStream(URL.java:1045)
    at java.util.ServiceLoader.parse(ServiceLoader.java:304)

as in the description.

joshmoore commented 3 years ago

@hinerm as a new year follow-up, any ideas on next steps here?

hinerm commented 3 years ago

@joshmoore

and trying to build @BioinfoTongLI's Dockerfile:

I believe this is due to some drift in the older Fiji that is living in the fiji-openjdk-8 image. You can produce the same output without tracking the BigStitcher site, but I believe the update is actually successful. Subsequent updates (with or without BigSticher) appear to be successful:

image

Trying to build a new image I still see:

How are you building the new image? Starting from the current fiji-opendjk-8 I can't reproduce this issue, it works as intended:

image

But not sure how you got to your cb35fa5d2c4e image?

joshmoore commented 3 years ago

Using the make file:

[jamoore@idr1-slot2 fiji-dockerfiles]$ make fiji-openjdk-8
cd fiji-openjdk-8 && docker build -t fiji/fiji:fiji-openjdk-8 .
Sending build context to Docker daemon  5.632kB
Step 1/15 : FROM openjdk:8
 ---> 82f24ce79de6
...
The command '/bin/sh -c ./entrypoint.sh --headless --ij2 --console --run ./demo.py 'name="test"'' returned a non-zero code: 1
make: *** [fiji-openjdk-8] Error 1

If I add a --no-cache to that (which I likely should anyway in the Makefile), I still end with the same exception:

Step 15/15 : RUN ./entrypoint.sh --headless --ij2 --console --run ./demo.py 'name="test"'
 ---> Running in 2a665fe014e6
Jan 08, 2021 5:11:16 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Error while executing the main() method of class 'net.imagej.Main':
java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:278)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:229)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:192)
    at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:164)
    at org.scijava.Context.<init>(Context.java:278)
    at org.scijava.Context.<init>(Context.java:234)
    at org.scijava.Context.<init>(Context.java:174)
    at org.scijava.Context.<init>(Context.java:160)
    at net.imagej.ImageJ.<init>(ImageJ.java:77)
    at net.imagej.Main.main(Main.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:291)
    at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:198)
    at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:89)
Caused by: java.lang.NullPointerException
    at java.util.ArrayList.addAll(ArrayList.java:583)
    at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:193)
    at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:163)
    at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:315)
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:267)
    ... 16 more
The command '/bin/sh -c ./entrypoint.sh --headless --ij2 --console --run ./demo.py 'name="test"'' returned a non-zero code: 1
make: *** [fiji-openjdk-8] Error 1
joshmoore commented 3 years ago

8 is still failing. I'm going to try bumping to 11+.

bethac07 commented 3 years ago

Any update on this? I'm seeing different outputs in a script I'm running locally vs on the openjdk-8 Docker, so I wanted to update, and am running into the same issue.

Thanks guys, appreciate the help!

Apr 22, 2021 9:36:39 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Error while executing the main() method of class 'net.imagej.Main':
java.lang.IllegalArgumentException: Invalid service: sc.fiji.filamentdetector.gui.GUIStatusService
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:278)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:229)
    at org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:192)
    at org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:164)
    at org.scijava.Context.<init>(Context.java:278)
    at org.scijava.Context.<init>(Context.java:234)
    at org.scijava.Context.<init>(Context.java:174)
    at org.scijava.Context.<init>(Context.java:160)
    at net.imagej.ImageJ.<init>(ImageJ.java:77)
    at net.imagej.Main.main(Main.java:54)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:291)
    at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:198)
    at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:89)
Caused by: java.lang.NullPointerException
    at java.util.ArrayList.addAll(ArrayList.java:583)
    at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:193)
    at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:163)
    at org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:315)
    at org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:267)
    ... 16 more
The command '/bin/sh -c ./entrypoint.sh --headless --ij2 --console --run ./demo.py 'name="test"'' returned a non-zero code: 1
make: *** [fiji-openjdk-8] Error 1
bethac07 commented 3 years ago

(FWIW, if I don't try to build my own Fiji Docker from scratch, but just try to do

FROM fiji/fiji:fiji-openjdk-8

USER root

RUN /opt/fiji/entrypoint.sh --update update

I do get a slightly different stack trace after all the downloading - I've tried with and without the USER root line, same outcome.)

Done: Downloading...

Error while executing the main() method of class 'net.imagej.updater.CommandLine':
java.util.ServiceConfigurationError: java.nio.charset.spi.CharsetProvider: Error reading configuration file
    at java.util.ServiceLoader.fail(ServiceLoader.java:232)
    at java.util.ServiceLoader.parse(ServiceLoader.java:309)
    at java.util.ServiceLoader.access$200(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:357)
    at java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
    at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
    at java.nio.charset.Charset$1.getNext(Charset.java:350)
    at java.nio.charset.Charset$1.hasNext(Charset.java:365)
    at java.nio.charset.Charset$2.run(Charset.java:410)
    at java.nio.charset.Charset$2.run(Charset.java:407)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.nio.charset.Charset.lookupViaProviders(Charset.java:406)
    at java.nio.charset.Charset.lookup2(Charset.java:477)
    at java.nio.charset.Charset.lookup(Charset.java:464)
    at java.nio.charset.Charset.forName(Charset.java:528)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.findCharsetNameFor(Encodings.java:386)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.findCharsetNameFor(Encodings.java:422)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.loadEncodingInfo(Encodings.java:450)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.<init>(Encodings.java:308)
    at com.sun.org.apache.xml.internal.serializer.Encodings$EncodingInfos.<init>(Encodings.java:296)
    at com.sun.org.apache.xml.internal.serializer.Encodings.<clinit>(Encodings.java:564)
    at com.sun.org.apache.xml.internal.serializer.ToStream.<init>(ToStream.java:134)
    at com.sun.org.apache.xml.internal.serializer.ToXMLStream.<init>(ToXMLStream.java:67)
    at com.sun.org.apache.xml.internal.serializer.ToUnknownStream.<init>(ToUnknownStream.java:143)
    at com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory.getSerializationHandler(TransletOutputHandlerFactory.java:159)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getOutputHandler(TransformerImpl.java:445)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.setResult(TransformerHandlerImpl.java:146)
    at net.imagej.updater.XMLFileWriter.createHandler(XMLFileWriter.java:279)
    at net.imagej.updater.XMLFileWriter.write(XMLFileWriter.java:147)
    at net.imagej.updater.FilesCollection.write(FilesCollection.java:433)
    at net.imagej.updater.CommandLine.update(CommandLine.java:574)
    at net.imagej.updater.CommandLine.update(CommandLine.java:515)
    at net.imagej.updater.CommandLine.update(CommandLine.java:511)
    at net.imagej.updater.CommandLine.main(CommandLine.java:1452)
    at net.imagej.updater.CommandLine.main(CommandLine.java:1375)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:279)
    at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:186)
    at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)
Caused by: java.io.FileNotFoundException: /opt/fiji/Fiji.app/jars/jcodings-1.0.27.jar (No such file or directory)
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:225)
    at java.util.zip.ZipFile.<init>(ZipFile.java:155)
    at java.util.jar.JarFile.<init>(JarFile.java:166)
    at java.util.jar.JarFile.<init>(JarFile.java:103)
    at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:93)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:69)
    at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:84)
    at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:122)
    at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:152)
    at java.net.URL.openStream(URL.java:1045)
    at java.util.ServiceLoader.parse(ServiceLoader.java:304)
    ... 40 more
The command '/bin/sh -c /opt/fiji/entrypoint.sh --update update' returned a non-zero code: 1
make: *** [build] Error 1
bethac07 commented 3 years ago

As a workaround, I made the world's dumbest Dockerfile to just get Fiji installed, you can grab it at https://hub.docker.com/r/bethcimini/simplefiji/tags, full Dockerfile below.

It's obviously not a replacement for the real thing, but I can confirm it's currently executing my script, so hopefully it can serve as a patch for others.

FROM ubuntu:18.04
RUN apt-get -y update
RUN apt-get -y upgrade
RUN apt-get install -y openjdk-8-jdk-headless wget unzip
RUN export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

RUN mkdir /opt/fiji
WORKDIR /opt/fiji
RUN wget https://downloads.imagej.net/fiji/latest/fiji-linux64.zip
RUN unzip fiji-linux64.zip
RUN echo "import os" >> dummy.py
RUN ./Fiji.app/ImageJ-linux64 --ij2 --headless --run dummy.py
joshmoore commented 3 years ago

Hi @bethac07. Sorry for not reporting back. My attempts to get openjdk11 working failed: https://github.com/fiji/dockerfiles/compare/openjdk11?expand=1

With the Java-8 update site, I see the GUI service error above. If I try to remove it:

RUN ./entrypoint.sh --update remove-update-site Java-8 https://update.imagej.net/

then there are issues when updating the other update sites to https.

Personally, your Dockerfile doesn't look dumb at all. I think the critical difference, though, is that the ones in this repo attempt to update while yours doesn't. If that's the strategy we want to adopt, I can open a PR.

bethac07 commented 3 years ago

I think the critical difference, though, is that the ones in this repo attempt to update while yours doesn't

I have a strong suspicion that's it as well, though TBH I didn't test that out once I got something I could actually use to run what I needed last night ;) . The other (not mutually exclusive of course) option is just that whatever OS the openjdk8 docker you guys are currently FROM-ing has some difference from being older/a different OS/different packages which are somehow different from what I made here.

It also lacks some of the nice things you guys have with the entrypoint script, and setting up various security policies etc, so likely you'd want to add all of those back in, but since for my purposes I literally just need a Docker with Fiji in it so that I can FROM it from MY Docker to add the stuff for my use case (running Fiji on AWS at scale), I kept it basic.

I leave it to you guys to decide if you want to change implementation strategies, but glad this may have been helpful!

joshmoore commented 2 years ago

@hinerm: coming back to this due to the recent ping to the image.sc thread -- any ideas? Would a brainstorming help?

joshmoore commented 2 years ago

Situation persists.

ctrueden commented 2 years ago

Sorry to hear of all the problems. It's all because https://downloads.imagej.net/fiji/latest still points to archive/20201029-1752, rather than the truly latest Fiji bundle, due to macOS-related problems.

However, since the latest pointer was reverted to 20201029-1752, the bundled macOS version of OpenJDK was successfully updated, we could now update these bundles. Unfortunately, the fiji-builds job that automates this is disabled due to my inability to wrangle GitHub Actions caching mechanism. It's on my list to deal with soon. In the meantime, I tried to manually regenerate the bundles for the moment, but now I'm hitting a problem where the Fiji packager code fails to generate a win32 bundle. Investigating now.

P.S. Some clarifying points in response to above discussion:

  1. The FilamentDetector plugin is part of Fiji and was not uploaded erroneously. It really was intended to be part of the Java-8 update site. It is not the only Fiji component using JavaFX; there is also OMEVisual. The FilamentDetector error preventing Fiji's startup was fixed with FilamentDetector 2.0.0, and should not be happening anymore. I tested Fiji 2.3.2-SNAPSHOT from master with OpenJDK 11 (i.e. no JavaFX), and Fiji starts up fine with the FilamentDetector and OMEVisual plugins installed. So I don't think JavaFX is the problem here.

  2. @bethac07's error:

    Caused by: java.lang.NullPointerException
            at java.util.ArrayList.addAll(ArrayList.java:583)
            at org.scijava.util.ClassUtils.getAnnotatedFields(ClassUtils.java:193)

    Was a bug in SciJava Common that has since been fixed (scijava/scijava-common@582bafeef) and is part of scijava-common 2.87.1, which is what Fiji currently ships. So the current version of Fiji should not suffer from that bug.

Both of these points led me to think that the Dockerfile must not be pulling in a recent-enough Fiji bundle, which is how I noticed/remembered about the latest pointer being woefully out of date...

ctrueden commented 2 years ago

I have now:

@joshmoore Please try rebuilding the Docker image again and see whether problems persist.

imagesc-bot commented 2 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/fiji-bundles-updated-with-newest-zulu-8-jdk-fx/65809/1

joshmoore commented 2 years ago

Situation persists.

Situation de-persists:

Apr 15, 2022 6:59:28 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Hello test
Removing intermediate container 13431b305854
 ---> 474f5d705fab
Successfully built 474f5d705fab
Successfully tagged fiji/fiji:fiji-openjdk-8

πŸŽ‰ 🎈 🎊

I'll run the rest of the builds now and get them up on Docker Hub. (I'll also go back to my attempt at OpenJDK 11)

joshmoore commented 2 years ago

New tags pushed: https://hub.docker.com/r/fiji/fiji/tags (Note: sadly all the older tags have been removed due to Docker Hub policy changes)