-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
televersement de fichiers #897
Comments
OK en local avec
KO en local avec variable environnement de prod (S3 clever) :
|
Probablement une question de serveur (qui supporterait ou non Idéalement, on utiliserait le même logiciel que Clever pour le S3 de test, mais ça demande plus d’efforts que de démarrer MinIO. |
emploi :
commu :
|
OK en local avec les variables d'environnement de prod is |
KO avec
|
## Description 🛑 téléversement de fichier impossible. Erreur 500. 🎸 Issue #897 : `botocore.exceptions.ClientError: An error occurred (MissingContentLength) when calling the PutObject operation: None` 🛸 suite au passage à `boto3` et `botocore` 1.36 🦺 aurait dû être résolu en `1.36.5` boto/boto3#4398 (comment) 🦺 mais toujours ko avec la `1.36.11` ## Type de changement 🪲 Correction de bug (changement non cassant qui corrige un problème). 🚧 technique ### Points d'attention 🦺 WORKAROUND en attendant une résolution pérenne : downgrade en `1.35.99` --------- Co-authored-by: François Freitag <mail@franek.fr>
|
|
Ceci indique que le bucket n’est pas créé dans minio. |
et oui, si je ne mets pas la bonne trace, ca marche beaucoup moins bien
celle avec le bon nom de bucket
|
en accord avec ce post, ajouter ces 2 variables dans les variables d'environnement,
|
Je n’arrive pas à reproduire le problème avec le diff suivant: diff --git a/config/settings/test.py b/config/settings/test.py
index e4730d0..fd0f622 100644
--- a/config/settings/test.py
+++ b/config/settings/test.py
@@ -27,8 +27,6 @@ AWS_S3_SECRET_ACCESS_KEY = os.getenv("CELLAR_ADDON_KEY_SECRET", "minioadmin")
AWS_S3_ENDPOINT_URL = (
f"{os.getenv('CELLAR_ADDON_PROTOCOL', 'http')}://{os.getenv('CELLAR_ADDON_HOST', 'localhost:9000')}"
)
-AWS_STORAGE_BUCKET_NAME = "private-bucket"
-AWS_STORAGE_BUCKET_NAME_PUBLIC = "public-bucket"
AWS_S3_STORAGE_BUCKET_REGION = "eu-west-3"
MEDIA_URL = f"{AWS_S3_ENDPOINT_URL}/"
diff --git a/pyproject.toml b/pyproject.toml
index 6f62058..df48999 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,7 +11,7 @@ dependencies = [
"python-dotenv>=1.0",
"psycopg>=3.2",
"django-machina>=1.2.0",
- "boto3<1.36",
+ "boto3",
"django-storages>=1.14",
"httpx>=0.28",
"django-compressor>=4.5",
diff --git a/uv.lock b/uv.lock
index 79a124f..68e78ca 100644
--- a/uv.lock
+++ b/uv.lock
@@ -46,30 +46,30 @@ wheels = [
[[package]]
name = "boto3"
-version = "1.35.99"
+version = "1.36.11"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "botocore" },
{ name = "jmespath" },
{ name = "s3transfer" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/f7/99/3e8b48f15580672eda20f33439fc1622bd611f6238b6d05407320e1fb98c/boto3-1.35.99.tar.gz", hash = "sha256:e0abd794a7a591d90558e92e29a9f8837d25ece8e3c120e530526fe27eba5fca", size = 111028 }
+sdist = { url = "https://files.pythonhosted.org/packages/ee/ac/2b4346474bd3ae501a2fc0e2b5b4f12f412dc89c05bf321a8108d3a95b5c/boto3-1.36.11.tar.gz", hash = "sha256:b40fbf2c0f22e55b67df95475a68bb72be5169097180a875726b6b884339ac8b", size = 111010 }
wheels = [
- { url = "https://files.pythonhosted.org/packages/65/77/8bbca82f70b062181cf0ae53fd43f1ac6556f3078884bfef9da2269c06a3/boto3-1.35.99-py3-none-any.whl", hash = "sha256:83e560faaec38a956dfb3d62e05e1703ee50432b45b788c09e25107c5058bd71", size = 139178 },
+ { url = "https://files.pythonhosted.org/packages/4e/a5/e6f90b0a768560a0c44cb9076a313ee6d669ec98fd2747a8451832403ffe/boto3-1.36.11-py3-none-any.whl", hash = "sha256:641dd772eac111d9443258f0f5491c57c2af47bddae94a8d32de19edb5bf7b1c", size = 139177 },
]
[[package]]
name = "botocore"
-version = "1.35.99"
+version = "1.36.11"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "jmespath" },
{ name = "python-dateutil" },
{ name = "urllib3" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/7c/9c/1df6deceee17c88f7170bad8325aa91452529d683486273928eecfd946d8/botocore-1.35.99.tar.gz", hash = "sha256:1eab44e969c39c5f3d9a3104a0836c24715579a455f12b3979a31d7cde51b3c3", size = 13490969 }
+sdist = { url = "https://files.pythonhosted.org/packages/a5/0f/6b92050154ad0e286b82ca36de5f87a466723e1cdc525df53270bcc36f60/botocore-1.36.11.tar.gz", hash = "sha256:c919be883f95b9e0c3021429a365d40cd7944b8345a07af30dc8d891ceefe07a", size = 13497505 }
wheels = [
- { url = "https://files.pythonhosted.org/packages/fc/dd/d87e2a145fad9e08d0ec6edcf9d71f838ccc7acdd919acc4c0d4a93515f8/botocore-1.35.99-py3-none-any.whl", hash = "sha256:b22d27b6b617fc2d7342090d6129000af2efd20174215948c0d7ae2da0fab445", size = 13293216 },
+ { url = "https://files.pythonhosted.org/packages/2c/ce/e97be00389d51a010c0680ea688a073737ca3b2de6f924800fc61bf68e41/botocore-1.36.11-py3-none-any.whl", hash = "sha256:82c5660027f696608d0e55feb08c146c11c7ebeba7615961c7765dcf6009a00d", size = 13327743 },
]
[[package]]
@@ -730,7 +730,7 @@ dev = [
[package.metadata]
requires-dist = [
- { name = "boto3", specifier = "==1.35.99" },
+ { name = "boto3" },
{ name = "django", specifier = ">=5.1" },
{ name = "django-compressor", specifier = ">=4.5" },
{ name = "django-csp", specifier = ">=3.8" },
@@ -1203,14 +1203,14 @@ wheels = [
[[package]]
name = "s3transfer"
-version = "0.10.4"
+version = "0.11.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "botocore" },
]
-sdist = { url = "https://files.pythonhosted.org/packages/c0/0a/1cdbabf9edd0ea7747efdf6c9ab4e7061b085aa7f9bfc36bb1601563b069/s3transfer-0.10.4.tar.gz", hash = "sha256:29edc09801743c21eb5ecbc617a152df41d3c287f67b615f73e5f750583666a7", size = 145287 }
+sdist = { url = "https://files.pythonhosted.org/packages/62/45/2323b5928f86fd29f9afdcef4659f68fa73eaa5356912b774227f5cf46b5/s3transfer-0.11.2.tar.gz", hash = "sha256:3b39185cb72f5acc77db1a58b6e25b977f28d20496b6e58d6813d75f464d632f", size = 147885 }
wheels = [
- { url = "https://files.pythonhosted.org/packages/66/05/7957af15543b8c9799209506df4660cba7afc4cf94bfb60513827e96bed6/s3transfer-0.10.4-py3-none-any.whl", hash = "sha256:244a76a24355363a68164241438de1b72f8781664920260c48465896b712a41e", size = 83175 },
+ { url = "https://files.pythonhosted.org/packages/1b/ac/e7dc469e49048dc57f62e0c555d2ee3117fa30813d2a1a2962cce3a2a82a/s3transfer-0.11.2-py3-none-any.whl", hash = "sha256:be6ecb39fadd986ef1701097771f87e4d2f821f27f6071c872143884d2950fbc", size = 84151 },
]
[[package]] Dans mon environnement, j’ai:
|
Tu trouveras ma belle image |
🤦, j’arrive à reproduire, il manquait un |
Et du coup, le correctif: diff --git a/config/settings/base.py b/config/settings/base.py
index 32bbbf0..cefbcd6 100644
--- a/config/settings/base.py
+++ b/config/settings/base.py
@@ -1,5 +1,6 @@
import os
+from botocore.config import Config
from dotenv import load_dotenv
from machina import MACHINA_MAIN_STATIC_DIR, MACHINA_MAIN_TEMPLATE_DIR
@@ -273,6 +274,13 @@ AWS_S3_ENDPOINT_URL = f"{os.getenv('CELLAR_ADDON_PROTOCOL', 'https')}://{os.gete
AWS_STORAGE_BUCKET_NAME = os.getenv("S3_STORAGE_BUCKET_NAME")
AWS_STORAGE_BUCKET_NAME_PUBLIC = os.getenv("S3_STORAGE_BUCKET_NAME_PUBLIC")
AWS_S3_STORAGE_BUCKET_REGION = os.getenv("S3_STORAGE_BUCKET_REGION")
+# CleverCloud S3 implementation does not support recent data integrity features from AWS.
+# https://github.com/boto/boto3/issues/4392
+# https://github.com/boto/boto3/issues/4398#issuecomment-2619946229
+AWS_S3_CLIENT_CONFIG = Config(
+ request_checksum_calculation="when_required",
+ response_checksum_validation="when_required",
+)
# MEDIA CONFIGURATION
# ------------------------------------------------------------------------------ |
avec le test cassant attendu dans la CI, jusqu'à ce que clever gère ce paramètre |
erreur 500
https://inclusion.sentry.io/issues/27866577/?project=4508410606452816&referrer=project-issue-stream
The text was updated successfully, but these errors were encountered: