Kali Issue with PostgreSQL Setup 14/15

Step 1: Checking OpenVAS (Scanner)…
OK: OpenVAS Scanner is present in version 22.4.0.
OK: Notus Scanner is present in version 22.4.1.
OK: Server CA Certificate is present as /var/lib/gvm/CA/servercert.pem.
Checking permissions of /var/lib/openvas/gnupg/*
OK: _gvm owns all files in /var/lib/openvas/gnupg
OK: redis-server is present.
OK: scanner (db_address setting) is configured properly using the redis-server socket: /var/run/redis-openvas/redis-server.sock
OK: redis-server is running and listening on socket: /var/run/redis-openvas/redis-server.sock.
OK: redis-server configuration is OK and redis-server is running.
OK: the mqtt_server_uri is defined in /etc/openvas/openvas.conf
OK: _gvm owns all files in /var/lib/openvas/plugins
OK: NVT collection in /var/lib/openvas/plugins contains 83364 NVTs.
OK: The notus directory /var/lib/notus/products contains 377 NVTs.
Checking that the obsolete redis database has been removed
OK: No old Redis DB
OK: ospd-OpenVAS is present in version 22.4.0.
Step 2: Checking GVMD Manager …
OK: GVM Manager (gvmd) is present in version 22.4.0~dev1.
Step 3: Checking Certificates …
OK: GVM client certificate is valid and present as /var/lib/gvm/CA/clientcert.pem.
OK: Your GVM certificate infrastructure passed validation.
Step 4: Checking data …
OK: SCAP data found in /var/lib/gvm/scap-data.
OK: CERT data found in /var/lib/gvm/cert-data.
Step 5: Checking Postgresql DB and user …
/usr/bin/gvm-check-setup: line 392: [: =: unary operator expected
/usr/bin/gvm-check-setup: line 398: [: -ne: unary operator expected
OK: Postgresql version and default port are OK.
gvmd | _gvm | UTF8 | en_US.UTF-8 | en_US.UTF-8 | | libc |
16439|pg-gvm|10|2200|f|22.4.0||
ERROR: No users found. You need to create at least one user to log in.
FIX: create a user by running ‘sudo runuser -u _gvm – gvmd --create-user= --password=’

ERROR: Your GVM-22.4.0 installation is not yet complete!

Please follow the instructions marked with FIX above and run this
script again.
Note at step what i need to change so error stops.

I get the same result. that the 5fh checkpoint is not okay. After running the command ‘sudo runuser -u _gvm – gvmd --create-user= --password=’ the user is still not created. Means something is wrong. Does any have an idea to solve that issue

Hello Dextra_1122 and Kali1, and welcome to the Greenbone Community Forum! :slight_smile:

Have you entered a username and password after the arguments? i.e. sudo runuser -u _gvm – gvmd --create-user=USERNAMEHERE --password=PASSWORDHERE? Does the _gvm user exist on your system? You can check the existence of the _gvm user by checking /etc/passwd.

Thank you sir for your kind response, but I had already solved the issues by myself. It was a probelm of port.

1 Like

Hello TreAtW,

yes for sure I have entered a username and a password.
And after entering I ran the command gvm-check-setup again.
But I got again the same response that I have to create a user and a password.
Means the checking stops after point 5.

When I run the command /etc/passwd the feedback is zsh: no permission.

I do not really have an idea what else to do?
Maybe you can help me with another constructive idea.

Thanks in advance

If you have sudo permissions, then you should be able to run sudo cat /etc/passwd. However, if the command sudo runuser -u _gvm – gvmd --create-user=USERNAMEHERE --password=PASSWORDHERE ran successfully for you, then the _gvm user should exist.

You should be able to check all users that exist for gvmd with sudo runuser -u _gvm – gvmd --get-users. Does the user that you created show up in this list?

no unfortunately the user I created does not appear and after running gvm-check-setup again I still get the followig feedback.
tep 5: Checking Postgresql DB and user …
Starting postgresql service
/usr/bin/gvm-check-setup: Zeile 392: [: =: Einstelliger (unärer) Operator erwartet.
/usr/bin/gvm-check-setup: Zeile 398: [: -ne: Einstelliger (unärer) Operator erwartet.
OK: Postgresql version and default port are OK.
gvmd | _gvm | UTF8 | de_DE.UTF-8 | de_DE.UTF-8 | | libc |
16439|pg-gvm|10|2200|f|22.4.0||
ERROR: No users found. You need to create at least one user to log in.
FIX: create a user by running ‘sudo runuser -u _gvm – gvmd --create-user= --password=’

ERROR: Your GVM-22.4.0 installation is not yet complete!

Please follow the instructions marked with FIX above and run this
script again.

I really do not have an idea why the creation of the user and pasword does not work.

The only thing that would come to mind right now would be the gvmd service not running properly. Try looking at sudo systemctl status gvmd.

On a side note, I wouldn’t recommend sharing your whole /etc/passwd file here, as it shows all users on your machine and also allows the enumeration of some services you’re running.

it says the unary operator expected, but the problem is with the ports on those postgresql is running on, is says need 15 instead of 14, what you need to do to go for
go to sudo nano /etc/postgresql/14/main/postgresql.conf and search for port number change it to 5432
2nd step is go to /etc/postgresql/15/main/postgresql.conf and change the port number to 5433 now you are done.

1 Like

thanks a lot. I have already deleted the postgresql version 14 but in 15 I changed the port to 5432.
now it worked out.
thanks a lot for your excellent help.

2 Likes

thanks for the help also. I deleted it.

2 Likes

No worry anytime.

Two notes:

The gvm-check-setup script isn’t maintained by Greenbone (anymore) but by the Kali packaging team. To request an improvement for the unary operator expected message for better / more graceful handling of this case it is suggested to report a new issue over at https://bugs.kali.org

Updating any port numbers in the PostgreSQL config files is strongly discouraged as this will leave an unmaintained / deprecated PostgreSQL 14 version behind and in use which doesn’t receive any (security) updates anymore. Furthermore there might be other issues due the usage of such mixed PostgreSQL versions installed.

Usually you should get some instructions how to “upgrade” your PostgreSQL 14 version to the most recent 15 while updating your packages / OS (at least on Debian this is the case) and the related info can be also found at:

/usr/share/doc/postgresql-14/README.Debian.gz
or:
/usr/share/doc/postgresql-15/README.Debian.gz

External resources like e.g. the following is also giving more info:

https://www.muehlencord.de/wordpress/2020/10/31/postgresql-pg_upgradecluster/

Requesting more / better handling / notification / recommendations from the OS side could be also done via requests to Kali / Debian.

2 Likes

For the records / to have it tracked / as a reference, the following is shown on Debian if having PostgreSQL 14 installed and the system is receiving an upgrade to PostgreSQL 15:

The PostgreSQL version 14 is obsolete, but the server or client packages are still installed. Please install the latest packages (postgresql-15 and postgresql-client-15) and upgrade the existing clusters with pg_upgradecluster (see manpage).

Please be aware that the installation of postgresql-15 will automatically create a default cluster 15/main. If you want to upgrade the 14/main cluster, you need to remove the already existing 15 cluster (pg_dropcluster --stop 15 main, see manpage for details).

The old server and client packages are no longer supported. After the existing clusters are upgraded, the postgresql-14 and postgresql-client-14 packages should be removed.

Please see /usr/share/doc/postgresql-common/README.Debian.gz for details.

1 Like