Error message in gvm-check-setup

After running:
gvm-check-setup

I got an error stating:
ERROR: The Postgresql DB does not exist.
FIX: Run ‘sudo runuser -u postgres – /usr/share/gvm/create-postgresql-database

And after running:
sudo runuser -u postgres – /usr/share/gvm/create-postgresql-database

The result was:
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

[*] Creating database user
could not change directory to “/root”: Permission denied
createuser: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

[*] Creating database
could not change directory to “/root”: Permission denied
createdb: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

[*] Creating permissions
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

[*] Applying permissions
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

[*] Creating extension uuid-ossp
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

[*] Creating extension pgcrypto
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

[*] Creating extension pg-gvm
could not change directory to “/root”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: No such file or directory
Is the server running locally and accepting connections on that socket?

NOW MY QUESTION IS HOW CAN I FIX THIS PROBLEM?

Did you ever find the solution?

DISCLAIMER: The gvm-check-setup script is not maintained or developed by Greenbone and therefore not part of the Greenbone Community Edition! It’s used by Kali Linux and issues with the script requires to create issue reports at their bug tracker.

This error is caused by running database statements as the postgres user in a directory (/root) where the postgres user hasn’t write permissions to. Just change to /tmp for example (cd /tmp) and run the script again.

This error means that there is not postgres database (cluster) running at Port 5432. It’s very likely the cluster hasn’t been started or is listening on a different port. This is a Kali specific database configuration issue. The postgres database configuration can be found in /etc/postgres.

1 Like