Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Failed to refresh process-based credentials." when connecting to AWS #1529

Closed
jakul opened this issue Feb 5, 2020 · 3 comments
Closed

"Failed to refresh process-based credentials." when connecting to AWS #1529

jakul opened this issue Feb 5, 2020 · 3 comments
Labels
auth bug We can reproduce the issue and confirmed it is a bug.

Comments

@jakul
Copy link

jakul commented Feb 5, 2020

Describe the bug
I cannot use my existing AWS profile inside AWS toolkit, as i receive the error Failed to refresh process-based credentials.

I use a custom process (an in-house Python cli called Wrench) to obtain time-limited credentials for a IAM role when connecting to AWS. This works fine on the command line, but not inside PyCharm. I have used this process for years now, so the problem is not there.

I install Wrench in a pyenv Python 3.6 environment. My system Python is 3.7. I recently had a very similar issue where it wasn't possible for the aws cli to get credentials from the custom process because I had pip install awscli into Python 3.7. That's fixed now, and $ aws sts get-caller-identity correctly gets the credentials from the custom process.

I am able to connect to AWS using a profile which does not use the custom process.

I'm unable to see any relevant info in the PyCharm log file. Is there somewhere else I can look to debug this?

Expected behavior
I am able to connect to AWS using the same profile in PyCharm that I use on the shell.

Screenshots
Captura de Tela 2020-02-05 às 10 45 11

Your Environment

  • OS: macOs Catalina 10.15.3
  • JetBrains' Product: PyCharm
  • JetBrains' Product Version: 2019.3
  • Toolkit Version: 1.10-193
  • SAM CLI Version: Not installed.
  • JVM/Python Version: JVM 11.0.5 (I think). System Python is Homebrew 3.7, AWS CLI and Wrench installed into virtualenvs created from pyenv 3.6
@jakul jakul added the bug We can reproduce the issue and confirmed it is a bug. label Feb 5, 2020
@abrooksv
Copy link
Contributor

abrooksv commented Feb 5, 2020

Sadly the log statement we need to debug this has not been released to stable channel yet. If I had to take a shot in the dark, I would guess environment variables are causing issues since Mac apps launched from gui do not inherit them.

Things to try

  1. Try to launch the ide from a terminal
  2. Wrap the credentials process command in a shell script so it runs in a terminal environment and has env vars / .bashrc info

@jakul
Copy link
Author

jakul commented Feb 5, 2020

Thanks for the quick response!

The problem is definitely the environment that PyCharm launches in - when I launch it from the terminal I'm able to connect using any of the AWS profiles I have setup.

Thanks for the help @abrooksv

@jakul jakul closed this as completed Feb 5, 2020
@FnTm
Copy link

FnTm commented Apr 21, 2020

For what it's worth - I had this exact same problem, and

  1. Enabling shell scripts in the Toolbox https://blog.jetbrains.com/blog/2018/08/23/toolbox-app-1-11-whats-new/ ,
  2. And launching from CLI ($ idea)

helped solve this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth bug We can reproduce the issue and confirmed it is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants