Sen2cor 2.11 - AttributeError: ‘bool’ object has no attribute ‘SPACECRAFT_NAME’

I use sen2cor 2.11.00 to correct some Sentinel-2 images atmospherically via Python on windows. The problem is that for some recent images (in July/2024) I got the following error. For other images (taken one year before), it worked fine.

S2A_MSIL1C_20240728T090601_N0511_R050_T34SFJ_20240728T125237 ATCOR
wrong identifier for xml structure.
unspecific error in metadata
wrong identifier for xml structure.
error in copying metadata files to target product
Sen2Cor. Version: 02.11.00, created: 2022.10.20, supporting Level-1C product version 14.2 - 14.9 started …
Product version: 15.0
Operation mode: TOOLBOX
Processing baseline: 99.99
Progress[%]: 0.00 : Generating datastrip metadata
unspecific error in metadata
Incorrect datastrip L1C xml format
Traceback (most recent call last):
File “C:\Sen2Cor-02.11.00-win64\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Process.py”, line 734, in
sys.exit(main())
File “C:\Sen2Cor-02.11.00-win64\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Process.py”, line 679, in main
L2A_TILES = config.updateTiles()
File “C:\Sen2Cor-02.11.00-win64\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Config.py”, line 4015, in updateTiles
if self.create_L2A_Tile():
File “C:\Sen2Cor-02.11.00-win64\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Config.py”, line 4040, in create_L2A_Tile
self.getEntriesFromDatastrip()
File “C:\Sen2Cor-02.11.00-win64\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Config.py”, line 3968, in getEntriesFromDatastrip
self.spacecraftName = di.SPACECRAFT_NAME.text
AttributeError: ‘bool’ object has no attribute ‘SPACECRAFT_NAME’

I have checked other relevant posts such as https://forum.step.esa.int/t/sen2cor-2-8-fails-on-product-from-early-2016-bool-object-has-no-attribute-spacecraft-name/16046, https://gis.stackexchange.com/questions/335665/sen2cor-l2a-process-not-working-returns-strange-error without success. They solutions are related to older versions of Sen2cor. Any idea?

Please have a look at this post Sen2cor supporting processing baseline 05.11 - #3 by Sen2cor_dev_team

1 Like

Thanks a lot for your quick reply!

Dear, all,
I am running Sen2Cor v2.12.03 on a Docker container based on the image condaforge/mambaforge:24.9.0-0 (Ubuntu). If I try to use the new Sentinel-2 images, I receive the same error:

Traceback (most recent call last):
  File "/opt/sen2cor/lib/python2.7/site-packages/sen2cor/L2A_Process.py", line 734, in <module>
    sys.exit(main())
  File "/opt/sen2cor/lib/python2.7/site-packages/sen2cor/L2A_Process.py", line 679, in main
    L2A_TILES = config.updateTiles()
  File "/opt/sen2cor/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 4029, in updateTiles
    if self.create_L2A_Tile():
  File "/opt/sen2cor/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 4054, in create_L2A_Tile
    self.getEntriesFromDatastrip()
  File "/opt/sen2cor/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 3982, in getEntriesFromDatastrip
    self.spacecraftName = di.SPACECRAFT_NAME.text
AttributeError: 'bool' object has no attribute 'SPACECRAFT_NAME'

Could you help me?

Thank you for your help.

Dear @aurgs,

Welcome to this forum,

Could you please open a new ticket and attach the full log of your Sen2Cor processing (including the execution command with S2 L1C Product name) and check if you are using the correct updated L2A_GIPP ? You can attach your L2A_GIPP used to the ticket.

Cheers,
@Sen2cor_dev_team

Was there ever any resolution to this issue? I haven’t used SNAP and Sen2Core for a while and am getting this same error while trying to process S2 L1C images.
(using SNAP 9.0.0 and Sen2Cor 2.11.0)

Hello,

I am getting the same Sen2Cor error on a Sentinel-2C Level-1C product, yet with a newser Sen2Cor Version.

Environment

  • Sen2Cor version: 2.12.04

  • OS: Linux

  • Input product: S2C_MSIL1C_20260220T095031_N0512_R079_T33UXQ_20260220T114831.SAFE

