With v0.13.3 I think the egress can be saturated with a single upload process, as I also tried to run multiple MT processes to upload and I didn’t notice any speed improvement, compared to single upload process.
I was indeed on the previous version. I tested it now with the 0.13.3 version and the upload speeds are greatly improved! There is now more fluctuation between the different uploads, it’s not related to my computer, CPU time is 20%. I presume it’s related to the server or interconnects. But I love those speeds way more than before
@tao When pip building the latest mapillary_tools==0.13.3 the pynmea2==1.19 dependency does not build. All other dependencies build flawlessly.
❯ python3 --version
Python 3.12.9
❯ pip --version
pip 25.0.1 from /usr/lib/python3.12/site-packages/pip (python 3.12)
❯ pip install --no-binary :all: mapillary_tools
Collecting pynmea2<2.0.0,>=1.12.0 (from mapillary_tools)
Downloading pynmea2-1.19.0.tar.gz (36 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-wk7g44vb/pynmea2_da86abe101874af696200f318c659b8c/setup.py", line 3, in <module>
import imp
ModuleNotFoundError: No module named 'imp'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
Looks like this has been already fixed
but the source dist has not been updated on PyPI yet.
I have made a handful of larger uploads with the tests.cli.upload_api_v4 module and a legit dummy upload with v0.13.3 into the actual upload feed, both over a direct connection without static IP address mapping (sort of default net config). I have also played with different chunk sizes. None of the uploads caused a SSLError, even when surfing the Mapillary web app at the same time. All uploads also resumed correctly. I am not sure what you have changed but things look stable for now. The DNS TTLs continue to be volatile and generally quite short, usually around one minute. I will continue to monitor the situation on upcoming uploads.
@tao I continue to rarely get SSLErrors and progress resets with static IP address mapping:
Uploading ZIP mly_tools_687a1686021c47aa8fb831fba230de15.zip (1/1): 34%|█████████████████████████▉ | 12.5G/36.5G [2:56:50<5:38:48, 1.27MB/s]
2025-03-25 02:49:25,859 - WARNING - Error uploading chunk_size 5242880 at begin_offset 0: SSLError: HTTPSConnectionPool(host='rupload.facebook.com', port=443): Max retries exceeded with url: /mapillary_public_uploads/mly_tools_687a1686021c47aa8fb831fba230de15.zip (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:2427)')))
2025-03-25 02:49:25,860 - INFO - Retrying in 2 seconds (1/200)
Uploading ZIP mly_tools_687a1686021c47aa8fb831fba230de15.zip (1/1): 34%|█████████████████████████▉ | 12.5G/36.5G [3:13:11<6:12:30, 1.15MB/s]
Due to its sporadic nature, maybe this also happens when the server is briefly overloaded? The server then just closes the oldest connection(s) to free resources for new connections?
Using PUT seems to work too. But you can not resume from a PUT uploading, i.e. the offset is always returned as 0 if you use PUT, which makes sense from its semantics perspective (replace a resource) PUT - HTTP | MDN
Thank you for the clarification. I have read the RFCs but could not figure out the exact difference in semantics between PUT and POST. So, in a chunked scenario a first PUT request would create a new resource (file) on the server and subsequent chunk requests would be POSTed. Why do I mention this; Could your HTTP server handle PUT versus POST created resources differently later on, i.e. impact resumes or upload session migration?
@tao Things are getting weirder!? The server shuts down on completion?
Uploading ZIP mly_tools_ccfce8717369e5ac30a466be384e9bb9.zip (1/1): 100%|██████████████████████████████████████████████████████████████████████████████| 5.50G/5.50G [1:18:17<00:00, 1.27MB/s]
Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/upload.py", line 622, in upload
_upload_zipfiles(mly_uploader, zip_paths)
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/upload.py", line 677, in _upload_zipfiles
raise UploadError(ex) from ex
mapillary_tools.upload.UploadError: Upload server error: File handle not found in the upload response {"debug_info":{"retriable":true,"type":"ShutdownError","message":"Server shutting down. Please try again."}}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/jake/.local/bin/mapillary_tools", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/commands/__main__.py", line 164, in main
args.func(argvars)
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/commands/upload.py", line 50, in run
upload(**args)
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/upload.py", line 651, in upload
raise inner_ex
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/upload.py", line 673, in _upload_zipfiles
cluster_id = mly_uploader.upload_zipfile(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/uploader.py", line 132, in upload_zipfile
return self.upload_stream(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/uploader.py", line 219, in upload_stream
return _upload_stream(
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/uploader.py", line 425, in _upload_stream
raise ex
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/uploader.py", line 398, in _upload_stream
file_handle = upload_service.upload(fp, offset=begin_offset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/upload_api_v4.py", line 89, in upload
return self.upload_chunks(chunks, offset=offset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/mapillary_tools/upload_api_v4.py", line 151, in upload_chunks
raise RuntimeError(
RuntimeError: Upload server error: File handle not found in the upload response {"debug_info":{"retriable":true,"type":"ShutdownError","message":"Server shutting down. Please try again."}}
Uploading ZIP mly_tools_ccfce8717369e5ac30a466be384e9bb9.zip (1/1): 100%|██████████████████████████████████████████████████████████████████████████████| 5.50G/5.50G [1:18:18<00:00, 1.26MB/s]
Welcome to the club, but I’ve been having this kind of thing for a month, sometimes several times a day sometimes 1 a day, although just recently it has calmed down.
>
> [2025-04-27 20:05:01.501] [debug] [mapillary:tools] 2025-04-27 20:05:01,501 - DEBUG - HTTP 400 (Bad Request): {"debug_info": {"retriable": false, "type": "ProcessingFailedError", "message": "Request processing failed"}}
>
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools] Traceback (most recent call last):
> File "mapillary_tools\upload.py", line 568, in upload
>
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools] mapillary_tools.upload.UploadError: Upload server error: File handle not found in the upload response {"debug_info":{"retriable":false,"type":"ProcessingFailedError","message":"Request processing failed"}}
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools]
>
>
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools] During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
> File "main.py", line 8, in <module>
>
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools] File "mapillary_tools\commands\__main__.py", line 164, in main
> File "mapillary_tools\commands\upload.py", line 50, in run
>
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools] File "mapillary_tools\upload.py", line 651, in upload
> File "mapillary_tools\upload.py", line 563, in upload
> File "mapillary_tools\uploader.py", line 163, in upload_images
>
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools] File "mapillary_tools\uploader.py", line 219, in upload_stream
> File "mapillary_tools\uploader.py", line 425, in _upload_stream
>
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools] File "mapillary_tools\uploader.py", line 398, in _upload_stream
> File "mapillary_tools\upload_api_v4.py", line 89, in upload
> File "mapillary_tools\upload_api_v4.py", line 151, in upload_chunks
>
> [2025-04-27 20:05:01.595] [debug] [mapillary:tools] RuntimeError: Upload server error: File handle not found in the upload response {"debug_info":{"retriable":false,"type":"ProcessingFailedError","message":"Request processing failed"}}
> [6372] Failed to execute script 'main' due to unhandled exception!
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] Traceback (most recent call last):
File "mapillary_tools\upload.py", line 568, in upload
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] mapillary_tools.upload.UploadError:
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] Upload server error: File handle not found in the upload response {"debug_info":{"retriable":false,"type":"ProcessingFailedError","message":"Request processing failed"}}
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 8, in <module>
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] File "mapillary_tools\commands\__main__.py", line 164, in main
File "mapillary_tools\commands\upload.py", line 50, in run
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] File "mapillary_tools\upload.py", line 651, in upload
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] File "mapillary_tools\upload.py", line 563, in upload
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] File "mapillary_tools\uploader.py", line 163, in upload_images
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] File "mapillary_tools\uploader.py", line 219, in upload_stream
File "mapillary_tools\uploader.py", line 425, in _upload_stream
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] File "mapillary_tools\uploader.py", line 398, in _upload_stream
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] File "mapillary_tools\upload_api_v4.py", line 89, in upload
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] File "mapillary_tools\upload_api_v4.py", line 151, in upload_chunks
RuntimeError: Upload server error: File handle not found in the upload response {"debug_info":{"retriable":false,"type":"ProcessingFailedError","message":"Request processing failed"}}
[864] Fail
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] ed to execute script 'main' due to unha
[2025-05-09 09:49:27.046] [debug] [mapillary:tools] ndled exception!
[2025-05-20 18:44:54.153] [debug] [mapillary:tools] 2025-05-20 18:44:54,153 - DEBUG - HTTP 412 (Precondition Failed): {"debug_info": {"retriable": true, "type": "AuthorizationFailedError", "message": "A temporary failure has occurred. Please try again."}}
[2025-05-20 18:44:54.293] [debug] [mapillary:tools] Traceback (most recent call last):
File "mapillary_tools\upload.py", line 568, in upload
[2025-05-20 18:44:54.293] [debug] [mapillary:tools] mapillary_tools.upload.UploadError: Upload server error: File handle not found in the upload response {"debug_info":{"retriable":true,"type":"AuthorizationFailedError","message":"A temporary failure has occurred. Please try again."}}
[2025-05-20 18:44:54.293] [debug] [mapillary:tools] During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 8, in <module>
[2025-05-20 18:44:54.293] [debug] [mapillary:tools] File "mapillary_tools\commands\__main__.py", line 164, in main
File "mapillary_tools\commands\upload.py", line 50, in run
File "mapillary_tools\upload.py", line 651, in upload
[2025-05-20 18:44:54.293] [debug] [mapillary:tools] File "mapillary_tools\upload.py", line 563, in upload
File "mapillary_tools\uploader.py", line 163, in upload_images
File "mapillary_tools\uploader.py", line 219, in upload_stream
[2025-05-20 18:44:54.293] [debug] [mapillary:tools] File "mapillary_tools\uploader.py", line 425, in _upload_stream
File "mapillary_tools\uploader.py", line 398, in _upload_stream
File "mapillary_tools\upload_api_v4.py", line 89, in upload
[2025-05-20 18:44:54.293] [debug] [mapillary:tools] File "mapillary_tools\upload_api_v4.py", line 151, in upload_chunks
RuntimeError: Upload server error: File handle not found in the upload response {"debug_info":{"retriable":true,"type":"AuthorizationFailedError","message":"A temporary failure has occurred. Please try again."}}
[8112] Failed to execute script 'main' due to unhandled exception!
[2025-05-20 18:44:54.528] [debug] [mapillary:tools] process exit code 1 and signal null
[2025-05-20 18:44:54.543] [error] [store:modules:uploadSession] exit with code 1 and signal null