- S3 upload failed: operation error S3: PutObject,...
# ask-ai
l
• S3 upload failed: operation error S3: PutObject, https response error StatusCode: 403, RequestID: TPM6CEHZB39TJ5Y3, HostID: u7iQS+ALMp8YA2sXw0u/tbLyKCeQhIgp2ybtmLTPsPS1FXWWmMJ2pWySRvJL9sGhoJ0lwmvda8w=, api error InvalidAccessKeyId: The AWS Access Key Id you provided does not exist in our records. can you please check this
t
Thanks for reaching out, Pavan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I see the S3 upload failed with an "InvalidAccessKeyId" (AWS says the Access Key Id doesn't exist). I can help you fix this — to proceed I need a bit more info: 1. Which LiveKit project or egress job is this for (project ID or egress job ID)? 2. Which S3 bucket name and region are you targeting? 3. How are you supplying AWS credentials to LiveKit? (environment variables, Egress output config, or another method) 4. Can you confirm the
access_key
value you're using (partial is fine—first 4 and last 4 characters) and whether that IAM key was recently rotated or deleted? What I’ll do once you share that: • Verify how the credentials are being passed to the egress and look for mismatches (wrong account, deleted key, or region/bucket mismatch). • Advise the exact fix (update credentials, create a new IAM key, or correct config) and the minimal steps to apply it. Share the above details and I’ll guide you through the next steps. Sources: Egress output types | LiveKit docs | server-sdk-ruby | livekit/livekit_composite | DeepWiki
l
my aws creds are correct can you tell me the solution
t
Thanks — I hear you; let's get this resolved. Since the error explicitly says the Access Key ID doesn't exist, we need to confirm where the mismatch is happening. Please provide: 1. LiveKit project ID or egress job ID (so I can trace the job). 2. S3 bucket name and region. 3. How the AWS credentials are supplied to LiveKit (environment variables, egress output `access_key`/`secret`, or IAM role). 4. The first 4 and last 4 characters of the Access Key ID you believe is correct (e.g., ABCD...WXYZ). 5. Whether the IAM user/key was recently rotated, deleted, or created in a different AWS account. If you prefer quick checks you can run now: • Confirm the key exists in AWS IAM: go to IAM > Users > Security credentials and verify the Access Key ID matches. • Verify the key is active (not inactive/deleted). • Ensure the key belongs to the same AWS account as the target bucket. • Check for environment/config overrides where an old key might be applied. Share the requested details and I'll guide you through the exact fix.
l
egress job ID : EG_DQ7YHEDoHxF4 S3_BUCKET=physical-consultation S3_REGION=ap-south-1
t
Thanks — I’m looking at the egress job EG_DQ7YHEDoHxF4 for bucket physical-consultation in ap-south-1. To give a specific solution I need one more key detail: How are you supplying AWS credentials to LiveKit for this egress job? • environment variables on the host (e.g.,
AWS_ACCESS_KEY_ID
/
AWS_SECRET_ACCESS_KEY
) • the egress output
access_key
/
secret
fields in the job config • an attached IAM role (instance/EKS task role) or other method Also please confirm the first 4 and last 4 characters of the Access Key ID you expect to be used (e.g., ABCD...WXYZ). With that I will tell you the exact fix (update the job config / env / role or rotate the key) and the minimal steps to apply it.
l
async with api.LiveKitAPI(LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET) as lkapi: egress_request = api.RoomCompositeEgressRequest( room_name=room_name, layout="speaker", preset=api.EncodingOptionsPreset.H264_720P_30, audio_only=False, file_outputs=[api.EncodedFileOutput( file_type=api.EncodedFileType.MP4, filepath=f"{room_name}.mp4", s3=api.S3Upload( access_key=settings.S3_KEY_ID, secret=settings.S3_KEY_SECRET, region=settings.S3_REGION, bucket=settings.S3_BUCKET, ) )] ) egress_info = await lkapi.egress.start_room_composite_egress(egress_request)
t
Thanks — I can see you're supplying credentials directly in the egress
s3
object (
access_key=settings.S3_KEY_ID
,
secret=settings.S3_KEY_SECRET
). Since AWS returns InvalidAccessKeyId, try these targeted checks and actions: 1. Confirm the exact Access Key ID LiveKit is sending • Print/log
settings.S3_KEY_ID
from the process running this egress request to verify it's the value you expect (show first 4 / last 4 chars only). 1. Verify the key exists and is active in the same AWS account & region • In AWS Console → IAM → Users → Security credentials, find that Access Key ID and confirm its status is Active. • Ensure the key belongs to the same AWS account that owns the
physical-consultation
bucket. 1. Check for accidental whitespace/encoding issues • Ensure
settings.S3_KEY_ID
has no leading/trailing whitespace or hidden characters (trim it or compare lengths). • Ensure the key string is not URL- or base64-encoded accidentally. 1. Confirm LiveKit process is using the same
settings
values • If your app runs in multiple environments or containers, confirm the running instance that called the egress used the updated settings (restart the process after changes if needed). 1. Test the credentials directly with AWS CLI from the same host • Configure the AWS CLI with the same key/secret and run a simple
aws s3 ls s3://physical-consultation --region ap-south-1
to confirm the key is valid and has permissions. 1. If the key is missing in IAM or was rotated/deleted • Create a new Access Key under the intended IAM user, update
settings.S3_KEY_ID
/
settings.S3_KEY_SECRET
with the new values in the environment or config, then restart your app and re-run the egress. 1. Confirm IAM permissions • Ensure the IAM user has
s3:PutObject
permission for the bucket (and any bucket policy does not block the user/account). If you prefer, share the first 4 and last 4 characters of
settings.S3_KEY_ID
and the output of
aws sts get-caller-identity
(when using the same key on the host) and I’ll help interpret the results and next steps. Would you like help with the CLI commands to run these tests?