[Dovecot] Fwd: Dovecot cannot connect to PostgreSQL server
I set the host to 127.0.0.1 now. And my pg_hba.conf looks like that:
# TYPE DATABASE USER ADDRESS METHOD # Mail stuff host mail mailreader 127.0.0.1/32 md5 host mail mailreader ::1/128 md5 local all all md5 host all all 127.0.0.1/32 ident host all all ::1/128 ident
The folder /var/run/postgresql is not existing on my machine.
The problem is still present. :(
On Sat, Apr 26, 2014 at 11:39 PM, Steffen <skdovecot@smail.inf.fh-brs.de>wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Chris Vaas wrote:
I am currently facing the following log output:
Apr 26 16:40:28 h2290750 dovecot: auth: Error: pgsql(localhost): Connect failed to database mail: could not connect to server: Permission denied Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011Is the server running on host "localhost" (::1) and accepting Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011TCP/IP connections on port 5432?
I have double checked the database. It is listening correctly and I can connect to it via
psql -U mailreader mail
I provided all necessary information to dovecot via this configuration snippet:
driver = pgsql connect = host=localhost dbname=mail user=mailreader password=secret default_pass_scheme = SHA512
does Postgres allow connections on "host ::1" for user mailreader ? Actually I wonder, because I thought the Postgres lib defaults to "local" (socket) by default on localhost -> does Postgres allow connections on "local" for mailreader? Permissions are configured in pg_hba.conf, but -> Does Postgres logs something? It should if PG denies the connection.
Do you have SELinux or something like that running?
I remember that I had a server that had wrong permissions on:
ls -al /var/run/postgresql
drwxrwsr-x 2 postgres postgres 4096 Feb 10 07:32 ./ srwxrwxrwx 1 postgres postgres 0 Apr 26 23:15 .s.PGSQL.5432=
the .s.PGSQL. socket is the local socket usually used for localhost connections and automatically found by libpg.
Steffen -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with undefined - http://www.enigmail.net/
iQEVAwUBU1wnoXD1/YhP6VMHAQJh8gf/fyThDqYhNiMXk6YNtwgiAT8MLyCblXOR 1/4scQAFQUTbHgOODBfoJkoTdtsmhBu0UmxNe9Y/1Y+j2pAcVU2GrJAGLEED1Is0 OmPPptnrdGaqjsIaybIDpmuJM7vqmOYhPMvAOGVXdgXdKa5QQZU3hgo/fH1xdIrj j45LEfLE8Cu9QedOolXz4adFLk2XuRylMJWhQWrsT3yutr38Nv6wqhRDl7Rxwo4p 2y1b2GiBTZkVHXzUs0a2UKxOsYsgQVgCcN6wCyio0ogCTAKwHWeQ00rUpNmn9COw xKf5nhFPR8RYlCKukk7Djb2aklIfvko6S9+QoCKZEufjNi/moA4pcg== =1sd0 -----END PGP SIGNATURE-----
Dear Chris.
Am 27-04-2014 17:17, schrieb Chris Vaas:
I set the host to 127.0.0.1 now. And my pg_hba.conf looks like that:
[snipp]
The folder /var/run/postgresql is not existing on my machine.
The problem is still present. :(
What's the output of
root # lsof -np $( pgrep -fl bin/postgres|awk '{print $1}' ) root # netstat -tlnp|egrep postgres
BR Aleks
On Sat, Apr 26, 2014 at 11:39 PM, Steffen <skdovecot@smail.inf.fh-brs.de>wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Chris Vaas wrote:
I am currently facing the following log output:
Apr 26 16:40:28 h2290750 dovecot: auth: Error: pgsql(localhost): Connect failed to database mail: could not connect to server: Permission denied Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011Is the server running on host "localhost" (::1) and accepting Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011TCP/IP connections on port 5432?
I have double checked the database. It is listening correctly and I can connect to it via
psql -U mailreader mail
I provided all necessary information to dovecot via this configuration snippet:
driver = pgsql connect = host=localhost dbname=mail user=mailreader password=secret default_pass_scheme = SHA512
does Postgres allow connections on "host ::1" for user mailreader ? Actually I wonder, because I thought the Postgres lib defaults to "local" (socket) by default on localhost -> does Postgres allow connections on "local" for mailreader? Permissions are configured in pg_hba.conf, but -> Does Postgres logs something? It should if PG denies the connection.
Do you have SELinux or something like that running?
I remember that I had a server that had wrong permissions on:
ls -al /var/run/postgresql
drwxrwsr-x 2 postgres postgres 4096 Feb 10 07:32 ./ srwxrwxrwx 1 postgres postgres 0 Apr 26 23:15 .s.PGSQL.5432=
the .s.PGSQL. socket is the local socket usually used for localhost connections and automatically found by libpg.
Steffen -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) Comment: Using GnuPG with undefined - http://www.enigmail.net/
iQEVAwUBU1wnoXD1/YhP6VMHAQJh8gf/fyThDqYhNiMXk6YNtwgiAT8MLyCblXOR 1/4scQAFQUTbHgOODBfoJkoTdtsmhBu0UmxNe9Y/1Y+j2pAcVU2GrJAGLEED1Is0 OmPPptnrdGaqjsIaybIDpmuJM7vqmOYhPMvAOGVXdgXdKa5QQZU3hgo/fH1xdIrj j45LEfLE8Cu9QedOolXz4adFLk2XuRylMJWhQWrsT3yutr38Nv6wqhRDl7Rxwo4p 2y1b2GiBTZkVHXzUs0a2UKxOsYsgQVgCcN6wCyio0ogCTAKwHWeQ00rUpNmn9COw xKf5nhFPR8RYlCKukk7Djb2aklIfvko6S9+QoCKZEufjNi/moA4pcg== =1sd0 -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sun, 27 Apr 2014, Chris Vaas wrote:
[fixed ugly top posting]
On Sat, Apr 26, 2014 at 11:39 PM, Steffen <skdovecot@smail.inf.fh-brs.de>wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Chris Vaas wrote:
I am currently facing the following log output:
Apr 26 16:40:28 h2290750 dovecot: auth: Error: pgsql(localhost): Connect failed to database mail: could not connect to server: Permission denied Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011Is the server running on host "localhost" (::1) and accepting Apr 26 16:40:28 h2290750 dovecot: auth: Error: #011TCP/IP connections on port 5432?
I have double checked the database. It is listening correctly and I can connect to it via
psql -U mailreader mail
I provided all necessary information to dovecot via this configuration snippet:
driver = pgsql connect = host=localhost dbname=mail user=mailreader password=secret default_pass_scheme = SHA512
does Postgres allow connections on "host ::1" for user mailreader ? Actually I wonder, because I thought the Postgres lib defaults to "local" (socket) by default on localhost -> does Postgres allow connections on "local" for mailreader? Permissions are configured in pg_hba.conf, but -> Does Postgres logs something? It should if PG denies the connection.
I set the host to 127.0.0.1 now. And my pg_hba.conf looks like that:
# TYPE DATABASE USER ADDRESS METHOD # Mail stuff host mail mailreader 127.0.0.1/32 md5 host mail mailreader ::1/128 md5 local all all md5 host all all 127.0.0.1/32 ident host all all ::1/128 ident
What about the "Does Postgres logs something?"
Do you have SELinux or something like that running?
What about this question?
I remember that I had a server that had wrong permissions on:
ls -al /var/run/postgresql
drwxrwsr-x 2 postgres postgres 4096 Feb 10 07:32 ./ srwxrwxrwx 1 postgres postgres 0 Apr 26 23:15 .s.PGSQL.5432=
the .s.PGSQL. socket is the local socket usually used for localhost connections and automatically found by libpg.
The folder /var/run/postgresql is not existing on my machine.
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBU134pnz1H7kL/d9rAQK/8wf/QAQmoptFYhONUirtD6rNy6WUYykF+ojV ZKkN6zCkXtIpp/oNj/KkvOMY0WgzgU7IalPtA0AIRzpc13fbWf+p5Gymhie4DbdK DiTKgZR6Nmc4qVqZ7ChC7bcRTbKppO+LmIkcMgyIk3PbWhcJKd/gLHyTpgstijC0 BJWK3lf5z+RnsFmvjsonveCRat7gjElirgapwbNkU3VyvmQVOxJbE/u/NdqcprR8 xyzIXZZ1hRADh05QNdpaayW7hsCbf525jWZAA9bsZ8JfGs05OrDqJtbNYgf5V3jR TV6dVIr0tBuihBsIS2KdlCiQkUI/KYnv1ye+Ei2bJ4JDt/VLmKM8OQ== =z78b -----END PGP SIGNATURE-----
participants (3)
-
Aleksandar Lazic
-
Chris Vaas
-
Steffen Kaiser