mzmine / mzmine

mzmine source code repository
https://mzmine.github.io/mzmine_documentation/
MIT License
195 stars 128 forks source link

`-batch` failing when DISPLAY is not defined (headless HPC cluster) #1658

Open truatpasteurdotfr opened 9 months ago

truatpasteurdotfr commented 9 months ago

Basic information

What happened

MZmine_Linux_portable_3.9.0/bin/MZmine   -batch workflow_complete_batch_short.xml 

fails to complete when DISPLAY is undefined (slurm batch mode, or interactive ssh without X forwarding)

relevant part of xml:

    <batchstep method="io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalModule" parameter_version="1">
        <parameter name="Feature lists" type="NAME_PATTERN">
            <name_pattern>*FINALS_MERGED*</name_pattern>
        </parameter>
        <parameter name="Export directory">/pasteur/appa/scratch/test_ameng/out/graphics</parameter>
        <parameter name="Number of matches to export">2</parameter>
        <parameter name="DPI scaling factor">4</parameter>
        <parameter name="Export spectral library matches">false</parameter>
        <parameter name="Export lipid matches">false</parameter>
        <parameter name="Export shapes">true</parameter>
        <parameter name="Export mobilograms">false</parameter>
        <parameter name="Export feature images">false</parameter>
        <parameter name="Export pdf">false</parameter>
        <parameter name="Export png (⚠ freezes GUI)">true</parameter>
        <parameter name="Chart export parameters">
            <parameter name="Path">
                <current_file>/pasteur/appa/scratch/test_ameng/out/graphics</current_file>
                <last_file>/pasteur/appa/scratch/test_ameng/out/graphics</last_file>
            </parameter>
....

error listed:

...
2024-02-20 15:22:45 FINEST io.github.mzmine.taskcontrol.impl.TaskQueue addWrappedTask Adding task "Exporting all identifications." to the task controller queue
2024-02-20 15:22:45 INFO   io.github.mzmine.taskcontrol.impl.WorkerThread run Starting processing of task Exporting all identifications.
2024-02-20 15:22:45 WARNING com.sun.javafx.application.PlatformImpl startup Unsupported JavaFX configuration: classes were loaded from 'unnamed module @24429cc8'
2024-02-20 15:22:45 SEVERE io.github.mzmine.taskcontrol.impl.WorkerThread run Unhandled exception java.lang.UnsupportedOperationException: Unable to open DISPLAY while processing task Exporting all identifications.
java.lang.UnsupportedOperationException: Unable to open DISPLAY
        at com.sun.glass.ui.gtk.GtkApplication.lambda$new$6(GtkApplication.java:173)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:171)
        at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
        at com.sun.glass.ui.Application.run(Application.java:144)
        at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:280)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:288)
        at javafx.application.Platform.startup(Platform.java:111)
        at io.github.mzmine.main.MZmineCore.initJavaFxInHeadlessMode(MZmineCore.java:622)
        at io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalTask.run(ExportAllIdsGraphicalTask.java:145)
        at io.github.mzmine.taskcontrol.impl.WorkerThread.run(WorkerThread.java:64)

java.lang.UnsupportedOperationException: Unable to open DISPLAY
        at com.sun.glass.ui.gtk.GtkApplication.lambda$new$6(GtkApplication.java:173)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
        at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:171)
        at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
        at com.sun.glass.ui.Application.run(Application.java:144)
        at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:280)
        at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:288)
        at javafx.application.Platform.startup(Platform.java:111)
        at io.github.mzmine.main.MZmineCore.initJavaFxInHeadlessMode(MZmineCore.java:622)
        at io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalTask.run(ExportAllIdsGraphicalTask.java:145)
        at io.github.mzmine.taskcontrol.impl.WorkerThread.run(WorkerThread.java:64)
2024-02-20 15:22:45 SEVERE io.github.mzmine.gui.HeadLessDesktop displayErrorMessage Unhandled exception in task Exporting all identifications.: java.lang.UnsupportedOperationException: Unable to open DISPLAY (GtkApplication.java:173)
truatpasteurdotfr commented 9 months ago
truatpasteurdotfr commented 9 months ago

