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

Pgadmin error while doing backup with pgpass file #207

Open
aver33 opened this issue Jun 12, 2023 · 0 comments
Open

Pgadmin error while doing backup with pgpass file #207

aver33 opened this issue Jun 12, 2023 · 0 comments

Comments

@aver33
Copy link

aver33 commented Jun 12, 2023

Describe the bug
I am using pgadmin4 chart version 1.15.2.
Helm version: 3.10.1.
Kubernetes version: 1.25.
In my configuration I am using pgpassfile. It works for connect to any databases. But if I am trying to do backup database via context menu in UI, I get the error:

Backing up an object on the server 'someServer1 (someHost1:5432)' from database 'someDb1'
Running command:
/usr/local/pgsql-14/pg_dump --file "/var/lib/pgadmin/storage/pgadmin123/test" --host "someHost1" --port "5432" --username "someUser1" --no-password --verbose --role "someUser1" --format=c --blobs "someDb1"

My values seems like that (I am using pgadmin4 via dependency):

pgadmin4:
  serverDefinitions:
    enabled: true
    servers:
      firstServer:
        Name: "someServer1"
        Group: "Servers"
        Host: "someHost1"
        PassFile: "../../pgpass"
        Port: 5432
        MaintenanceDB: "someDb1"
        Username: "someUser1"
        SSLMode: "disable"
      secondServer:
        Name: "someServer2"
        Group: "Servers"
        Host: "someHost2"
        PassFile: "../../pgpass"
        Port: 5432
        MaintenanceDB: "someDb2"
        Username: "someUser2"
        SSLMode: "disable"
        ...
  env:
    email: "someValue"
    password: "somePassword"
  extraSecretMounts:
    - name: passfile-pgadmin
      secret: passfile-pgadmin
      mountPath: /pgpass
  extraInitContainers: |
    - name: prepare-pgpass
      image: docker.io/dpage/pgadmin4:6.2
      command: [ 'sh', '-c', "cp /pgpass /var/lib/pgadmin/pgpass && chown pgadmin:pgadmin /var/lib/pgadmin/pgpass && chmod 600 /var/lib/pgadmin/pgpass " ]
      volumeMounts:
        - name: pgadmin-data
          mountPath: /var/lib/pgadmin
        - name: passfile-pgadmin
          subPath: pgpass
          mountPath: /pgpass
      securityContext:
        runAsUser: 0

If I do this without pgpassfile, backup is successful.
Also this problem occurs when I'm trying to execute script (for example, materialized view) via context menu. I am getting the error:

psql: error: connection to server at "someHost1" (someIP1), port 5432 failed: fe_sendauth: no password supplied.

Looks like this is a problem with all commands that using psql. Psql is not seeing passwords from pgpassfile and return the errors.

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

No branches or pull requests

1 participant