peak / s5cmd

Parallel S3 and local filesystem execution tool.
MIT License
2.7k stars 239 forks source link

Unable to use s5cmd when using aws sso #726

Closed agrawalsourav98 closed 3 months ago

agrawalsourav98 commented 5 months ago

I am using sso for authentication in aws cli and s5cmd throws error when trying to use it with sso. I don't have any other profile configured.

When running, s5cmd ls, I get, ERROR "ls": profile "sso" is configured to use SSO but is missing required configuration: sso_region, sso_start_url and my config is of format,

[profile sso]
sso_session = xxx
sso_account_id = xxx
sso_role_name = xxx
region = us-east-1
output = table
[sso-session xxx]
sso_start_url = xxx
sso_region = us-east-1
sso_registration_scopes = sso:account:access

Even when I update my config to have the information requested in the error, and my updated config looks like this,

[profile sso]
sso_session = xxx
sso_account_id = xxx
sso_role_name = xxx
region = us-east-1
output = table
sso_start_url = xxx
sso_region = us-east-1
sso_registration_scopes = sso:account:access
[sso-session xxx]
sso_start_url = xxx
sso_region = us-east-1
sso_registration_scopes = sso:account:access

I get this error, ERROR "ls": SSOProviderInvalidToken: the SSO session has expired or is invalid caused by: open /home/xxx/.aws/sso/cache/xxx.json: no such file or directory but aws s3 ls works fine.

Is there any additional config to make s3cmd work with sso? And I believe the error in the first error can be mitigated if we reference the sso_session in the profile.

agrawalsourav98 commented 3 months ago

Tested this on main and working after #684