Blog

Postgresql issues with a cPanel server

Tags: cPanelerrorPostgreSQL

Published on: January 16, 2010 by Sharafuddin M.A

Postgresql issues with a cPanel server

Scenario:

Our PostgreSQL support team recently came across this issue of not being able to create postgresql database even after the postgresql package is installed and database server is running. Fixing of one issue lead to another there by needing to fix all the errors.

Cpanel::AdminBin::adminrun(postgres) set error in context postgres
[2010-01-16 12:24:18 -0500] warn [postgres::listdbs] Encountered error in postgres::listdbs: Error from postgres wrapper: PostgreSQL has not been configured by the administrator. Unable to locate pgpass file.

This was fixed by doing these,

Login to WHM => SQL Services => Postgres Config => Click on “Install Config”.
Login to WHM => SQL Services => Postgres Config => “Set a Postgresql password also”

No error in cPanel after doing above. However that followed by an issue of created DBs not being appeared in the List DB page of Postgresql databases. Went to shell. Logged in as root . Switched to postgres. “su – postgres” . Ran the command “psql” and then

-bash-3.2$ psql
Welcome to psql 8.1.18, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

postgres=# \l
List of databases
Name | Owner | Encoding
———–+———-+———-
postgres | postgres | UTF8
template0 | postgres | UTF8
template1 | postgres | UTF8
(3 rows)

postgres=# \q

No DB was created. Checked the logs /usr/local/cpanel/logs/error_log and it had entries like ERROR: role “username” does not exist which meant, no roles to create the database.

cd /var/cpanel/users && for x in *; do su -c "createuser -S -D -R $x" postgres; done

You can always contact us for Postgresql support on any issue and we are happy to help you

Category : cPanel, PostgreSQL, Troubleshooting

Sharafuddin M.A

Sharafuddin M.A

Sharaf got immense interest and knowledge in implementing custom application and security solutions. He is highly competent in identifying and resolving security vulnerabilities, security breaches, hacked server recovery and server hardening. This soft spoken guy loves to watch movies and hanging out with friends.

You may also read:

Comments

Add new commentSIGN IN

Let's Connect

Categories

Your Cart

Cart is empty.

Subtotal
₹0.00
APPLY
0
Send this to a friend