0
votes

I have configured credentials using aws configure. aws configure list looks fine.Python/django is able to locate the credentials in the shell_plus but unable to locate credentials when django is being run through gunicorn / supervisor.

This is weired

1
please share the code, for more clarification - Surajano
Hi, Its nothing to do with the code.WHen running gunicorn as ubuntu user , it is picking up the credentials but running gunicorm with supervisorctl doesn't - Nitish Agarwal
Where are the credentials located? Are they environment vars? - dentemm
Check the user environment used by your gunicorn /supervisor. Otherwise, you must make them point to the user where you setup the access using aws configure. - mootmoot

1 Answers

2
votes

When you run aws configure you will write files linked to your profile as they will be written in ~/.aws/config and ~/.aws/credentials.

When you run your application, the application will look for those files using the same logic, ie.~/.aws/credentials.

When in a shell, the interpreter will try to translate ~ to an absolute path based on $(whoami).

TL;DR - You must run aws configure with the same user as your application is running with.