ProductSet-Reader fails with gpt command line utility

Dear S1TBX developers,

I wrote a simple graph that consists only of three commands: ProductSet-Reader, CreateStack and Write
When I execute it in SNAP GUI everything works fine but in gpt I get a WriteOP error:

/opt/snap/bin/gpt /tmp/GRDH2Sigma_tmp1.xml

SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
INFO: org.geotools.referencing.factory.epsg.ThreadedEpsgFactory: Setting the EPSG factory org.geotools.referencing.factory.epsg.DefaultFactory to a 1800000ms timeout
INFO: org.geotools.referencing.factory.epsg.ThreadedEpsgFactory: Setting the EPSG factory org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory to a 1800000ms timeout
INFO: org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory: Building new data source for org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory
INFO: org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory: Building backing store for org.geotools.referencing.factory.epsg.ThreadedHsqlEpsgFactory

Error: Operator ‘WriteOp’: Mandatory source product (field ‘sourceProduct’) not set.

Thank you for any kind of help with this problem,

Jan Musial

s1tbx info:

Product Version: SNAP 201411181905
Java: 1.8.0_45; Java HotSpot™ 64-Bit Server VM 25.45-b02
Runtime: Java™ SE Runtime Environment 1.8.0_45-b14
System: Linux version 3.13.0-57-generic running on amd64; UTF-8; en_gb (snap)

system info:

LSB Version:
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 14.04.2 LTS
Release: 14.04
Codename: trusty

Dear S1TBX developers,

Has this issue been resolved in the newest version or is there some simple solution I can apply? I am struggling with the same ‘sourceProduct not set’-error.

Thank you.

In the graph there is a parameter for fileList. This could be a list of file paths separated by commas or a folder.
If a folder is specified it will use every product it can find within that folder.

<parameters>
      <fileList>E:\mydata\</fileList>
</parameters>

You could also put a variable ${inputFolder}

<parameters><fileList>${inputFolder}</fileList></parameters>

and then replace that variable from the command line

gpt mygraph.xml -PinputFolder=“e:\mydata”

2 Likes

I still get this problem, with the correct implementation of inputfolders. I use the snap2.0 gpt version:

Error: Operator ‘WriteOp’: Mandatory source product (field ‘sourceProduct’) not set.

One thing I discovered was that it matters in which way the operators in the “xml” graph file are sequenced. My product Set reader was located at the end of my “xml” graph file and it gave the aforementioned error. After having relocated this operator to the top of my “xml” graph file it worked perfectly.

1 Like

Are you saying that the order in which nodes are specified in a graph file matters? I was under the impression that, as long as you keep the routing correct, the orer of the nodes in the xml are irrelevant. CAn the developers please comment on this?

1 Like

I can confirm the issue using the most recent version of SNAP (5.0.4).
You can find the same graph with the ProductSet-Reader in the beginning and in the end.
coregistration-works_not.xml (1.7 KB)
coregistration-works.xml (1.7 KB)
When the ProductSet-Reader node is placed as last node within the xml (xml creation done by snap), gpt will give the previously mentioned error:

org.esa.snap.core.gpf.graph.GraphException: [NodeId: WriteOp@ProductSet-Reader] Operator ‘WriteOp’: Mandatory source product (field ‘sourceProduct’) not set.
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:79)
at org.esa.snap.core.gpf.graph.GraphContext.initNodeContext(GraphContext.java:195)
at org.esa.snap.core.gpf.graph.GraphContext.initOutput(GraphContext.java:162)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:91)
at org.esa.snap.core.gpf.graph.GraphContext.(GraphContext.java:64)
at org.esa.snap.core.gpf.graph.GraphProcessor.executeGraph(GraphProcessor.java:130)
at org.esa.snap.core.gpf.main.DefaultCommandLineContext.executeGraph(DefaultCommandLineContext.java:86)
at org.esa.snap.core.gpf.main.CommandLineTool.executeGraph(CommandLineTool.java:534)
at org.esa.snap.core.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:388)
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:54)
at org.esa.snap.core.gpf.main.GPT.main(GPT.java:34)
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 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 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 com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:62)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)
Caused by: org.esa.snap.core.gpf.OperatorException: Operator ‘WriteOp’: Mandatory source product (field ‘sourceProduct’) not set.
at org.esa.snap.core.gpf.internal.OperatorContext.processSourceProductField(OperatorContext.java:938)
at org.esa.snap.core.gpf.internal.OperatorContext.initSourceProductFields(OperatorContext.java:902)
at org.esa.snap.core.gpf.internal.OperatorContext.initSourceProductFields(OperatorContext.java:894)
at org.esa.snap.core.gpf.internal.OperatorContext.initializeOperator(OperatorContext.java:482)
at org.esa.snap.core.gpf.internal.OperatorContext.getTargetProduct(OperatorContext.java:273)
at org.esa.snap.core.gpf.Operator.getTargetProduct(Operator.java:387)
at org.esa.snap.core.gpf.graph.NodeContext.initTargetProduct(NodeContext.java:77)
… 27 more

Error: [NodeId: WriteOp@ProductSet-Reader] Operator ‘WriteOp’: Mandatory source product (field ‘sourceProduct’) not set.

4 Likes

I can confirm that moving the ProductSet-Reader to the top resolves the WriteOp issue in SNAP 5.0.7.

3 Likes

I confirm that too! It is strange! For me while the reid of the Back-geocoding node is set to ProductSet-Reader the position of the ProductSet-Reader has no importance.
Thank you for the information!

This is the solution. You have to put the “Product Set Reader” manually into top of xml code.
Thanks!