jakob / Postico

Public issue tracking for Postico
https://eggerapps.at/postico/
475 stars 9 forks source link

Pre-connect shell script not working #879

Open ybasket opened 5 months ago

ybasket commented 5 months ago

What did you do?

#!/bin/bash
cat <<eof
{
"sslmode":"prefer"
}
eof
echo "$PGPASSWORD"
echo "[hardcoded password]"

I had the scripts print their output to stderr, it looks exactly as I'd expect, either the plain password or the JSON.

What did you expect to happen?

What actually happened?

The server rejected the password provided by the pre-connect shell script.

This is similar to #875, but different from there, it always fails and not only when using RDS Proxy.

What software versions are you using?

Postico version:
Version 2.1 dev (9685) – but I also tried 9669.

macOS version:
14.4.1 (23E224)

PostgreSQL version:
16.1 on AWS RDS, postgres:16-alpine via Docker

jakob commented 5 months ago

It looks like I really need to add some kind of debug button for shell scripts. It's impossible to tell what password Postico is trying to use.

Is it possible you have something in your bash profile that prints something to stdout?

ybasket commented 5 months ago

It looks like I really need to add some kind of debug button for shell scripts. It's impossible to tell what password Postico is trying to use.

That would indeed be great. Little side request: I'd also appreciate if Undo/Redo would work on the script text field.

Is it possible you have something in your bash profile that prints something to stdout?

Not that I'm aware of. I'm usually using zsh where oh-my-zsh could interfere, but I explicitly added shebangs like #!/bin/bash and #!/bin/sh and these shells definitely have no special setups. Didn't help, the behaviour is the same.