Problem uploading empty files with upload_object
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
I punti di ingresso segnalati sono upload_object e upload_object_via_stream; inizia riproducendo il caso di un file vuoto con il driver S3 e confrontando il comportamento tra AWS S3, MinIO e NetApp StorageGRID. Poiché nell’issue non sono indicati né un file sorgente né un test, individua prima l’implementazione dell’upload e i relativi test. Il lavoro è completato quando upload_object gestisce i file vuoti con metadati senza produrre header Host duplicati né compromettere la compatibilità con i provider.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Using upload_object to upload an empty file returns response:
400 - Bad Request: too many Host headers
Detailed Information
Python 3.6.8
Libcloud: 3.3.1
OS: rhel 7.9
I use libcloud to upload objects to 3 providers - aws s3, minio & netapp storageGrid, I use the s3 driver for all of them. upload_object function works fine except when I try to upload an empty file (I sometimes need to store just meta-data with a specific object name for later use). When trying to upload an empty file I get the response:
status: 400
reason: 'Bad Request: too many Host headers'
If I add anything to the file's content it uploads successfully with the meta-data, so its not a problem with permissions/path in s3 or something like that. I also tried without the meta-data, but that didn't work either.
I tried using upload_object_via_stream and found the following code works:
with io.BytesIO() as iterator:
driver.upload_object_via_stream(iterator=iterator,
container=container,
object_name=objName,
extra=extra)
This code uploads a 0 bytes file successfully to aws s3 & minio, but not to netapp's storageGrid (so unfortunately I can't use it).
I think it's a limitation of storageGrid's multi-part upload and not some other storage restriction (we have existing empty objects on storageGrid, but those were uploaded using jclouds).
I think using upload_object will be the best solution for all 3 providers, but I don't understand why it's not uploading empty files and would appreciate help with this. Thanks!
Reproduce
touch ~/test-empty.txt- Use
upload_objectto upload test-empty.txt
- Lingua principale
- Python
- Stelle
- 2.1k
- Fork
- 935
- Merge medio
- 5g 3h
- PR unite (30g)
- 15
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi 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 apache/libcloud
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Local range download leaves an output file after source-read failure despite delete_on_failure=TrueAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
apache/libcloud#2215 · 3 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di apache/libcloud
Issue simili
-
Email validation accepts a trailing newlineForse già presa @marcello-pichini l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Contributing instructionsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dbt-labs/spark-utils#51 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
bug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
vendrabuck/HERD#1419 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno