After succesfully upgrade to v8 error on pmg-smtp-filter

aluisco

Member
Sep 11, 2019
4
1
23
38
Hi, I follow the guide to upgrade from vesion 7 to 8 but I see this error on logs:

Code:
2023-06-30T15:23:07.623189-04:00 mx pmg-smtp-filter[751]: starting database maintenance
2023-06-30T15:23:07.661681-04:00 mx pmg-smtp-filter[751]: DBD::Pg::db do failed: ERROR:  cannot cast type timestamp with time zone to integer#012LINE 1: ...Count = Count + 6,MTime = EXTRACT(EPOCH FROM now()::INTEGER)...#012                                                             ^ at /usr/share/perl5/PMG/Statistic.pm line 109.

I think is related to postgresql.

How I can fix that?

Regards,
Aluisco
 
  • Like
Reactions: anas_xrt
I got the same error
Bash:
2023-07-01T23:00:29.147523+07:00 pmg-mine pmg-smtp-filter[687]: starting database maintenance
2023-07-01T23:00:29.183850+07:00 pmg-mine pmg-smtp-filter[687]: DBD::Pg::db do failed: ERROR:  cannot cast type timestamp with time zone to integer#012LINE 1: ...Count = Count + 1,MTime = EXTRACT(EPOCH FROM now()::INTEGER)...#012  ^ at /usr/share/perl5/PMG/Statistic.pm line 109.

i made "^ at /usr/share/perl5/PMG/Statistic.pm line 109." closer to look easier in output
 
Last edited:
I see the same error on a fresh install over bookworm, not via an upgrade or an ISO install
 
And here:

Code:
Jul 02 00:01:07 gw01 systemd[1]: Starting Send Daily System Report Mail...
Jul 02 00:01:09 gw01 pmgreport[482031]: DBD::Pg::db do failed: ERROR:  cannot cast type timestamp with time zone to integer
Jul 02 00:01:09 gw01 pmgreport[482031]: LINE 1: ...Count = Count + 1,MTime = EXTRACT(EPOCH FROM now()::INTEGER)...
Jul 02 00:01:09 gw01 pmgreport[482031]:                                                              ^ at /usr/share/perl5/PMG/Statistic.pm line 109.
Jul 02 00:01:09 gw01 systemd[1]: pmgreport.service: Main process exited, code=exited, status=255/EXCEPTION
 
Looking good now:

2023-07-04T05:36:28.985883+12:00 mailgate pmg-smtp-filter[811]: starting database maintenance
2023-07-04T05:36:29.005034+12:00 mailgate pmg-smtp-filter[811]: end database maintenance (19 ms)

Thank you.
 
  • Like
Reactions: Stoiko Ivanov
The official document said that "the pmgtest repository should only be used for testing new features or bug fixes."

But our server is not a test server. Any solution to solve the problem instead of pmgtest repository?

Many thanks!
 
I think that the fix is also in the No Subscription repo in the meantime. Have you checked this yet?
 
I had already run below:

apt -y update
apt -y upgrade
apt -y dist-upgrade

But the problem still exist! What can I do?

Please help! Many thanks!
 
Replying but not trying to pretend to be an expert.

The fix was released with pmg-api version 8.0.4 in July already and regardless what repositories you use (production or test) you should have a newer version installed if you have updated your system as it looks like. Find out what version is installed by:

apt list pmg-api

The result should most likely be something like this:

pmg-api/stable,now 8.0.7 all [installed]

Anything newer than 8.0.3 should have fixed the issue. I assume you restarted the entire system after your recent updates?
 
Code:
# apt list pmg-api
Listing... Done
pmg-api/now 8.0.3 all [installed,local]

Do you mean I need to use the test repository to install the new update?

Code:
# cat /etc/apt/sources.list
deb http://ftp.hk.debian.org/debian bookworm main contrib

deb http://ftp.hk.debian.org/debian bookworm-updates main contrib

# security updates
deb http://security.debian.org bookworm-security main contrib
 
So you have a too old version hence the issue.

You stated that your server is "not a test server" so I assume you mean that you have paid the Proxmox team for a subscription (which is worthwhile to do) hence you should have enabled the "enterprise" repo.

You will need one of the two repos enabled to receive updates (but not both), either the "enterprise" directory if you pay for a subscription or the "test" repo if you are running your installation free without any payments.
 
OIC now! Thanks for your help!

I'm new for PMG. I want to ask one question: we cannot use PMG as production server unless we pay for enterprise subscription?
 
OIC now! Thanks for your help!

I'm new for PMG. I want to ask one question: we cannot use PMG as production server unless we pay for enterprise subscription?
You can and are allowed to run OMG in production with using the test repository. You do not need to pay a subscription to get access to the enterprise repo but in doing so, you take some risks that you need to deal with yourself. The test repository will contain at times test versions for some packages and these might not be stable yet (hence the "test" repo naming).
I assume that there are other users running a PMG production server and using the test repo but there is a risk to this that you need to be aware of.
 
After reading the documentation from:

https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmg_package_repositories

Proxmox has three repositories:

One is call enterprise, "deb https://enterprise.proxmox.com/debian/pmg bookworm pmg-enterprise"

One is call pmg-no-subscription, "deb http://download.proxmox.com/debian/pmg bookworm pmg-no-subscription"

and last one is call test repository, "deb http://download.proxmox.com/debian/pmg bookworm pmgtest"

We can just use enterprise repository as production and don't use other two repositories as production. Am I right?
 
From my experience, no subscription is also very stable and quite suitable for productive operation. Enterprise is the safest way to drive and get support. With a subscription you always support the work of the Proxmox team, which is why it is not a bad idea to buy it.
 

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!