django-s3-sqlite
django-s3-sqlite copied to clipboard
The provided token is malformed or otherwise invalid
Hi there,
i'm getting:
botocore.exceptions.ClientError: An error occurred (InvalidToken) when calling the PutObject operation: The provided token is malformed or otherwise invalid.
I've been exploring the below (bottom of base.py) but no luck so far. Would you have any insights?
Thanks,
Andy.
self.s3.Object(
self.settings_dict["BUCKET"], self.settings_dict["REMOTE_NAME"],
).put(Body=file_bytes, ContentMD5=base64.b64encode(binascii.unhexlify(current_md5)).decode("utf-8"))
I've tried adding region info but no luck either.
self.s3 = boto3.resource(
"s3", region_name='eu-west-2', config=botocore.client.Config(signature_version=signature_version),
)
No progress from me as of yet. I suspect using a dedicated session where you specify region_name will help.
session = boto3.session.Session(aws_access_key_id=settings.AWS_ACCESS_KEY_ID,
aws_secret_access_key=settings.AWS_SECRET_ACCESS_KEY,
region_name=settings.S3TOOLS_REGION, )
@andytwoods Im late to the party. Did you ever find a resolution for this? I'm having the same exact problem.
@andytwoods Im late to the party. Did you ever find a resolution for this? I'm having the same exact problem.
Sorry don't think we ended up using this.