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

When running an aws command with "Password exec command," get error "/bin/sh: aws: command not found" #7902

Closed
dgilman-hrp opened this issue Sep 7, 2024 · 1 comment
Labels

Comments

@dgilman-hrp
Copy link

Describe the bug

Unable to use Password exec command due to error that aws executable cannot be found.

To Reproduce

Steps to reproduce the behavior:

  1. Add a new Server
  2. Setup necessary fields
  3. Go to Advanced Tab
  4. Copy in aws command in "Password exec command field"
  5. Save

Expected behavior

I expect installed binaries like AWS to be accessible to pgadmin and to be able to login via the password exec command feature.

Error message

2024-09-07 15:25:19,389: ERROR	passexec:	/bin/sh: aws: command not found


2024-09-07 15:25:19,392: ERROR	pgadmin:	Command 'aws rds generate-db-auth-token --hostname <hostname> --port 5432 --region <region> --username <username>' returned non-zero exit status 127.
Traceback (most recent call last):
  File "/Applications/pgAdmin 4.app/Contents/Resources/web/pgadmin/browser/server_groups/servers/__init__.py", line 1294, in create
    status, errmsg = conn.connect(
                     ^^^^^^^^^^^^^
  File "/Applications/pgAdmin 4.app/Contents/Resources/web/pgadmin/utils/driver/psycopg3/connection.py", line 325, in connect
    password = manager.passexec.get()
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/pgAdmin 4.app/Contents/Resources/web/pgadmin/utils/passexec.py", line 42, in get
    p = subprocess.run(
        ^^^^^^^^^^^^^^^
  File "/Applications/pgAdmin 4.app/Contents/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'aws rds generate-db-auth-token --hostname <hostname> --port 5432 --region <region> --username <username>' returned non-zero exit status 127.

Desktop :

  • OS: Sonoma 14.6.1
  • Version: 8.11
  • Mode: Desktop
@dpage
Copy link
Contributor

dpage commented Sep 9, 2024

You need to use absolute paths to external tools that are outside of the search path that pgAdmin is started under (which is likely to be minimal, if you double-clicked from the finder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants