Tracking center "No data in database" after upgrading some packages

karnz

Renowned Member
Nov 23, 2015
60
3
73
Hi,

Tracking center is showing "No data in database" no matter what date period is selected. Other statistic pages are showing as normal. Rebooting doesn't help.
This happened after upgrading some packages below.

Start-Date: 2020-01-01 02:03:35
Commandline: apt-get dist-upgrade
Install: pve-kernel-5.3.13-1-pve:amd64 (5.3.13-1, automatic)
Upgrade: proxmox-widget-toolkit:amd64 (2.1-1, 2.1-2), pve-kernel-5.3:amd64 (6.0-12, 6.1-1), proxmox-spamassassin:amd64 (3.4.2-13, 3.4.3-2), libsasl2-modules-db:amd64 (2.1.27+dfsg-1, 2.1.27+dfsg-1+deb10u1), ifupdown:amd64 (0.8.35, 0.8.35+pve1), libsasl2-2:amd64 (2.1.27+dfsg-1, 2.1.27+dfsg-1+deb10u1), spamc:amd64 (3.4.2-1, 3.4.2-1+deb10u1), pve-kernel-helper:amd64 (6.0-12, 6.1-1), pmg-api:amd64 (6.1-2, 6.1-3), pmg-gui:amd64 (2.1-3, 2.1-4)
End-Date: 2020-01-01 02:06:13
 
just to make sure, please open the tracking center in an inkognito browser tab without any ad blocker addon, they sometimes block requests because of the name tracking in it...
 
Thanks Tim. But it doesn't work. Just only Tracking Center page, other pages are working well.

Not sure there's a clue from the log at /var/log/postgresql/postgresql-11-main.log ?

2020-01-02 06:31:48.186 +07 [284] LOG: listening on IPv6 address "::1", port 5432
2020-01-02 06:31:48.187 +07 [284] LOG: listening on IPv4 address "127.0.0.1", port 5432
2020-01-02 06:31:48.381 +07 [284] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2020-01-02 06:31:49.124 +07 [390] LOG: database system was shut down at 2020-01-02 06:31:18 +07
2020-01-02 06:31:49.340 +07 [284] LOG: database system is ready to accept connections
2020-01-02 06:31:49.864 +07 [397] [unknown]@[unknown] LOG: incomplete startup packet
2020-01-02 06:31:52.678 +07 [420] root@Proxmox_ruledb ERROR: constraint "localstat_time_key" of relation "localstat" does not exist
2020-01-02 06:31:52.678 +07 [420] root@Proxmox_ruledb STATEMENT: ALTER TABLE LocalStat DROP CONSTRAINT localstat_time_key
 
Just only Tracking Center page, other pages are working well.
This is something which can happen if you have a browser-plugin, which tries to prevent tracking (some of them match on 'track' occuring in the URL, which is the case for the log-tracker page in PMG) -> try with a different browser without any plugins installed

Apart from that - the log-tracker reads its information from '/var/log/syslog.*' - did you maybe change anything on the rsyslog or logrotate config?
does /var/log/syslog contain the mail-logs?
 
Thanks Stoiko.
I'm sure I tried on the Firefox Private tab and also Chrome Incognito tab. They are the same.
I have using PMG about two years and this just happen few days ago. Nothing touched on logrotate config.
And yes, /var/log/syslog contains the mail log and its size is getting big.

It might be from the rotation of the log. Please see below.

/etc/logrotate.d/rsyslog
/var/log/syslog
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}

/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
rotate 4
daily
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}

Problem is above files that should rotated daily, they are all rotated on Nov 27 as the latest day.

I just try to run command 'invoke-rc.d rsyslog rotate' but got an error.
[FAIL] Closing open files: rsyslogd failed!

rsyslogd is running
root 26059 0.0 0.0 225820 3600 ? Ssl 19:50 0:00 /usr/sbin/rsyslogd -n -iNONE

