pgadmin-org / pgagent

pgAgent - A job scheduler for PostgreSQL
https://www.pgadmin.org/
Other
97 stars 41 forks source link

hostaddr dont resolve in docker #18

Closed roysbike closed 5 years ago

roysbike commented 5 years ago

Office docker FROM postgres:9.6

pgagent Version: 4.0.0 OS: PRETTY_NAME="Debian GNU/Linux 9 (stretch)

cat /etc/hosts

10.66.33.8 psql_host e31547b61562 10.66.33.9 84f81c219d46

pgagent -f hostaddr=psql_host dbname=${POSTGRES_DB} user=postgres port=5432 password=${POSTGRES_PASSWORD} -l 1 -t 60"


Thu Sep 27 20:34:51 2018 WARNING: Failed to create primary connection: could not parse network address "(null)": Name or service not known
Thu Sep 27 20:34:51 2018 WARNING: Couldn't create the primary connection [Attempt #1]
Thu Sep 27 20:34:57 2018 WARNING: Failed to create primary connection: could not parse network address "(null)": Name or service not known
Thu Sep 27 20:34:57 2018 WARNING: Couldn't create the primary connection [Attempt #2]
Thu Sep 27 20:35:03 2018 WARNING: Failed to create primary connection: could not parse network address "(null)": Name or service not known
pleonex commented 5 years ago

Same here. My workaround was to get the actual IP before.

pg_ip=`getent hosts $POSTGRES_HOST | cut -f 1 -d ' '`
pgagent -f -l 2 hostaddr=$pg_ip port=5432 dbname=postgres user=$POSTGRES_USER
repo-lockdown[bot] commented 5 years ago

Thanks for your Pull Request! :smile: This repo on GitHub is just a mirror of our real git repositories though, and can't really handle PRs. :frowning: Hopefully you can redo the PR, and direct it to the git.postgresql.org repos? We have a developer guide, if that helps: https://wiki.postgresql.org/wiki/So,_you_want_to_be_a_developer%3F. If this was a PR for pgAdmin, please visit https://www.pgadmin.org/docs/pgadmin4/dev/submitting_patches.html.