I have also been unsuccessful by trying to use a virtual framebuffer provided inside a debian 12 container:

[tru@maestro-submit test_ameng]$ apptainer exec  -B `mktemp -d`:/var/lib/xkb/ /pasteur/appa/homes/tru/singularity.d/containers/debian12-xvfb-2024-02-21-1404.sif xvfb-run -a ~/APPASCRATCH/build/MZmine_Linux_portable_3.9.0/bin/MZmine   -batch workflow_complete_batch_short.xml

but the error message is now:

2024-02-21 13:10:33 INFO   io.github.mzmine.modules.batchmode.BatchTask processQueueStep Starting step # 24
2024-02-21 13:10:33 FINEST io.github.mzmine.modules.batchmode.BatchTask processQueueStep Module Annotations graphics export (pdf, png) called at 2024-02-21T13:10:33.787007714Z
2024-02-21 13:10:33 FINEST io.github.mzmine.taskcontrol.impl.TaskQueue addWrappedTask Adding task "Exporting all identifications." to the task controller queue
2024-02-21 13:10:33 INFO   io.github.mzmine.taskcontrol.impl.WorkerThread run Starting processing of task Exporting all identifications.
2024-02-21 13:10:33 WARNING com.sun.javafx.application.PlatformImpl startup Unsupported JavaFX configuration: classes were loaded from 'unnamed module @62317b69'

(process:4124482): Gtk-WARNING **: 14:10:33.934: Locale not supported by C library.
        Using the fallback 'C' locale.
2024-02-21 13:10:34 SEVERE io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalTask run Cannot export graphics for lipids and spectral matches  Not on FX application thread; currentThread = Thread executing task Exporting all identifications.
java.lang.IllegalStateException: Not on FX application thread; currentThread = Thread executing task Exporting all identifications.
        at com.sun.javafx.tk.Toolkit.checkFxUserThread(Toolkit.java:292)
        at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(QuantumToolkit.java:446)
        at javafx.stage.Stage.<init>(Stage.java:254)
        at javafx.stage.Stage.<init>(Stage.java:240)
        at io.github.mzmine.parameters.dialogs.EmptyParameterSetupDialogBase.<init>(EmptyParameterSetupDialogBase.java:91)
        at io.github.mzmine.parameters.dialogs.ParameterSetupDialog.<init>(ParameterSetupDialog.java:57)
        at io.github.mzmine.parameters.dialogs.ParameterSetupDialog.<init>(ParameterSetupDialog.java:52)
        at io.github.mzmine.parameters.dialogs.ParameterSetupDialog.<init>(ParameterSetupDialog.java:43)
        at io.github.mzmine.gui.chartbasics.graphicsexport.GraphicsExportDialogFX.<init>(GraphicsExportDialogFX.java:64)
        at io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalTask.lambda$exportPdfAndPng$2(ExportAllIdsGraphicalTask.java:260)
        at io.github.mzmine.util.javafx.FxThreadUtil.runOnFxThreadAndWait(FxThreadUtil.java:46)
        at io.github.mzmine.main.MZmineCore.runOnFxThreadAndWait(MZmineCore.java:593)
        at io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalTask.exportPdfAndPng(ExportAllIdsGraphicalTask.java:259)
        at io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalTask.exportChromatograms(ExportAllIdsGraphicalTask.java:224)
        at io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalTask.exportFeatureCharts(ExportAllIdsGraphicalTask.java:189)
        at io.github.mzmine.modules.io.export_features_all_speclib_matches.ExportAllIdsGraphicalTask.run(ExportAllIdsGraphicalTask.java:162)
        at io.github.mzmine.taskcontrol.impl.WorkerThread.run(WorkerThread.java:64)

2024-02-21 13:10:34 INFO   io.github.mzmine.taskcontrol.impl.WorkerThread run Processing of task Exporting all annotations. 3/3411 done, status FINISHED
2024-02-21 13:10:34 INFO   io.github.mzmine.modules.batchmode.BatchTask run Finished a batch of 24 steps