How to pass Amazon S3 credentials to mmctl remotely

Hello everyone,

I am trying to export mattermost data. I use Amazon S3 to save attachments. I am not sure how to pass Amazon S3 credentials to the mmctl command.

Here is what I tried :

$ ./mmctl auth login https://my-website.com

$ ./mmctl export create --attachments
$ ./mmctl export job list
ID: yq3t6kkmzpb15xqyjtn8ui6g3w
Type: export_process
Status: error
Created: 2025-10-12 18:30:36 +0530 IST
Started: 2025-10-12 18:30:46 +0530 IST
Data: map[channel_schemes_exported:0 channels_exported:81 direct_channels_exported:655 direct_posts_exported:38294 error:Error during job execution. — exportFileAttachment: Failed to copy file during export., err=The specified key does not exist. include_attachments:true include_roles_and_schemes:true posts_exported:38461 roles_exported:22 team_schemes_exported:0 teams_exported:3 users_exported:174]

How exactly should I pass:

aws_access_key_id and aws_secret_access_key

to the mmctl command?

Please note these are saved in my config.json in the remote server. Can I not tell mmctl to lookup that file?

Thank you,

Ashim

Hello everyone,

Can someone please help me with this?

Thank you,

Ashim

Thanks for the detailed logs, Ashim!

mmctl export ... --attachments runs server-side and pulls from the server’s S3 settings, so there’s no way (or need) to pass aws_access_key_id/aws_secret_access_key to mmctl; instead confirm your S3 config in the Mattermost server’s FileSettings (bucket/region/key/secret, and any path prefix) and IAM permissions, as “The specified key does not exist” often means a bucket/key prefix mismatch. See the docs for Bulk export and for Configuration settings (config.json).

Dear John,

Many thanks for your reply.

I tried going to: System Console > Environment > File Storage > Test Connection

and it worked all OK.

We do not have a path prefix. That setting is empty.

Any ideas for me ?

Many thanks,

Ashim