L1C to L2A using sen2cor: Error - Metadata file is invalid

Dear all,

I am using the sen2cor v2.0.6 (Windows 7, 64bit) command line to process S2A L1C to L2A.

On invoking the command, I am getting the following error:
"Metadata file is invalid, see logfile for details.
.
.
.
AttributeError: ‘bool’ object has no attribute ‘attrib’ "

I have tried more than one dataset - also tried different resolutions - but I get the same error all the time.
Attached please find the associated trace/report and a copy of the command line.

Would appreciate any help!

Regards
Stephen

L2A_20160110T131627_trace.xml (2.5 KB)
L2A_20160110T131627_report.xml (2.3 KB)
cmd.txt (1.4 KB)

Hi,
I think the “Metadata file is invalid” message has no effect on the result, look at this post: SEN2COR tool

Once I got the AttributeError, too. The python code is looking for metadata files with a filename mask like S2A_L1C.xml. My mistake was to open an image in this folder with QGis. QGis writes automatically a metadata file with the name of the image and *.aux.xml at the end. And of course, this xml file has no attribute ‘attrib’.

So be sure not to write any additional data in your S2A folder.

Regards
Ralf

Hi Ralf,

thanks for your response.

the AttributeError occurs at the very start of the process and thus no usable result has been generated yet.

I can confirm that I am not using or accessing the S2A folder during/before this process.

In the report I attached in my previous post, I noticed:

new working directory is: C:\Users\WindowsMAC\Desktop/S2A_USER_PRD_MSIL2A_20160104/GRANULE/S2A_USER_MSI_L2A_TL_SGS__20160104T141459_A002793_T32SQE_N02.01

The working directory appears to have a mix of ‘/’ and ‘’. Is this how it should be?

Regards,
Stephen

Hi Stephen,
I tested it on my computer with the dataset S2A_OPER_PRD_MSIL1C_PDMC_20160104T182807_R079_V20160104T100050_20160104T100050 and it works for 60m and 10m resolution. In 10m resolution only the first tile is processed (reported here: sen2Cor 10 resolution error)

I think “” or “/” doesn´t matter, see my report file:
new working directory is: D:\test/S2A_USER_PRD_MSIL2A_PDMC_20160104T182807_R079/GRANULE/S2A_USER_MSI_L2A_TL_SGS__20160104T141459_A002793_T32SQF_N02.01

However, I do not get the error message that the metadata file in the tile folder is invalid (see my cmd text attached). Maybe your xml-file is corrupted because of an interrupted download.

cmd_10m.txt (2.0 KB)
cmd_60m.txt (12.1 KB)

Regards
Ralf

Hi Ralf,

I discovered what the issue was. I was leaving the root folder of the dataset with the original long name. The moment I shortened it, the issue resolved!

The only problem now is processing to 10m resolution. I understand this issue is already open and will track any progress on its post.

Thanks for you help!
Stephen