Nodata error at L4B Crop Type processing

I have problem with finshing L4B Crop Type processing. In the final processing stage I’m getting an error Exception: (‘Error running Nodata_34UEA’, 1). It happens when the last tile is being processed. I’m using Sen2Agri ver. 2.0.1. Does anyone have any suggestion to eliminate this problem?

Traceback (most recent call last):
File “/usr/local/bin/gdal_edit.py”, line 328, in
sys.exit(gdal_edit(sys.argv))
File “/usr/local/bin/gdal_edit.py”, line 227, in gdal_edit
ds = gdal.OpenEx(datasetname, gdal.OF_RASTER | gdal.OF_UPDATE, open_options=open_options)
AttributeError: ‘module’ object has no attribute ‘OpenEx’
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/sen2agri_common.py”, line 609, in execute
pool.map(self.internal_postprocess_tile, self.tiles)
File “/usr/lib64/python2.7/multiprocessing/pool.py”, line 250, in map
return self.map_async(func, iterable, chunksize).get()
File “/usr/lib64/python2.7/multiprocessing/pool.py”, line 554, in get
raise self._value
Exception: (‘Error running Nodata_34UEA’, 1)

I also have the same problem. These are the errors of mine.
Maybe this has something to do with the L4A as it used as a mask for the L4B product?

Executing Mask by crop mask 51QUV at 2019-11-30 23:17:54.156717
otbcli_BandMath -progress false -exp 'im2b1 == 0 ? 0 : im1b1' -il /mnt/archive/orchestrator_temp/l4b/252/65488-crop-type-fused/crop_type_map_51QUV.tif /mnt/archive/isabela19/l4a//S2AGRI_L4A_PRD_S6_20191018T180022_V20190707_20190925_NOTV/TILES/S2AGRI_L4A_V20190707_20190925_T51QUV/IMG_DATA/S2AGRI_L4A_CM_V20190707_20190925_T51QUV.TIF -out '/mnt/archive/orchestrator_temp/l4b/252/65488-crop-type-fused/crop_type_map_masked_51QUV.tif?gdal:co:COMPRESS=DEFLATE' int16
Mask by crop mask 51QUV done at 2019-11-30 23:18:04.849914. Duration: 0:00:10.693197
Executing Nodata_51QUV at 2019-11-30 23:18:04.850424
gdal_edit.py -a_nodata -10000 /mnt/archive/orchestrator_temp/l4b/252/65488-crop-type-fused/crop_type_map_masked_51QUV.tif
Mask by crop mask 51QUU done at 2019-11-30 23:18:05.543267. Duration: 0:00:11.387336
Executing Nodata_51QUU at 2019-11-30 23:18:05.543362
gdal_edit.py -a_nodata -10000 /mnt/archive/orchestrator_temp/l4b/252/65488-crop-type-fused/crop_type_map_masked_51QUU.tif
Error running Nodata_51QUV at 2019-11-30 23:18:07.463203. The call returned 1
Performing post-processing for tile: 51QVU
Executing Mask by crop mask 51QVU at 2019-11-30 23:18:07.463938
otbcli_BandMath -progress false -exp 'im2b1 == 0 ? 0 : im1b1' -il /mnt/archive/orchestrator_temp/l4b/252/65488-crop-type-fused/crop_type_map_51QVU.tif /mnt/archive/isabela19/l4a//S2AGRI_L4A_PRD_S6_20191018T180022_V20190707_20190925_NOTV/TILES/S2AGRI_L4A_V20190707_20190925_T51QVU/IMG_DATA/S2AGRI_L4A_CM_V20190707_20190925_T51QVU.TIF -out '/mnt/archive/orchestrator_temp/l4b/252/65488-crop-type-fused/crop_type_map_masked_51QVU.tif?gdal:co:COMPRESS=DEFLATE' int16
Processor finished in 7:59:31.054355
Error running Nodata_51QUU at 2019-11-30 23:18:07.674323. The call returned 1

Hello,

I have the same problem for some time now for various ‘sites’, I believe I updated the system to the latest version two times now, since I first encountered the ERROR. I started using tedious manual workarounds and was hoping this will be solved at some point. Has this issue ever been addressed? I’m still using v2.0.2 and didn’t upgrade to v2.0.3 yet so maybe it has been resolved, but the change log doesn’t suggest any significant bug fixes…

Best,
Sebastian

Hello @sbo,

Can you try the following solution below?

According to @cudroiu:

"An workaround to solve the issue, you can remove the following file (or rename it) /usr/local/bin/gdal_edit.py:

sudo mv /usr/local/bin/gdal_edit.py /usr/local/bin/gdal_edit.py1

The problem is that some GDAL Python tools will pick the wrong GDAL version.

Hope this helps."

Hello @brentf.

Thanks for the hint, this seems to work!

Best regards,
Sebastian