DBI Connect .... error ...

thiagotgc

Active Member
Dec 17, 2019
144
16
38
36
I've been having this error for a few days now.

Every day when I arrive in the morning, I see that mistake.

Error.png

Nothing has been changed, just updated, just like every beginning of the week.

This error appears on the query screens

However, graphics and statistics also do not work.

E-mails received are on hold ...
 
Is the postgresql server running?
 
Check the logs of the server (journalctl -r) when the error occurs - if we don't know where the error originates we cannot give you a hint where to look for a solution

I hope this helps!
 
Looking at the LOG (mail.log) it has occurred at 06: 00hrs

I will list some lines here to facilitate.

Code:
Mar  1 06:00:02 pmg pmg-smtp-filter[26536]: WARNING: Use of uninitialized value $ip in pattern match (m//) at /usr/share/perl5/PMG/RuleCache.pm line 243.
Mar  1 06:00:02 pmg pmg-smtp-filter[26536]: WARNING: Use of uninitialized value $ip in pattern match (m//) at /usr/share/perl5/PMG/RuleCache.pm line 243.
Mar  1 06:00:03 pmg pmgpolicy[1390]: Received a SIG HUP
Mar  1 06:00:03 pmg pmgpolicy[1390]: 2020/03/01-06:00:03 Server closing!
Mar  1 06:00:03 pmg pmgpolicy[1390]: 2020/03/01-06:00:03 Re-exec server during HUP
Mar  1 06:00:04 pmg pmgpolicy[1390]: WARNING: Pid_file created by this same process. Doing nothing.
Mar  1 06:00:04 pmg pmgpolicy[1390]: WARNING: Pid_file created by this same process. Doing nothing.
Mar  1 06:00:04 pmg pmgpolicy[1390]: 2020/03/01-06:00:04 main (type Net::Server::PreForkSimple) starting! pid(1390)
Mar  1 06:00:04 pmg pmgpolicy[1390]: Binding open file descriptors
Mar  1 06:00:04 pmg pmgpolicy[1390]: Binding to TCP port 10022 on host 127.0.0.1 with IPv4
Mar  1 06:00:04 pmg pmgpolicy[1390]: Reassociating file descriptor 5 with TCP on [127.0.0.1]:10022, using IPv4
Mar  1 06:00:04 pmg pmgpolicy[1390]: Group Not Defined.  Defaulting to EGID '0'
Mar  1 06:00:04 pmg pmgpolicy[1390]: User Not Defined.  Defaulting to EUID '0'
Mar  1 06:00:04 pmg pmgpolicy[1390]: Setting up serialization via flock
Mar  1 06:00:04 pmg pmgpolicy[1390]: Policy daemon (re)started
Mar  1 06:00:04 pmg pmgpolicy[1390]: Beginning prefork (5 processes)
Mar  1 06:00:04 pmg pmgpolicy[1390]: Starting "5" children


Mar  1 06:04:55 pmg pmgpolicy[26661]: WARNING: WARNING:  terminating connection because of crash of another server process#012DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.#012HINT:  In a moment you should be able to reconnect to the database and repeat your command.
Mar  1 06:04:55 pmg pmgpolicy[26661]: Database connection broken - trying to reconnect
Mar  1 06:04:55 pmg pmgpolicy[26661]: unable to reconnect to database server: DBI connect('dbname=Proxmox_ruledb;host=/var/run/postgresql;port=5432','root',...) failed: could not connect to server: No such file or directory#012#011$12#011Is the server running locally and accepting#012#011connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? at /usr/share/perl5/PMG/DBTools.pm line 72.


Mar  1 06:04:59 pmg pmg-smtp-filter[26527]: WARNING: WARNING:  terminating connection because of crash of another server process#012DETAIL:  The postmaster has commanded this server process to roll back the current transaction and $n and exit, because another server process exited abnormally and possibly corrupted shared memory.#012HINT:  In a moment you should be able to reconnect to the database and repeat your command.
Mar  1 06:04:59 pmg pmg-smtp-filter[26527]: DBD::Pg::st execute failed: server closed the connection unexpectedly#012#011This probably means the server terminated abnormally#012#011before or while processing the request. at /usr/sh$usr/share/perl5/PMG/RuleDB/Spam.pm line 148.
 
Since the problem seems to occur in postgresql (the database server) - the logs won't be found in the mail.log
-> check the syslog or (as suggested) the journal for messages from postgresql

additionally you should find some hints in the postgresql log:
/var/log/postgresql/*log
 
Evidence In syslog:

Code:
Mar  4 06:00:01 pmg systemd[1]: Starting Hourly Proxmox Mail Gateway activities...

Mar  4 06:02:14 pmg pmgpolicy[1582]: starting policy database maintainance (greylist, rbl)
Mar  4 06:02:14 pmg postgresql@11-main[27345]: Cluster is not running.
Mar  4 06:02:14 pmg systemd[1]: postgresql@11-main.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Mar  4 06:02:14 pmg systemd[1]: postgresql@11-main.service: Failed with result 'exit-code'.
Mar  4 06:02:14 pmg pmgpolicy[1582]: ERROR: DBI connect('dbname=Proxmox_ruledb;host=/var/run/postgresql;port=5432','root',...) failed: could not connect to server: No such file or directory#012#011Is the server running locally and $y and accepting#012#011connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? at /usr/share/perl5/PMG/DBTools.pm line 72.
Mar  4 06:02:55 pmg pmg-smtp-filter[25981]: starting database maintainance
Mar  4 06:02:55 pmg pmg-smtp-filter[25981]: ERROR: DBI connect('dbname=Proxmox_ruledb;host=/var/run/postgresql;port=5432','root',...) failed: could not connect to server: No such file or directory#012#011Is the server running local$ locally and accepting#012#011connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? at /usr/share/perl5/PMG/DBTools.pm line 72

Mar  4 06:03:49 pmg postfix/smtpd[27352]: warning: queue_minfree(20971520) should be at least 1.5*message_size_limit(52428800)
Mar  4 06:03:49 pmg postfix/smtpd[27352]: connect from avas.hostlp.cloud[x.x.x.x]
Mar  4 06:03:49 pmg pmgpolicy[27196]: WARNING: WARNING:  terminating connection because of crash of another server process#012DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, $exit, because another server process exited abnormally and possibly corrupted shared memory.#012HINT:  In a moment you should be able to reconnect to the database and repeat your command.
Mar  4 06:03:49 pmg pmgpolicy[27196]: Database connection broken - trying to reconnect
Mar  4 06:03:49 pmg pmgpolicy[27196]: unable to reconnect to database server: DBI connect('dbname=Proxmox_ruledb;host=/var/run/postgresql;port=5432','root',...) failed: could not connect to server: No such file or directory#012#011$12#011Is the server running locally and accepting#012#011connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? at /usr/share/perl5/PMG/DBTools.pm line 72.


Evidence in postgresql-11-main.log:

Code:
2020-03-03 06:02:17.802 -03 [918] PANIC:  could not write to file "pg_logical/replorigin_checkpoint.tmp": No space left on device
2020-03-03 06:02:17.807 -03 [829] LOG:  checkpointer process (PID 918) was terminated by signal 6: Aborted
2020-03-03 06:02:17.807 -03 [829] LOG:  terminating any other active server processes
2020-03-03 06:02:17.807 -03 [9609] root@Proxmox_ruledb WARNING:  terminating connection because of crash of another server process
2020-03-03 06:02:17.807 -03 [9609] root@Proxmox_ruledb DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted s$pted shared memory.
2020-03-03 06:02:17.807 -03 [9609] root@Proxmox_ruledb HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2020-03-03 06:02:17.808 -03 [8799] root@Proxmox_ruledb WARNING:  terminating connection because of crash of another server process
2020-03-03 06:02:17.808 -03 [8799] root@Proxmox_ruledb DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted s$pted shared memory.
2020-03-03 06:02:17.808 -03 [8799] root@Proxmox_ruledb HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2020-03-03 06:02:17.808 -03 [9722] root@Proxmox_ruledb WARNING:  terminating connection because of crash of another server process
2020-03-03 06:02:17.808 -03 [9722] root@Proxmox_ruledb DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted s$pted shared memory.
2020-03-03 06:02:17.808 -03 [9722] root@Proxmox_ruledb HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2020-03-03 06:02:17.807 -03 [9608] root@Proxmox_ruledb WARNING:  terminating connection because of crash of another server process
2020-03-03 06:02:17.807 -03 [9608] root@Proxmox_ruledb DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted s$pted shared memory.
2020-03-03 06:02:17.807 -03 [9608] root@Proxmox_ruledb HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2020-03-03 06:02:17.809 -03 [9447] root@Proxmox_ruledb WARNING:  terminating connection because of crash of another server process
2020-03-03 06:02:17.809 -03 [9447] root@Proxmox_ruledb DETAIL:  The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted s$pted shared memory.
2020-03-03 06:02:17.809 -03 [9447] root@Proxmox_ruledb HINT:  In a moment you should be able to reconnect to the database and repeat your command.
2020-03-03 06:02:17.810 -03 [9607] roo2020-03-03 08:36:53.294 -03 [887] LOG:  listening on IPv4 address "127.0.0.1", port 5432

Lack of disk space?

/ dev / vda1 37G 29G 5.9G 84% / #Free Disk 6GB
 
2020-03-03 06:02:17.802 -03 [918] PANIC: could not write to file "pg_logical/replorigin_checkpoint.tmp": No space left on device
* Seems the database has a problem - maybe it's related to diskspace - which other filesystems do you have mounted?
* what happens to the filesystem when you try to restart the postgresql ?

Make sure to create a backup!
maybe try to increase the logging of postgresql

I hope this helps!
 
  • Like
Reactions: thiagotgc
I enlarged the record, I will follow.

And what about other error, what can it be?
 
Last edited:
The DBI error really was too little room for maneuvering the BD.

But the error:

WARNING: Use of uninitialized value $ ip in pattern match (m //) at /usr/share/perl5/PMG/RuleCache.pm line 243.

It still exists, would it be a BUG under any rules?
 
Solved.
Its postgresql data path problem after upgrade from ver 9.6 to 11.

Syslog:

Aug 13 11:31:37 mailgw2 postgresql@11-main[31188]: Error: /var/lib/postgresql/9.6/main is not accessible or does not exist
Aug 13 11:31:37 mailgw2 systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet?) after start: No such file or directory

Then I create symbolic link "9.6" which point to "11" folder in /etc/postresql and /var/lib/postgresql .
I dont want to modify postgres conf file.
perhaps if new update exists, i would choose to install package maintainter config file.
I forgot if there is such option when i did apt upgrade before.

Hope it helps.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!