'NoneType' object has no attribute 'box_id'

When using SEN2COR 2.8 I receive this error message both on SNAP/Windows when using the SEN2COR plugin and as a standalone processing on LINUX. I do not apply to all tiles.
Anybody know how to solve this or what kind of error of it is.

Regards
/Jonas

WINDOWS 10

> Progress[%]: 26.56 : PID-21240, L2A_Tables: band VIS exported, elapsed time[s]: 0.637, total: 0:09:28.249000
> 'NoneType' object has no attribute 'box_id'
> Traceback (most recent call last):
>   File "C:\Users\jonas.ardo\.snap\auxdata\Sen2Cor-02.08.00-win64\Lib\site-packages\sen2cor\L2A_Tables.py", line 2701, in createRgbImages
>     self.glymurWrapper(pvi, dstack((r, g, b)))
>   File "C:\Users\jonas.ardo\.snap\auxdata\Sen2Cor-02.08.00-win64\Lib\site-packages\sen2cor\L2A_Tables.py", line 2616, in glymurWrapper
>     jp2_L2A.wrap(file_L2A_geo, boxes=boxes_L2A)
>   File "C:\Users\jonas.ardo\.snap\auxdata\Sen2Cor-02.08.00-win64\lib\site-packages\glymur\jp2k.py", line 866, in wrap
>     self._validate_jp2_box_sequence(boxes)
>   File "C:\Users\jonas.ardo\.snap\auxdata\Sen2Cor-02.08.00-win64\lib\site-packages\glymur\jp2k.py", line 1680, in _validate_jp2_box_sequence
>     self._validate_jp2h(boxes)
>   File "C:\Users\jonas.ardo\.snap\auxdata\Sen2Cor-02.08.00-win64\lib\site-packages\glymur\jp2k.py", line 1748, in _validate_jp2h
>     self._check_jp2h_child_boxes(boxes, 'top-level')
>   File "C:\Users\jonas.ardo\.snap\auxdata\Sen2Cor-02.08.00-win64\lib\site-packages\glymur\jp2k.py", line 1800, in _check_jp2h_child_boxes
>     box_ids = set([box.box_id for box in boxes])
> AttributeError: 'NoneType' object has no attribute 'box_id'
> PVI image export failed
> Progress[%]: 26.57 : PID-21240, L2A_Tables: PVI image export failed, elapsed time[s]: 0.241, total: 0:09:28.490000

On LINUX:

Progress[%]: 15.92 : PID-100353, L2A_Tables: band VIS exported, elapsed time[s]: 3.155, total: 0:10:48.520470

‘NoneType’ object has no attribute ‘box_id’
Traceback (most recent call last):
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Tables.py”, line 2701, in createRgbImages
self.glymurWrapper(pvi, dstack((r, g, b)))
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Tables.py”, line 2616, in glymurWrapper
jp2_L2A.wrap(file_L2A_geo, boxes=boxes_L2A)
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 866, in wrap
self._validate_jp2_box_sequence(boxes)
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1680, in _validate_jp2_box_sequence
self._validate_jp2h(boxes)
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1748, in _validate_jp2h
self._check_jp2h_child_boxes(boxes, ‘top-level’)
File “/projects/eko/fs3/nateko/bin/Sen2Cor-02.08.00-Linux64/lib/python2.7/site-packages/glymur/jp2k.py”, line 1800, in _check_jp2h_child_boxes
box_ids = set([box.box_id for box in boxes])
AttributeError: ‘NoneType’ object has no attribute ‘box_id’
PVI image export failed
Progress[%]: 16.06 : PID-100353, L2A_Tables: PVI image export failed, elapsed time[s]: 5.546, total: 0:10:54.066424

AttributeError means that there was an Error that had to do with an Attribute request. In general, when you write x.y, y is the purported attribute of x. NoneType means that instead of an instance of whatever Class or Object you think you’re working with, you’ve actually got None. That usually means that an assignment or function call up failed or returned an unexpected result.

mylist = mylist.sort()

The sort() method of a list sorts the list in-place, that is, mylist is modified. But the actual return value of the method is None and not the list sorted. So you’ve just assigned None to mylist. If you next try to do, say, mylist.append(1) Python will give you this error.

Dear @Ardo,

After analysis, the potential cause behind your issue is that you were trying to process a L1C product with missing PVI. The L1C PVI (located in the GRANULE QI_DATA folder) is a mandatory input for Sen2Cor to operate successfully without warnings.

You could try to redownload the L1C product.

@Sen2Cor_Dev_Team

May I ask when the 2.12 version of Sen2cor will be released? Becuase the 2023 product (S2) seems to have poor processing performance with version 2.10 of sen2cor. Can you give me some advice on processors for S2 products after 2023?

@blair Maybe @Sen2Cor_Dev_Team can help you with this information

Dear @blair,

Welcome to the STEP Sen2Cor community!

To provide you with a better support we would recommend you to open a dedicated ticket, describing more precisely the issues you are facing in terms of data processing or data quality.

You may found useful information on these two pages: Frequently Asked Questions and Sen2Cor reference page.

When opening a ticket:

Please try to follow the format below by providing (this format will help Devs to better support your request):

Information on the version of Sen2Cor in use
Information on the platform (linux, windows)
Command lines used (e.g. options used, etc. etc.)
Log that results from running the L1C product on your version of Sen2Cor
L2A_GIPP.xml file
L1C product full name (e.g. S2B_MSIL1C_20220304T071159_N0400_R020_T38LRH_20220713T214644.SAFE)
Any information that may be useful

Example of a ticket’s title:
[Sen2Cor version][linux] problem/question

Cheers,
@Sen2cor_dev_team

[Sen2Cor 2.10]
[Windows 10]
Command lines used :L2A_Process --resolution 10 (or 20)
L1C product full name:
F:\Part2\2.10versionSencor\S2B_MSIL1C_20230415T031519_N0509_R118_T49RCQ_20230415T050850.SAFE
Log and L2A_GIPP.xml file please refer to the attachment.
the problem : When I processed the image (2023) using version 2.10, I found that the B4-B7 in the water body showed an upward trend. This seems to be inconsistent with the reflectivity characteristics of water bodies. I’m not sure if it’s a processor issue (lower version) or a problem with the image itself. Because the LOG showed Product versions > 14.9 are not implemented yet for the 2023 images, Version 14.9 will be used by default, but warnings during validation might occur.
L2A_GIPP.xml (8.6 KB)
attachment.docx (452.1 KB)

After processing, the data for 2022 image appears to match the characteristics of the water body. Therefore, I once again doubt whether the processor with low version caused abnormal band characteristics. Can you help me test the effectiveness of Sen2cor 2.10 in processing 2023 data? Please give me some suggestions.

Dear @blair,

It looks your request is related to atmospheric correction over water surfaces. Sen2Cor processor is dedicated to atmospheric correction processing over land surfaces and is therefore not really adapted to retrieve accurate water properties.

If you are interested in performing more accurate atmospheric correction over water surfaces, we would recommend you to the following paper which compares different processors dedicated to atmospheric correction over water: ACIX-Aqua: A global assessment of atmospheric correction methods for Landsat-8 and Sentinel-2 over lakes, rivers, and coastal waters - ScienceDirect

If you want to test quickly on your images, as an example, the following processor may be one of the easier to set up and use: GitHub - acolite/acolite: ACOLITE: generic atmospheric correction module

We hope you find these suggestions useful.

Cheers,
@Sen2cor_dev_team