MinIO: InvalidCredsError when trying to retrieve an object
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 42/100
Rechercherichtung
Beginne mit tests/test_demo_bug.py und reproduziere den Fehler mit pytest -k test_demo_InvalidCreds. Verfolge MinIO get_object durch s3.py, insbesondere S3Response.parse_error und die HEAD-Anfrage, und füge anschließend Regressionstests hinzu, die zeigen, dass das Abrufen des hochgeladenen Objekts keinen InvalidCredsError auslöst, während echte Fehler bei den Zugangsdaten weiterhin erkennbar bleiben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
When using the minio provider and getting an object, the method raises an libcloud.common.types.InvalidCredsError, despite the fact that it was able to create a container and upload it the object (so it doesn't look like a credential issue)
100% repro, code to repro the bug is provided
Detailed Information
libcloud: latest stable, 3.3.1
Python: 3.8.10
OS: Ubuntu 20.04
Here you can find a repo to repro the bug, using pytest (Actually there are 2 bugs to report):
https://github.com/Wenzel/libcloud_bug
$ pytest -k test_demo_InvalidCreds
__________________________________________________________________________________________ test_demo_InvalidCreds ___________________________________________________________________________________________
clean_minio_db = <libcloud.storage.drivers.minio.MinIOStorageDriver object at 0x7f76b6282a00>, tmp_path = PosixPath('/tmp/pytest-of-wenzel/pytest-22/test_demo_InvalidCreds0')
def test_demo_InvalidCreds(clean_minio_db, tmp_path):
# setup
expected_data = b"data"
with open(tmp_path / "file1.txt", "wb") as f:
f.write(expected_data)
adapter = clean_minio_db
c = adapter.create_container("objects")
# test
ret = adapter.upload_object(tmp_path / "file1.txt", c, "file1")
> obj = adapter.get_object(c, "file1")
tests/test_demo_bug.py:31:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../.cache/pypoetry/virtualenvs/libcloud-bug-IT-EyGKG-py3.8/lib/python3.8/site-packages/libcloud/storage/drivers/s3.py:370: in get_object
response = self.connection.request(object_path, method='HEAD')
../../.cache/pypoetry/virtualenvs/libcloud-bug-IT-EyGKG-py3.8/lib/python3.8/site-packages/libcloud/common/base.py:655: in request
response = responseCls(**kwargs)
../../.cache/pypoetry/virtualenvs/libcloud-bug-IT-EyGKG-py3.8/lib/python3.8/site-packages/libcloud/common/base.py:166: in __init__
message=self.parse_error(),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <libcloud.storage.drivers.s3.S3Response object at 0x7f76b6282700>
def parse_error(self):
if self.status in [httplib.UNAUTHORIZED, httplib.FORBIDDEN]:
> raise InvalidCredsError(self.body)
E libcloud.common.types.InvalidCredsError: ''
../../.cache/pypoetry/virtualenvs/libcloud-bug-IT-EyGKG-py3.8/lib/python3.8/site-packages/libcloud/storage/drivers/s3.py:138: InvalidCredsError
------------------------------------------------------------------------------------------- Captured stdout setup -------------------------------------------------------------------------------------------
ca19a7e29a92d875ec58b0285c854403ae5a95433a71e084011d32018a9141d1
----------------------------------------------------------------------------------------- Captured stdout teardown ------------------------------------------------------------------------------------------
libcloud_bug_objectmistmatch_miniodb
========================================================================================== short test summary info ==========================================================================================
FAILED tests/test_demo_bug.py::test_demo_InvalidCreds - libcloud.common.types.InvalidCredsError: ''
Thanks for your help !
- Vorherrschende Sprache
- Python
- Sterne
- 2.1k
- Forks
- 935
- Ø Merge
- 5 T. 3 Std.
- Gemergte PRs (30 T.)
- 15
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/libcloud
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Local range download leaves an output file after source-read failure despite delete_on_failure=TrueOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
apache/libcloud#2215 · 3 Kommentare · 2 Reaktionen ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in apache/libcloud
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
OCA/account-invoicing#2529 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area/ci
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
ImageGen generate-batch aborts valid JSONL jobs containing a Unicode line separator in poster textOffenbug imagen skills
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Email validation accepts a trailing newlineEvtl. vergeben @marcello-pichini hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag