CentOS 7 cPanel & WHM with Postgresql 13 (Error crontab update_db_cache)

Operating System & Version
CENTOS 7.9
cPanel & WHM Version
94.0.2

garbintecnologia

Active Member
Mar 4, 2021
33
2
8
Brasil
cPanel Access Level
Root Administrator
Hi, I need help with cPanel / WHM crontab tasks.

cPanel & WHM Version: v94.0.2
O.S.: CENTOS 7.9

Summing up my scenario, I was in a hosting where the Postgresql version was 12, but when I came to the current hosting, WHM offered only 9. So this generated conflicts in my project and I had to update, take advantage and update Posgresql to version 13.

At first everything works correctly, but I'm getting an error coming from cron jobs that seems to be a standard cPanel / WHM.

When I run the following cron: # /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache

The error is this:
Error opening directory “/var/lib/pgsql/13/data/base/0”: No such file or directory at /usr/local/cpanel/Cpanel/PostgresAdmin.pm line 96.
Need db! at /usr/local/cpanel/Cpanel/DB/Map/Collection/Index.pm line 118.
This error at first does not interfere with the functioning of Postgresql, but I would like to know what this task is for and if possible solve it.

Any suggestions regarding this error?


More information:
What I noticed different about the update is: When upgrading from version 9 to version 13, the service went from postgresql to postgresql-13. As can be seen in the image below, everything is working, including the WHM panel (creation of the config file, users and password change).
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,139
2,404
363
cPanel Access Level
Root Administrator
Hey there! cPanel only supports PostGreSQL versions that are installed from /scripts/installpostgres script, so if there is anything different than the default of version 9 on the machine, you'll run into those errors. In this case, our update_db_cache script is looking for a specific structure that doesn't exist in version 13.

While you're welcome to run that version of PostGreSQL, we can't say it will be compatible with all cPanel tools.
 

garbintecnologia

Active Member
Mar 4, 2021
33
2
8
Brasil
cPanel Access Level
Root Administrator
Oooh no! :(

I really like cPanel / WHM it helps some processes in a way.

However, I believe that it is a pity not to be able to update and be able to use the latest technologies that are already in the digital world for a long time.

I have no way of being stuck with a version of a database that is already outdated which is the heart of an application.

As a senior developer I'm really sorry for that. I'm coming from AWS RDS, I believed that WHM was more "flexible" than I just realized.

As you can see, the PostgreSQL maintainer encourages the update.

So, I can't go back with the installation for 4 years ago, I will be doing a disservice.

I thank you for your attention, I hope that in the future it will be possible to use a database something like PHP-FPM, which is something incredible in cPanel.

I will continue to use PostgreSQL 13, even with these CRON errors, I will disable email notifications if that is the maximum I can do.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,139
2,404
363
cPanel Access Level
Root Administrator
I'm sorry I don't have better news on this, and I totally understand what you're saying about the updates. We do have this feature request from a few months ago about PostGres 12:


so I'd encourage you to add your vote there, and you're always welcome to submit other features you'd like to see added to the product!
 

tui

Well-Known Member
Jun 15, 2007
147
40
78
Mexico
cPanel Access Level
Root Administrator
Did you find a workaround on this? Im on the same boat, i tried to create a directory 0 on this path: "/var/lib/pgsql/13/data/base/" as the error was "Not such file or directory" and the first error was gone but i still have the "Need db!" error every 4 hours
 

garbintecnologia

Active Member
Mar 4, 2021
33
2
8
Brasil
cPanel Access Level
Root Administrator
Did you find a workaround on this? Im on the same boat, i tried to create a directory 0 on this path: "/var/lib/pgsql/13/data/base/" as the error was "Not such file or directory" and the first error was gone but i still have the "Need db!" error every 4 hours
Hello, I ended up giving up using PostgreSQL with cPanel, I was afraid of having problems. I'm using PostgreSQL separately on AWS RDS. If one day support for PostgreSQL with cPanel is possible I will use it, at the moment I'm still waiting for an update on that.
 

garbintecnologia

Active Member
Mar 4, 2021
33
2
8
Brasil
cPanel Access Level
Root Administrator
Ok, I think that was one of the points of my question about PostgreSQL some time ago. I have projects in newer versions of PostgreSQL but cPanel only accepted the system version, in this case I couldn't migrate because of that. I believe that if I had a manager as ugly for MySQL or MariaDB it would be very useful in the matter of using PostgreSQL with cPanel.
 
  • Like
Reactions: cPRex