postgres ERROR: role “username” does not exist


Issue 1

When I am trying to create Postgre DB using Cpanel, I get the following error:

Error from postgres wrapper: PostgreSQL has not been configured by the administrator. Unable to locate pgpass file.

Fix 1
You need to install a Postgres authentication configuration file that uses md5 passwords which works with cPanel. You can do this through WHM.

Login to WHM >> SQL Services >> Postgres Config >> Click on “Install Config”.

Issue 2
Okie  now I can create databases with new accounts. But already created accounts have  issues. It says  database created but it actually not creates and shows the following error in cPanel logs

tail -f /usr/local/cpanel/logs/error_log

ERROR:  role “username” does not exist
ERROR:  role “username” does not exist

Fix 2

Login to the server as “root” and execute the following command.

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

Advertisements

3 responses to “postgres ERROR: role “username” does not exist

  1. If you still have any issues using above steps, try running /scripts/makecpphp

  2. Thank you! “createuser -S -D -R” saved me!!!

  3. Pingback: Fix Apache Error Site Does Not Exist Errors - Windows XP, Vista, 7, 8

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s