● rsyslog.service - System Logging Service
Loaded: loaded (/lib/systemd/system/rsyslog.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-01-02 19:50:31 +07; 19min ago
Docs: man:rsyslogd(8)
https://www.rsyslog.com/doc/
Main PID: 26059 (rsyslogd)
Tasks: 4 (limit: 38435)
Memory: 2.4M
CGroup: /system.slice/rsyslog.service
└─26059 /usr/sbin/rsyslogd -n -iNONE

Jan 02 19:50:31 mxgw systemd[1]: Starting System Logging Service...
Jan 02 19:50:31 mxgw rsyslogd[26059]: imuxsock: Acquired UNIX socket '/run/systemd/journal/syslog' (fd 3) from systemd. [v8.1901.0]
Jan 02 19:50:31 mxgw rsyslogd[26059]: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="26059" x-info="https://www.rsyslog.com"] start
Jan 02 19:50:31 mxgw systemd[1]: Started System Logging Service.
Jan 02 19:52:21 mxgw rsyslogd[26059]: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="26059" x-info="https://www.rsyslog.com"] rsyslogd was HUPed
Jan 02 20:08:48 mxgw rsyslogd[26059]: [origin software="rsyslogd" swVersion="8.1901.0" x-pid="26059" x-info="https://www.rsyslog.com"] rsyslogd was HUPed
 
was that maybe the time when you upgraded from PMG 5.4 to 6?


invoke-rc.d does not work anymore with buster - see https://pmg.proxmox.com/wiki/index.php/Upgrade_from_5.x_to_6.0#Logrotation_.28rsyslog.29

I hope this helps!

I seem to have had this same thing happen to me since the upgrade. I am not sure from this what it means exactly:

Logrotation (rsyslog)
If you've modified /etc/logrotate.d/rsyslog make sure to compare the file upon upgrade - the postrotate script changed. Without the new script logrotation does not work which also breaks the tracking center. The postrotate script needs to be:

/usr/lib/rsyslog/rsyslog-rotate


I have modified my now old log files to be kept for 30 days. How do I update the new postrotate with this script to get the tracking centre working again for me?
 
I seem to have had this same thing happen to me since the upgrade. I am not sure from this what it means exactly:

Logrotation (rsyslog)
If you've modified /etc/logrotate.d/rsyslog make sure to compare the file upon upgrade - the postrotate script changed. Without the new script logrotation does not work which also breaks the tracking center. The postrotate script needs to be:

/usr/lib/rsyslog/rsyslog-rotate


I have modified my now old log files to be kept for 30 days. How do I update the new postrotate with this script to get the tracking centre working again for me?


So have updated the rsyslog file with the above syntax, and still I am not seeing anything in the tracking centre. This is after both a restart of the syslog service and a reboot of my 2 nodes.

What exactly am I missing here? Here is my copy of rsyslog

cat /etc/logrotate.d/rsyslog

/var/log/syslog
{
rotate 90
daily
missingok
notifempty
delaycompress
compress
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}

/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
rotate 4
weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
 
Try running logrotate once - or wait for the cronjob to do so (which should have happened by now )
 
Hi Stoiko, thanks. Yes I've tried that and there is still nothing showing up in the tracking centre, however it doesn't appear if the logs are actually being rotated. I have the last rotation on the 22nd of Dec and then nothing is kept newer that that.

-rw-r--r-- 1 root root 825208 Dec 20 06:53 syslog.3.gz
-rw-r--r-- 1 root root 685626 Dec 21 06:53 syslog.2.gz
-rw-r--r-- 1 root root 2318600 Dec 22 06:53 syslog.1
drwx------ 2 root root 2 Dec 22 20:43 private
-rw-r----- 1 root adm 253 Dec 22 20:44 user.log
drwxr-xr-x 10 root root 115 Dec 22 20:45 .
-rw-r--r-- 1 root root 3552 Dec 22 20:45 faillog
-r--r-- 1 root root 1984 Dec 22 20:46 fontconfig.log
-rw-r--r-- 1 root root 18984 Dec 22 21:17 alternatives.log
drwxrwxr-t 2 root postgres 3 Dec 22 21:17 postgresql
drwx------ 2 root root 15 Jan 1 06:30 letsencrypt
drwxr-xr-x 2 root root 21 Jan 2 14:44 apt
-rw-r--r-- 1 root root 314048 Jan 2 14:44 dpkg.log
-rw-rw-r-- 1 root utmp 33024 Jan 2 19:00 wtmp
-rw-rw-r-- 1 root utmp 32412 Jan 2 19:00 lastlog
-rw-r----- 1 root adm 51643 Jan 2 21:24 fail2ban.log
-rw-r----- 1 root adm 190277 Jan 3 06:01 mail.err
-rw-r----- 1 root adm 202621 Jan 3 06:08 kern.log
-rw-r----- 1 root adm 1198375 Jan 3 06:30 messages
-rw-r----- 1 root adm 74087 Jan 3 06:30 debug
-rw-r----- 1 root adm 5613959 Jan 3 06:36 mail.warn
-rw-r----- 1 root adm 6760727 Jan 3 06:37 daemon.log
-rw-r----- 1 root adm 17109031 Jan 3 06:37 auth.log
-rw-r--r-- 1 root root 40437518 Jan 3 06:37 syslog
-rw-r----- 1 root adm 74402662 Jan 3 06:37 mail.log
-rw-r----- 1 root adm 74402662 Jan 3 06:37 mail.info

