My application stopped working after upgrading aiobotocore from version 2.17.0 to 2.21.0. If someone could help ? #1319
-
IntroductionIt's my first post here. ContextWe use (and we appreciate a lot) aiobotocore on our application for more than 2 years. The main components of our solution are :
We have done an update of our requirements.txt from aiobotocore In fact, the break changes appear from aiobotocore With this update, our put instruction fails. The part where it break is here : case BaseModel() | dict() | list():
if isinstance(object,dict) or isinstance(object,list):
print("Traitement demandé : dict ou list")
out_datas = json.dumps(object)
else:
print("Traitement demandé : BaseModel")
out_datas = object.model_dump_json()
buffer_io = BytesIO(out_datas.encode('utf-8'))
buffer_io.seek(0)
try:
res = await s3_client.put_object(
Bucket=object_definition.object_base,
Key=s3_object_global_name,
Body=buffer_io.getvalue(),
ContentType=s3_content_type,
)
print(f"Retour sur l'appel S3 put_object {res}")
# Vérifiez si l'objet existe
res_head = await s3_client.head_object(
Bucket=object_definition.object_base,
Key=s3_object_global_name
)
print("Informations sur l'objet après upload :", res_head)
except Exception as e:
print("DÉBUT DEBUG put_object ---")
print("Bucket S3 :", object_definition.object_base)
print("Clé S3 :", s3_object_global_name)
print("ContentType:", s3_content_type)
print("Données envoyées (JSON):", out_datas)
print("Longueur données envoyées (bytes):", len(buffer_io.getvalue()))
print("FIN DEBUG ---")
texte_erreur = f"Erreur driver S3 - Opération put_object - Bucket={object_definition.object_base} - Key={s3_object_global_name} - ContentType={s3_content_type}"
raise ValueError(f"{texte_erreur}\n{e}") The error message is: An error occurred (InvalidArgument) when calling the PutObject operation: Invalid Argument. I read the release notes without finding nothing. Is there anybody able to help me ? Thanks a lot for your help in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
of critical importance is if your botocore matches our requirements in each version |
Beta Was this translation helpful? Give feedback.
-
Salut and thank you for reporting the issue! aiobotocore 1.18.0 included support for botocore 1.36.x, which introduced several changes related to S3, in particular with regards to checksums: Are you working with third-party S3-compatible object storage services, i.e. not AWS S3 buckets? Many users of such services have reported issues with their applications recently. Another possibility is that your application somehow sets custom configuration that needs to be adjusted to be compatible with botocore >=1.36.0 and thus aiobotocore >= 1.18.0. |
Beta Was this translation helpful? Give feedback.
In that case, please take a look at boto/boto3#4398. This is not aiobotocore related.