I am using the Sen2cor standalone package for converting L1C data into L2A product. But i am getting the error of “TypeError: object of type ‘NoneType’ has no len()”. Please help me. I am stuck there.
I think I know what has happened, but not how or why.
A value in the .config object (L2A_TILE_MTD_XML) has the value None - where it should have been overwritten with the file path used to store the metadata for the granule - a file called MTD_TL.xml
Without more details of your setup I can’t see why this happened.
One workround to try - if the sen2cor program has crashed before, it may have left a partially complete output directory. Look for a directory named S2?_MSIL2A_XX.SAFE, where XX is the long date and orbit string and ? is either A or B. The XX part will appear in the input filename you are trying to process. Try deleting this directory - be careful not to get the _MSIL1C_ directory that contains your input data!
I am using windows operating system. And Sen2cor standalone is installed on the system. Snap 6.0.0 is used for the processing of sentinel-2 imagery.
Hi g8sqh,
I can see you have solved this problem before. I am getting the same problem again and can’t solve even after following your instructions. I am using v 11 of Sen2Cor in SNAP 9 for Sentinel-2 images from 2018. Do you have any idea why this is happening? I tried correcting images using command line also but got the same problem.
Could you please help me?
Thank you.
Hello,
I still have the same error and I followed the previous instructions. I can’t solve the problem knowing that I am using the same version and the same software. Did you manage it? I’ll be thankful if there anyone can help.
Hi all, I have the same error. I am running SNAP v.9.0.0 and Sent2 toolbox 9.0.2 on a Win10 PC.
Please advise solution.
Regards Grant
We have a similar issue that hasn’t been resolved. Any thoughts?
Traceback (most recent call last):
File “C:\Users\srgreb.snap\auxdata\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Process.py”, line 734, in
sys.exit(main())
File “C:\Users\srgreb.snap\auxdata\Sen2Cor-02.11.00-win64\Lib\site-packages\sen2cor\L2A_Process.py”, line 500, in main
datastrip_generated = os.path.exists(os.path.join(config.output_dir,‘temp’,‘DATASTRIP’))
File “C:\Users\srgreb.snap\auxdata\Sen2Cor-02.11.00-win64\lib\ntpath.py”, line 65, in join
result_drive, result_path = splitdrive(path)
File “C:\Users\srgreb.snap\auxdata\Sen2Cor-02.11.00-win64\lib\ntpath.py”, line 115, in splitdrive
if len(p) > 1:
TypeError: object of type ‘NoneType’ has no len()
Finished tool execution in 8 seconds
Hello, I have the same error with you, if you fix it, can you tell me how to resolve it? Thanks.
ok, I resolved it. I check the command: L2A_Process.bat --help, and I found I just input the data instead the directory of data. After replacing the dir, it works.
Dear Sen2Cor users,
There are known reasons that can bring to this error in the processing of a Copernicus Sentinel-2 L1C product:
- length of the path to the products (for Windows based Sen2Cor Installation) (See FAQ-6, Long string path in Windows)
- old products that are not compliant with recent Product Specification (See FAQ-14, When processing old S2 products, form 2015 to 2017)
(Sen2Cor Frequently Asked Questions)
However if necessary, feel free to open a new ticket specifying:
- 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