However when I run logrotate /etc/logrotate.d/rsyslog it seems to work, however I also might not be issuing the command correctly. Is that the correct way to issue the command or is there something else that needs to be done?

Thank you
 
I have the same problem.
I have corrected the entry for the post rotate script.
So far so good....
...rotated the log and what happens is if I open the tracking page and press search it shows me the mails of the last hour. But then I change the start time and press search again the list is empty again....

This is my config:

Code:
/var/log/syslog
{
        rotate 12
        monthly
        missingok
        notifempty
        delaycompress
        compress
        postrotate
                /usr/lib/rsyslog/rsyslog-rotate
        endscript
}

/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
        rotate 4
        weekly
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
                /usr/lib/rsyslog/rsyslog-rotate
        endscript
}
 
IT WORKS AGAIN :)
What I did:

logrotate -vf /etc/logrotate.d/rsyslog

--> only the last one hour shows up after search

Rotate the logs again:

logrotate -vf /etc/logrotate.d/rsyslog

--> everything is showing up again :)

Thanks Guenther! Great job! It works for me too!
Thanks everyone for your support too!
 
Hi Stoiko, thanks. Yes I've tried that and there is still nothing showing up in the tracking centre, however it doesn't appear if the logs are actually being rotated. I have the last rotation on the 22nd of Dec and then nothing is kept newer that that.

...
...

However when I run logrotate /etc/logrotate.d/rsyslog it seems to work, however I also might not be issuing the command correctly. Is that the correct way to issue the command or is there something else that needs to be done?

Thank you

I have tried this too by running logrotate script from cron.daily directory but no logs getting rotated because there’s this condition at the top and that directory actually exists. So cronjob skipped.

Bash:
# skip in favour of systemd timer
if [ -d /run/systemd/system ]; then
    exit 0
fi

Not sure what to do with this file or that system directory after upgraded to PMG 6 on debian buster or leave it untouched.

However I tried to comment out above code and cronjob works as it should be.

Now waiting for next cronjob runtime in the morning to confirm everything is working as normal.
 
So as of this morning, it seems I need to run this command again:
logrotate -vf /etc/logrotate.d/rsyslog

In order for the tracking centre to work as it should. What do I need to do in order to get the logs rotating automatically again so that this works as it should?
 
So as of this morning, it seems I need to run this command again:
logrotate -vf /etc/logrotate.d/rsyslog

In order for the tracking centre to work as it should. What do I need to do in order to get the logs rotating automatically again so that this works as it should?

Yes me too.
Seems we have to edit /etc/cron.daily/logrotate
And insert an option ‘ -f ‘ to the line

Bash:
/usr/sbin/logrotate -f /etc/logrotate.conf

Moreover, I have to comment out this condition checking at the top of this file also. Because on my system there’s that ‘system’ directory exists. So logrotate cronjob won’t be run anymore if I don’t comment it.

Bash:
#if [ -d /run/systemd/system ]; then
#    exit 0
#fi
 
Hallo zusammen,

selbes Problem, neu installiertes PMG, Tracking center "No data in database".

Aktuelle Pakete (Stand 2022-02-01) installiert (Community Lizenz):
proxmox-mailgateway-container: 7.1-1
pmg-api: 7.1-1
pmg-gui: 3.1-1
pmg-docs: 7.1-1
pmg-i18n: 2.6-2
pmg-log-tracker: 2.3.0-1
postgresql-13: 13.5-0+deb11u1
proxmox-mini-journalreader: 1.3-1
proxmox-spamassassin: 3.4.6-4
proxmox-widget-toolkit: 3.4-5
pve-xtermjs: 4.16.0-1

Trackingcenter zeigt aktuelle Daten (von heute (2022-02-01)) an,
wenn man das Startdatum auf vor einem Jahr (2021-02-01) stellt, irgendwelche Ideen?

Systemzeit ist korrekt:
root@mx2:/var/log# timedatectl
Local time: Tue 2022-02-01 13:35:53 CET
Universal time: Tue 2022-02-01 12:35:53 UTC
RTC time: n/a
Time zone: Europe/Berlin (CET, +0100)
System clock synchronized: yes
NTP service: inactive
RTC in local TZ: no
 

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!