Cannot set up Oracle bucket for django static files storage

I've been trying to set my bucket as django static file storage, but I keep getting this error:

botocore.exceptions.ClientError: An error occurred (403) when calling the HeadObject operation: Forbidden

Fyi I'm using an oracle customer secret key as the AWS_SECRET_ACCESS_KEY, as instructed in: https://docs.oracle.com/iaas/Content/Object/Tasks/s3compatibleapi.htm

I'm also sure that the information on the parametres is valid:

ORACLE_BUCKET_NAME = '<snip>'
ORACLE_BUCKET_NAMESPACE = '<snip>'
ORACLE_REGION = 'sa-saopaulo-1'

AWS_ACCESS_KEY_ID = '<snip>'
AWS_SECRET_ACCESS_KEY = '<snip>'
AWS_STORAGE_BUCKET_NAME = ORACLE_BUCKET_NAME
AWS_S3_CUSTOM_DOMAIN = f"{ORACLE_BUCKET_NAMESPACE}.compat.objectstorage.sa-saopaulo-1.oraclecloud.com"
AWS_S3_ENDPOINT_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}"
AWS_S3_OBJECT_PARAMETERS = {
    'CacheControl': 'max-age=86400',
}
AWS_DEFAULT_ACL = ''
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
STATIC_URL = f"https://{AWS_S3_CUSTOM_DOMAIN}/{ORACLE_BUCKET_NAME}/"

I have the same problem as you, after trying and changing some policies I was able to connect to the bucket. Allow your user in the compartment to have right to manage Allow group Object-Administrators to manage object-family in compartment id ocid1.tenancy.oc1..aaaaa....

I also made the bucket publicly.

Here my setting.py

AWS_ACCESS_KEY_ID = os.environ.get("ACCESS_KEY_ID", None)
AWS_SECRET_ACCESS_KEY = os.environ.get("SECRET_ACCESS_KEY", None)
AWS_STORAGE_BUCKET_NAME = os.environ.get("STORAGE_BUCKET_NAME", None)
AWS_S3_ENDPOINT_URL = os.environ.get("BUCKET_ENDPOINT_URL", None)
AWS_S3_OBJECT_PARAMETERS = {
    'CacheControl': 'max-age=86400',
}
AWS_LOCATION = AWS_STORAGE_BUCKET_NAME
STATIC_URL = 'https://%s/%s/' % (AWS_S3_ENDPOINT_URL, AWS_LOCATION)
STATICFILES_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
Back to Top