aws-export-credentials icon indicating copy to clipboard operation
aws-export-credentials copied to clipboard

Credentials.__new__() takes 5 positional arguments but 6 were given

Open philippkeller opened this issue 8 months ago • 9 comments

  • I installed aws-export-credentials with pipx
  • which aws-export-credentials -> /Users/philipp/.local/bin/aws-export-credentials

If I start aws-export-credentials without any params I get error

Credentials.__new__() takes 5 positional arguments but 6 were given

Any advice?

philippkeller avatar Mar 18 '25 13:03 philippkeller

+1 Seeing this as well

flatherskevin avatar Mar 18 '25 18:03 flatherskevin

This tool is no longer maintained, because there's native support for it in the AWS CLI: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/configure/export-credentials.html That said, I'll take a look at what changed in botocore

benkehoe avatar Mar 19 '25 07:03 benkehoe

What's the output when you run with --debug?

benkehoe avatar Mar 19 '25 17:03 benkehoe

@benkehoe I did not debug it yet just saw this error today also

DEBUG:botocore.credentials:Retrieved credentials will expire at: 2025-04-15 19:43:30+00:00
Traceback (most recent call last):
  File "~/.local/share/mise/installs/python/3.13.2/lib/python3.13/site-packages/aws_export_credentials/aws_export_credentials.py", line 191, in main
    credentials = get_credentials(session, ensure_temporary=args.ensure_temporary)
  File "~/.local/share/mise/installs/python/3.13.2/lib/python3.13/site-packages/aws_export_credentials/aws_export_credentials.py", line 103, in get_credentials
    credentials = convert_creds(read_only_credentials, expiration)
  File "~/.local/share/mise/installs/python/3.13.2/lib/python3.13/site-packages/aws_export_credentials/aws_export_credentials.py", line 50, in convert_creds
    return Credentials(*list(read_only_creds) + [expiration])

created PR to Fix it

https://github.com/benkehoe/aws-export-credentials/pull/20

alexshenia avatar Apr 15 '25 07:04 alexshenia

+1

steve-ochoa avatar Apr 23 '25 18:04 steve-ochoa

Was facing this issue, made a temporary fix by downgrading boto3 for aws-export-credentials

pipx inject aws-export-credentials boto3==1.28.57

pranav-md avatar May 15 '25 19:05 pranav-md

@pranav-md u can use 1.36.26

alexshenia avatar May 22 '25 08:05 alexshenia

while export-credentials.html has been introduced to aws cli, it doesn't support export to a credentials file (AWS_SHARED_CREDENTIALS_FILE)

avoidik avatar May 22 '25 13:05 avoidik

Full command to run nowadays (with ux): uvx --with "boto3==1.36.26" aws-export-credentials

uhinze avatar Sep 22 '25 04:09 uhinze