B2 CLI Hanging and Not Completing

Aperta
#1,118 3 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

  • #548 di @ppolewicz — chiusa senza merge

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
cloud, python
Ambito
cli, cloud

Direzione di ricerca

The hang is in the b2 sync upload path, where b2sdk's retry logic in b2http.py keeps backing off on 503 vault cannot start new uploads responses and the upload URL pool in upload_url_pool is involved. Start by reproducing with a forced 503 on b2_upload_file and checking whether the retry loop has a cap or timeout. Done would mean sync fails or completes after a bounded number of retries. The only linked pull request was closed without merging, and the maintainers have not settled the expected behaviour, so confirm scope with them before writing code.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

We have a report from a customer that the b2 sync command is hanging and not completing. This is causing lots of issues with the user's ability to keep their project websites updated.

This is the current error they are seeing:

This is the current error I am seeing, literally occurred just now (5ish minutes ago). A couple of files uploaded, and then this error. As mentioned above, the “pause” keeps incrementing, but it just increments and increments and never resolves — seemingly hung forever.

b2sdk._internal.exception.ServiceError: 503 service_unavailable vault cannot start new uploads
INFO:b2sdk._internal.b2http:Pausing thread for 17 seconds because that is what the default exponential backoff is
DEBUG:urllib3.connectionpool:Resetting dropped connection: [pod-000-1133-02.backblaze.com](http://pod-000-1133-02.backblaze.com/)

They were able to get debug logs:

DEBUG:b2sdk._internal.exception:calling interpret_b2_error(status=503, code='service_unavailable', message='vault cannot start new uploads', response_headers={'Server': 'nginx', 'Date': 'Tue, 07 Oct 2025 18:06:11 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '99', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Strict-Transport-Security': 'max-age=63072000'}, post_params=None)
DEBUG:b2sdk._internal.b2http:503 service_unavailable vault cannot start new uploads
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/b2-tools/4.4.2/libexec/lib/python3.13/site-packages/b2sdk/_internal/b2http.py", line 597, in _translate_and_retry
    return cls._translate_errors(fcn, post_params)
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/b2-tools/4.4.2/libexec/lib/python3.13/site-packages/b2sdk/_internal/b2http.py", line 525, in _translate_errors
    raise interpret_b2_error(
    ...<5 lines>...
    )
b2sdk._internal.exception.ServiceError: 503 service_unavailable vault cannot start new uploads
INFO:b2sdk._internal.b2http:Pausing thread for 3 seconds because that is what the default exponential backoff is
DEBUG:urllib3.connectionpool:Resetting dropped connection: [pod-000-1121-05.backblaze.com](http://pod-000-1121-05.backblaze.com/)
DEBUG:urllib3.connectionpool:[https://pod-000-1162-08.backblaze.com:443](https://pod-000-1162-08.backblaze.com/) "POST /b2api/v4/b2_upload_file/21e799824398e2af83430a16/c002_v0001162_t0059 HTTP/1.1" 200 780
DEBUG:b2sdk._internal.account_info.upload_url_pool:calling UrlPoolAccountInfo.put_bucket_upload_url(self=<b2sdk._internal.account_info.sqlite_account_info.SqliteAccountInfo object at 0x103d1c980>, bucket_id='21e799824398e2af83430a16') (hidden args: upload_url, upload_auth_token)
upload
DEBUG:urllib3.connectionpool:[https://pod-000-1121-05.backblaze.com:443](https://pod-000-1121-05.backblaze.com/) "POST /b2api/v4/b2_upload_file/" 503 106
DEBUG:b2sdk._internal.exception:calling interpret_b2_error(status=503, code='service_unavailable', message='connection interrupted, retry request', response_headers={'Server': 'nginx', 'Date': 'Tue, 07 Oct 2025 18:06:12 GMT', 'Content-Type': 'application/json;charset=utf-8', 'Content-Length': '106', 'Connection': 'keep-alive', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Strict-Transport-Security': 'max-age=63072000'}, post_params=None)
DEBUG:b2sdk._internal.b2http:503 service_unavailable connection interrupted, retry request
Traceback (most recent call last):
  File "/opt/homebrew/Cellar/b2-tools/4.4.2/libexec/lib/python3.13/site-packages/b2sdk/_internal/b2http.py", line 597, in _translate_and_retry
    return cls._translate_errors(fcn, post_params)
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/b2-tools/4.4.2/libexec/lib/python3.13/site-packages/b2sdk/_internal/b2http.py", line 525, in _translate_errors
    raise interpret_b2_error(
    ...<5 lines>...
    )

b2sdk._internal.exception.ServiceError: 503 service_unavailable vault cannot start new uploads
INFO:b2sdk._internal.b2http:Pausing thread for 64 seconds because that is what the default exponential backoff is
Lingua principale
Python
Stelle
638
Fork
138
Merge medio
8h 27m
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Backblaze/B2_Command_Line_Tool

Tutte le issue di Backblaze/B2_Command_Line_Tool

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.