Skip to content

passexec_name not loaded from servers.json file #10702

Closed

Description

@deefdragon

Describe the bug

passexec_name is not set when a server is loaded from a servers. json file.

To Reproduce

Steps to reproduce the behavior:

  1. Add shared server via server.json with PasswordExecName set
  2. Log in as shared server user. Attempt to log in to server.
  3. Password requested instead of attempting to use the passexec_name set.

Expected behavior

the name of the command to exec is stored with the server, and is used on login.

Desktop (please complete the following information):

  • OS: k8s
  • pgAdmin version: 9.19
  • Mode: kubernetes docker helm
  • Browser (if running in server mode): firefox
  • Package type: docker
  • Application Mode: Server
  • Commit: 062099a 2026-10-27
  • Python Version: 3.15.2
  • Browser: Firefox 158.0

Additional context

I believe the cause is the lack of the addition of PasswordExecName to this section of the code in #10506

Activity

  1. changed the title [-]PGADMIN_REPLACE_SERVERS_ON_STARTUP not loading passexec_name into existing servers[/-] [+]passexec_name not loaded from servers.json file[/+] on Oct 30, 2026
  2. dpage commented on Nov 5, 2026

    @dpage
    Contributor

    Thanks for the report. The key in servers.json is still PasswordExecCommand, and there is no PasswordExecName key. In 9.19 the free-text command was replaced in server mode by an allowlist, and in server mode PasswordExecCommand now holds the name of an entry in SERVER_PASSEXEC_COMMANDS. On import that name is stored as the server's password exec name, and on export the same name is written back out under the same key. The code you linked is the export path. The import side is _load_server_passexec(), which is called from load_database_servers().

    So for a config such as:

    SERVER_PASSEXEC_COMMANDS = {
        'vault': ['/usr/local/bin/get-pg-pass']
    }

    the server entry should contain:

    "PasswordExecCommand": "vault",
    "PasswordExecExpiration": 300

    If that still doesn't work, two other things can cause it:

    • The name must be in SERVER_PASSEXEC_COMMANDS when servers.json is loaded. Otherwise the server is imported without a command, and a warning appears in the container log: "Ignoring the password exec command for server '...' as it is not the name of a command in SERVER_PASSEXEC_COMMANDS."
    • The container only loads servers.json the first time it starts, unless PGADMIN_REPLACE_SERVERS_ON_STARTUP is set. Editing the file after that has no effect on servers that already exist.

    Users connecting to a shared server inherit the owner's command, unless they have chosen a different one (or none) in their own copy of the server's properties.

    Could you try the correct key and let us know whether it works?

  3. deefdragon commented on Nov 6, 2026

    @deefdragon
    Author

    Yup. Setting PasswordExecCommand worked. Missed that that was what needed to have the command key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions