MissingHeaderBodySeparatorDefect when uploading items to OSS
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Parti dalla chiamata put_object segnalata e dai punti di ingresso del traceback in oci/_vendor/urllib3/connectionpool.py e oci/_vendor/urllib3/util/response.py. Riproduci il fallimento durante upload OSS ripetuti, determina perché la risposta attiva MissingHeaderBodySeparatorDefect e rimane bloccata al di fuori del try/except mostrato, quindi verifica che il fallimento venga segnalato in modo affidabile senza interrompere gli upload riusciti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When uploading files to OSS, I randomly (~1000 items in) experience this error after I run
with open(file_path, 'rb') as f:
obj_data = f.read()
try:
response = oci_client.put_object(
OSS_NAMESPACE,
OSS_BUCKET_NAME,
oss_object_name, # object name
obj_data, # object body (bytes)
)
if response.status != 200:
msg = f'WARNING: {oss_object_name} upload resulted in status {response.status}. {response.data}'
logging.log(logging.WARN, msg)
print(msg)
else:
msg = f'SUCCESS! {oss_object_name} uploaded'
logging.log(logging.INFO, msg)
print(msg)
except oci.exceptions.ServiceError as e:
# Handling OCI specific exceptions
msg = f'ERROR: {oss_object_name} upload failed with ServiceError. {e.status} {e.message}'
logging.error(msg)
print(msg)
except Exception as e:
msg = f'ERROR: {oss_object_name} upload failed. {e}'
logging.log(logging.ERROR, msg)
print(msg)
Here's the traceback:
2024-02-19 20:09:39,991:WARNING:Failed to parse headers (url=https://objectstorage.ap-osaka-1.oraclecloud.com:443/n/ax2tjlcefnht/b/laion2B-en-aesthetic/o/000000401/000000401.txt): [MissingHeaderBodySeparatorDefect()], unparsed data: 'HTTP/1.1 200 OK\r\netag: 07f8f92b-fd96-49ec-b9db-1b927e144116\r\nlast-modified: Mon, 19 Feb 2024 20:09:39 GMT\r\nopc-content-md5: tMGI50PK84P9//D2pQ8evQ==\r\nversion-id: 04303300-a3ec-4fdb-a2eb-58cd65effb06\r\nContent-Length: 0\r\ndate: Mon, 19 Feb 2024 20:09:39 GMT\r\nopc-request-id: kix-1:BaX2PWrWLWStJYPKMWmC_TRLmcJaINqwJQey95jbJrG80yzz4rVgEBGGUeet-gvk\r\nx-api-id: native\r\nx-content-type-options: nosniff\r\nstrict-transport-security: max-age=31536000; includeSubDomains\r\naccess-control-allow-origin: *\r\naccess-control-allow-methods: POST,PUT,GET,HEAD,DELETE,OPTIONS\r\naccess-control-allow-credentials: true\r\naccess-control-expose-headers: access-control-allow-credentials,access-control-allow-methods,access-control-allow-origin,content-length,date,etag,last-modified,opc-client-info,opc-content-md5,opc-request-id,strict-transport-security,version-id,x-api-id,x-content-type-options\r\n\r\n'
Traceback (most recent call last):
File "/home/Mindy/.cache/pypoetry/virtualenvs/t2i-adapter-3QVI5i9t-py3.10/lib/python3.10/site-packages/oci/_vendor/urllib3/connectionpool.py", line 474, in _make_request
assert_header_parsing(httplib_response.msg)
File "/home/Mindy/.cache/pypoetry/virtualenvs/t2i-adapter-3QVI5i9t-py3.10/lib/python3.10/site-packages/oci/_vendor/urllib3/util/response.py", line 96, in assert_header_parsing
raise HeaderParsingError(defects=defects, unparsed_data=unparsed_data)
oci._vendor.urllib3.exceptions.HeaderParsingError: [MissingHeaderBodySeparatorDefect()], unparsed data: 'HTTP/1.1 200 OK\r\netag: 07f8f92b-fd96-49ec-b9db-1b927e144116\r\nlast-modified: Mon, 19 Feb 2024 20:09:39 GMT\r\nopc-content-md5: tMGI50PK84P9//D2pQ8evQ==\r\nversion-id: 04303300-a3ec-4fdb-a2eb-58cd65effb06\r\nContent-Length: 0\r\ndate: Mon, 19 Feb 2024 20:09:39 GMT\r\nopc-request-id: kix-1:BaX2PWrWLWStJYPKMWmC_TRLmcJaINqwJQey95jbJrG80yzz4rVgEBGGUeet-gvk\r\nx-api-id: native\r\nx-content-type-options: nosniff\r\nstrict-transport-security: max-age=31536000; includeSubDomains\r\naccess-control-allow-origin: *\r\naccess-control-allow-methods: POST,PUT,GET,HEAD,DELETE,OPTIONS\r\naccess-control-allow-credentials: true\r\naccess-control-expose-headers: access-control-allow-credentials,access-control-allow-methods,access-control-allow-origin,content-length,date,etag,last-modified,opc-client-info,opc-content-md5,opc-request-id,strict-transport-security,version-id,x-api-id,x-content-type-options\r\n\r\n'
Even after adding try...except, I can't catch the exception and my code hangs. put_object worked fine for me two weeks ago when I uploaded hundreds of thousands of items.
- Lingua principale
- Python
- Stelle
- 474
- Fork
- 321
- Merge medio
- 23m
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oracle/oci-python-sdk
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
oracle/oci-python-sdk#890 · 3 commenti ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/oci-python-sdk#879 · 3 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
oracle/oci-python-sdk#878 ·
-
SDK
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
oracle/oci-python-sdk#861 · 5 commenti ·
-
SDK
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
oracle/oci-python-sdk#852 ·
Tutte le issue di oracle/oci-python-sdk
Issue simili
-
area: harness bug status: needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Human-Agent-Society/reef#625 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
learningequality/kolibri#15351 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Name consistency Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
eellak/triplestore#65 · 1 commento ·