Error Message

Traceback (most recent call last):
  File "/home/force/Sen2Cor-02.12.04-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Process.py", line 734, in <module>
    sys.exit(main())
  File "/home/force/Sen2Cor-02.12.04-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Process.py", line 679, in main
    L2A_TILES = config.updateTiles()
  File "/home/force/Sen2Cor-02.12.04-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 4029, in updateTiles
    if self.create_L2A_Tile():
  File "/home/force/Sen2Cor-02.12.04-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 4054, in create_L2A_Tile
    self.getEntriesFromDatastrip()
  File "/home/force/Sen2Cor-02.12.04-Linux64/lib/python2.7/site-packages/sen2cor/L2A_Config.py", line 3982, in getEntriesFromDatastrip
    self.spacecraftName = di.SPACECRAFT_NAME.text
AttributeError: 'bool' object has no attribute 'SPACECRAFT_NAME'

Checks already done

The datastrip XML exists:

…/S2C_MSIL1C_20260220T095031_N0512_R079_T33UXQ_20260220T114831.SAFE/DATASTRIP/DS_2CPS_20260220T114831_S20260220T095033/MTD_DS.xml

XML is well-formed:

xmllint --noout "$SAFE"/DATASTRIP/*/MTD_DS*.xml

This returns no error.

The datastrip metadata contains SPACECRAFT_NAME:

<n1:General_Info>
<Datatake_Info datatakeIdentifier=“GS2C_20260220T095031_007628_N05.12” metadataLevel=“Brief”>
<SPACECRAFT_NAME>Sentinel-2C</SPACECRAFT_NAME>
<DATATAKE_TYPE>INS-NOBS</DATATAKE_TYPE>
<DATATAKE_SENSING_START>2026-02-20T09:50:31.025Z</DATATAKE_SENSING_START>
<SENSING_ORBIT_NUMBER>79</SENSING_ORBIT_NUMBER>
<SENSING_ORBIT_DIRECTION>DESCENDING</SENSING_ORBIT_DIRECTION>
</Datatake_Info>
<Datastrip_Time_Info metadataLevel=“Brief”>
<DATASTRIP_SENSING_START>2026-02-20T09:50:33.462Z</DATASTRIP_SENSING_START>
<DATASTRIP_SENSING_STOP>2026-02-20T09:57:10.317Z</DATASTRIP_SENSING_STOP>
</Datastrip_Time_Info>
<Processing_Info metadataLevel=“Expertise”>
<PROCESSING_BASELINE>05.12</PROCESSING_BASELINE>
<PRODUCT_DOI>
</PRODUCT_DOI>
<PROCESSING_CENTER>2CPS</PROCESSING_CENTER>
<UTC_DATE_TIME>2026-02-20T11:48:31Z</UTC_DATE_TIME>
</Processing_Info>
</n1:General_Info>

The product structure looks normal; find "$SAFE/DATASTRIP" -type f shows:

…/DATASTRIP/DS_2CPS_20260220T114831_S20260220T095033/MTD_DS.xml
…/DATASTRIP/DS_2CPS_20260220T114831_S20260220T095033/QI_DATA/FORMAT_CORRECTNESS.xml
…/DATASTRIP/DS_2CPS_20260220T114831_S20260220T095033/QI_DATA/GENERAL_QUALITY.xml
…/DATASTRIP/DS_2CPS_20260220T114831_S20260220T095033/QI_DATA/GEOMETRIC_QUALITY.xml
…/DATASTRIP/DS_2CPS_20260220T114831_S20260220T095033/QI_DATA/RADIOMETRIC_QUALITY.xml
…/DATASTRIP/DS_2CPS_20260220T114831_S20260220T095033/QI_DATA/SENSOR_QUALITY.xml

This makes me think the issue is not a missing SPACECRAFT_NAME tag, but that Sen2Cor’s internal datastrip parser returns False before reaching that field.

Has anyone seen this with Sentinel-2C products at PB 05.12 in Sen2Cor 2.12.04, we also experienced the same error for Sen2Cor 2.12.03?

Is this a known bug, and is there a workaround or patch available?

Thank you.

Dear @KevinKopecky

Thank you for your message.

We tested on our side the product you refer with version 02.12.04 without error:

C:\Users\Documents\Sen2Cor-02.12.04-win64\Sen2Cor-02.12.04-win64> .\L2A_Process.bat C:\Users\Documents\Sen2Cor-02.12.04-win64\S2C_MSIL1C_20260220T095031_N0512_R079_T33UXQ_20260220T114831.SAFE
Sen2Cor. Version: 02.12.04, created: 2025.11.28, supporting Level-1C product version 14.2 - 15.1 started ...
Product version: 15.1
Operation mode: TOOLBOX
Processing baseline: 99.99
Progress[%]:  0.00 : Generating datastrip metadata
L2A datastrip successfully generated
No resolution specified, will process 20 and 10 m resolution
20 m resolution will be downsampled to 60 m
Progress[%]: 0.08 : PID-20984, L2A_ProcessTile: processing with resolution 20 m, elapsed time[s]: 2.748, total: 0:00:10.178000
Progress[%]: 0.08 : PID-20984, L2A_ProcessTile: start of pre processing, elapsed time[s]: 0.024, total: 0:00:10.202000
Progress[%]: 0.09 : PID-20984, L2A_Tables: start import, elapsed time[s]: 0.130, total: 0:00:10.332000
Progress[%]: 0.13 : PID-20984, L2A_Tables: band B01 imported, elapsed time[s]: 1.394, total: 0:00:11.726000
Progress[%]: 0.48 : PID-20984, L2A_Tables: band B02 imported, elapsed time[s]: 11.750, total: 0:00:23.476000
Progress[%]: 0.75 : PID-20984, L2A_Tables: band B03 imported, elapsed time[s]: 9.192, total: 0:00:32.668000
Progress[%]: 1.02 : PID-20984, L2A_Tables: band B04 imported, elapsed time[s]: 9.150, total: 0:00:41.818000
Progress[%]: 1.27 : PID-20984, L2A_Tables: band B05 imported, elapsed time[s]: 8.427, total: 0:00:50.245000
(...)

We suspect that the reason of your error is that in your Sen2or processing, a former version of L2A_GIPP.xml, incompatible with last Sentinel-2 Level-1C product based on PSD 15.1 was used. See point#1 of Frequently Asked Questions:

1) L2A_GIPP important information

Please be aware that a new installation of Sen2Cor 2.x does not replace the L2A_GIPP.xml that is located in the existing destination folder (e.g. C:\Users\username\Documents\sen2cor\2.x).
Please be sure that the L2A_GIPP.xml is up-to-date with the Sen2Cor Version you are using.
Please use the command line --GIP_L2A path_to_the_L2A_GIPP.xml to force the use of the chosen L2A_GIPP.xml

Default L2A_GIPP.xml is shipped in:
Linux in: ../Sen2Cor-02.12.04-Linux64/lib/python2.7/site-packages/sen2cor/cfg/L2A_GIPP.xml
Windows in: C:\Sen2Cor\Sen2Cor-02.12.04-win64\Lib\site-packages\sen2cor\cfg\L2A_GIPP.xml

What is missing in former L2A_GIPP.xml is the part pointing to the new PSD 15.1 of Level-1C PB05.12:

<PSD_Scheme PSD_Version="15.1" PSD_Reference="S2-PDGS-CS-DI-PSD-V15.1_Schema">
        <UP_Scheme_1C>S2_User_Product_Level-1C_Metadata</UP_Scheme_1C>
        <UP_Scheme_2A>S2_User_Product_Level-2A_Metadata</UP_Scheme_2A>
        <Tile_Scheme_1C>S2_PDI_Level-1C_Tile_Metadata</Tile_Scheme_1C>
        <Tile_Scheme_2A>S2_PDI_Level-2A_Tile_Metadata</Tile_Scheme_2A>
        <DS_Scheme_1C>S2_PDI_Level-1C_Datastrip_Metadata</DS_Scheme_1C>
        <DS_Scheme_2A>S2_PDI_Level-2A_Datastrip_Metadata</DS_Scheme_2A>
    </PSD_Scheme>

Please let us know it is solved your issue.

Cheers,
@Sen2cor_dev_team

1 Like

Thank you! I managed to fix the error!