java.lang.IllegalArgumentException: expression: Undefined symbol 'geometry_1'

Hi,
after searching the forum for a similar java.lang error I couldn’t find one that relates to geometry.
I am using a Sentinel-2 product and after resampling and subsetting it, I created three new bands using Maths Bands and save it as .dim file. Then, I accidentally created a New Vector Data Container with the default name ‘geometry_1’ but I am not sure if I draw a polygon in that new Vector Data. As it was an unnecessary layer I immediately deleted it and saved the product again as .dim file. Now, opening the product again and trying to create an RGB image or even open a single band or just anything I am getting the following message which is caused because of that false geometry. Is there a work around to fix this issue or is the product damaged?


org.esa.snap.core.jexp.ParseException: Undefined symbol ‘geometry_1’.
at org.esa.snap.core.jexp.impl.ParserImpl.reportError(ParserImpl.java:1036)
at org.esa.snap.core.jexp.impl.ParserImpl.parseCallOrRef(ParserImpl.java:722)
at org.esa.snap.core.jexp.impl.ParserImpl.parsePrimary(ParserImpl.java:678)
at org.esa.snap.core.jexp.impl.ParserImpl.parsePostfix(ParserImpl.java:637)
at org.esa.snap.core.jexp.impl.ParserImpl.parseUnary(ParserImpl.java:624)
at org.esa.snap.core.jexp.impl.ParserImpl.parseMul(ParserImpl.java:530)
at org.esa.snap.core.jexp.impl.ParserImpl.parseAdd(ParserImpl.java:487)
at org.esa.snap.core.jexp.impl.ParserImpl.parseBitwiseAnd(ParserImpl.java:461)
at org.esa.snap.core.jexp.impl.ParserImpl.parseBitwiseXOr(ParserImpl.java:434)
at org.esa.snap.core.jexp.impl.ParserImpl.parseBitwiseOr(ParserImpl.java:408)
at org.esa.snap.core.jexp.impl.ParserImpl.parseComparison(ParserImpl.java:319)
at org.esa.snap.core.jexp.impl.ParserImpl.parseLogicalAnd(ParserImpl.java:286)
at org.esa.snap.core.jexp.impl.ParserImpl.parseLogicalOr(ParserImpl.java:259)
at org.esa.snap.core.jexp.impl.ParserImpl.parseConditional(ParserImpl.java:230)
at org.esa.snap.core.jexp.impl.ParserImpl.parseAssign(ParserImpl.java:179)
at org.esa.snap.core.jexp.impl.ParserImpl.parseTerm(ParserImpl.java:168)
at org.esa.snap.core.jexp.impl.ParserImpl.parseImpl(ParserImpl.java:150)
at org.esa.snap.core.jexp.impl.ParserImpl.parse(ParserImpl.java:136)
at org.esa.snap.core.jexp.impl.ParserImpl.parse(ParserImpl.java:115)
at org.esa.snap.core.dataop.barithm.BandArithmetic.parseExpression(BandArithmetic.java:116)
at org.esa.snap.core.image.VirtualBandOpImage.parseExpression(VirtualBandOpImage.java:106)
Caused: java.lang.IllegalArgumentException: expression: Undefined symbol ‘geometry_1’.
at org.esa.snap.core.image.VirtualBandOpImage.parseExpression(VirtualBandOpImage.java:108)
at org.esa.snap.core.image.VirtualBandOpImage.parseExpression(VirtualBandOpImage.java:94)
at org.esa.snap.core.datamodel.VirtualBand.createSourceImage(VirtualBand.java:259)
at org.esa.snap.core.datamodel.Mask$BandMathsType.createImage(Mask.java:251)
at org.esa.snap.core.datamodel.Mask.createSourceImage(Mask.java:128)
at org.esa.snap.core.datamodel.RasterDataNode.getSourceImage(RasterDataNode.java:2162)
at org.esa.snap.core.layer.MaskLayerType.createMultiLevelSource(MaskLayerType.java:81)
at org.esa.snap.core.layer.MaskLayerType.createMultiLevelSource(MaskLayerType.java:77)
at org.esa.snap.core.layer.MaskLayerType.createLayer(MaskLayerType.java:63)
at org.esa.snap.core.layer.MaskLayerType.createLayer(MaskLayerType.java:52)
at org.esa.snap.ui.product.ProductSceneImage.createMaskCollectionLayer(ProductSceneImage.java:338)
at org.esa.snap.ui.product.ProductSceneImage.getMaskCollectionLayer(ProductSceneImage.java:184)
at org.esa.snap.ui.product.ProductSceneView.getMaskCollectionLayer(ProductSceneView.java:1242)
at org.esa.snap.ui.product.ProductSceneView.setMaskOverlayEnabled(ProductSceneView.java:619)
at org.esa.snap.ui.product.ProductSceneView.(ProductSceneView.java:272)
[catch] at org.esa.snap.rcp.actions.window.OpenImageViewAction$1.done(OpenImageViewAction.java:223)
at javax.swing.SwingWorker$5.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
at sun.swing.AccumulativeRunnable.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

I hope there is a solution and I apologize for the long report.
Thank you.

From the exception you get, I assume that somehow ‘geometry_1’ still remained in one of the Band Math expressions, you deleted ‘geometry_1’ and now that expression cannot be parsed/evaluated.
In other words, you still have a virtual band in your product, created with Band Math, that uses ‘geometry_1’ in its expression.

Well, thank you for your reply :grinning:. Your answer really help me. It seamed that a mask and not a Band Math was using the ‘geometry_1’. Deleting it resulted in solving the problem. Sacrificing a mask was way better than losing the whole product!
Consider as solved!