NullPointerException during Apply-Orbit-File in SNAP 10

Hello, we’re running into a NPE during some Sentinel-1 graph processing and were hoping to get some debugging tips.

We have a product that we run toolbox on a few times per day as part of an integration test of our batch processing system that handles all newly-discovered Sentinel-1 products, and prior to version 10 our test would either succeed or time out. When we upgraded, we get this instead:

org.esa.snap.core.gpf.graph.GraphException: [NodeId: Apply-Orbit-File] java.lang.NullPointerException
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:79)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:199)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:182)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:182)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:182)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:182)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:182)
at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:166)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:85)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:58)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:127)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86)
at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:547)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:391)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:287)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:188)
at org.esa.snap.core.gpf.main.CommandLineTool.run(CommandLineTool.java:121)
at org.esa.snap.core.gpf.main.GPT.run(GPT.java:60)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:37)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.esa.snap.runtime.Launcher.lambda$run$0(Launcher.java:55)
at org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)
at org.esa.snap.runtime.Launcher.run(Launcher.java:51)
at org.esa.snap.runtime.Launcher.main(Launcher.java:31)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)
at com.install4j.runtime.launcher.UnixLauncher.start(UnixLauncher.java:71)
at install4j.org.esa.snap.runtime.Launcher_gpt.main(Unknown Source)
Caused by: org.esa.snap.core.gpf.OperatorException: java.lang.NullPointerException
at org.esa.snap.engine_utilities.gpf.OperatorUtils.catchOperatorException(OperatorUtils.java:434)
at eu.esa.sar.orbits.gpf.ApplyOrbitFileOp.initialize(ApplyOrbitFileOp.java:215)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:528)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:298)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:359)
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77)
… 33 more
Caused by: java.lang.NullPointerException
at eu.esa.sar.orbits.gpf.ApplyOrbitFileOp.getTiePointGrid(ApplyOrbitFileOp.java:227)
at eu.esa.sar.orbits.gpf.ApplyOrbitFileOp.initialize(ApplyOrbitFileOp.java:197)
… 37 more

This happens in the desktop tool, as well. This is the very first step in our graph, so the relevant nodes look like:

<graph id="Graph">
<version>1.0</version>
<node id="Read">
<operator>Read</operator>
<sources/>
<parameters class="com.bc.ceres.binding.dom.XppDomElement">
<file>/tmp/tmp7tp7_31s_input/S1A_EW_GRDM_1SDH_20240410T082934_20240410T083034_053369_0678E9_F0D4.SAFE/manifest.safe</file>
</parameters>
</node>
<node id="Apply-Orbit-File">
<operator>Apply-Orbit-File</operator>
<sources>
<sourceProduct refid="Read"/>
</sources>
<parameters class="com.bc.ceres.binding.dom.XppDomElement">
<orbitType>Sentinel Restituted (Auto Download)</orbitType>
<polyDegree>3</polyDegree>
<continueOnFail>false</continueOnFail>
</parameters>
</node>

The corresponding orbit files are S1A_OPER_AUX_RESORB_OPOD_20240410T115440_V20240410T080004_20240410T111734.EOF and S1A_OPER_AUX_RESORB_OPOD_20240410T101747_V20240410T062119_20240410T093849.EOF. These are placed in a temp directory alongside the product input, like /tmp/tmp7tp7_31s_input/S1A_EW_GRDM_1SDH_20240410T082934_20240410T083034_053369_0678E9_F0D4/RESORB.

Any ideas what we should try next?

Try manually setting the orbit file path instead of relying on auto-download.
Ensure the product and SAFE file are valid (no corruption).
Add a check to see if the tie point grid is null in ApplyOrbitFileOp.
Test without the Apply-Orbit-File node to isolate the issue.
The update might be buggy—try reverting to the previous version.

How do you set the orbit files? I don’t see such an option in the Apply-Orbit-File parameters. Or does the stage know what to do if they’re included in the sources?

We’ve already reverted to 9.0.0 since that works as-is.

Checked that we were caching files in the right place:

Copying orbit file from (source) to /tmp/tmpicetktze_input/.snap/auxdata/Orbits/Sentinel-1/RESORB/S1A/2024/04/S1A_OPER_AUX_RESORB_OPOD_20240410T115440_V20240410T080004_20240410T111734.EOF
Copying orbit file from (source) to /tmp/tmpicetktze_input/.snap/auxdata/Orbits/Sentinel-1/RESORB/S1A/2024/04/S1A_OPER_AUX_RESORB_OPOD_20240410T101747_V20240410T062119_20240410T093849.EOF

In this example, snap/bin/gpt is located in /tmp/tmpicetktze_input, as well, so I believe the relative path is correct. We still get the same exception.