Permission Denied error while accessing media files

Hi,

I am running Directus version 11.3.5 on Kubernetes, utilizing S3 for media file storage. I am facing an issue with media files where I get 403 forbidden for image/videos after a few hours. When I restart the Directus container, I can access the media files, but the issue persists.

I also checked the S3 access logs, but I did not find 403 for objects. I suspect this could be due to the S3 presigned URL expiring, but I am not sure if I am correct. The following are the env variables using for app.
```
ADMIN_EMAIL: example@dot.com

ADMIN_PASSWORD: ************

CORS_ALLOWED_HEADERS: Content-Type,Autorization/Cache-Control

CORS_ENABLED: “true”

CORS_ORIGIN: “true”

DB_CLIENT: pg

DB_DATABASE: test

DB_HOST: **********

DB_PASSWORD: ***************

DB_PORT: “5432”

DB_USER: ****

LOG_LEVEL: debug

LOG_STYLE: pretty

STORAGE_LOCATIONS: s3

STORAGE_S3_BUCKET: *****

STORAGE_S3_DRIVER: s3

STORAGE_S3_ENDPOINT: s3.us-east-2.amazonaws.com

STORAGE_S3_KEY: ********

STORAGE_S3_REGION: us-east-2

STORAGE_S3_ROOT: /directus_v2/uploads

STORAGE_S3_SECRET: ***********
``

Hi @mahesh - did you find the answer to this problem or are you still encountering it?

Sounds pretty spooky imo. It doesn’t ring a bell for me but I did have some thougts.

For example. if the errors occur, are you able to upload media assets ? That might give you a more detailed error message

Does the pod/container perhaps do anything in particular to setup a connection? Or something like, does the pod get rescheduled to another node that perhaps is not allowed to access AWS.

And lastly I wondered if you have set the SECRET env variable?

Just thinking a bit out loud here :smiling_face:

Are the files making it into S3 correctly? Files randomly disappearing sounds like something you’d see when the container doesn’t have a volume attached and is saving the files to the local disk, which is ephemeral — eg any container restart would clear all those files. The S3 config looks correct, but that’s worth checking just in case :slight_smile: