Problem uploading empty files with upload_object
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
報告されているエントリポイントは upload_object と upload_object_via_stream です。まず、S3 ドライバーで空ファイルのケースを再現し、AWS S3、MinIO、NetApp StorageGRID 間で動作を比較してください。Issue にはソースファイルもテストも記載されていないため、最初にアップロードの実装とそのテストを見つけてください。完了条件は、upload_object がメタデータ付きの空ファイルを処理でき、重複した Host ヘッダーを生成せず、プロバイダー互換性を損なわないことです。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 2.1k
- フォーク
- 935
- 平均マージ
- 5日 3時間
- マージ済み PR(30日)
- 15
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/libcloud のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
Local range download leaves an output file after source-read failure despite delete_on_failure=Trueオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
apache/libcloud#2215 · コメント 3 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
apache/libcloud の issue をすべて見る
似ている issue
-
Email validation accepts a trailing newline対応中かも @marcello-pichini が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dbt-labs/spark-utils#51 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
vendrabuck/HERD#1419 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信