Extension pg-gvm is not available

Hi Team

I’ve read through a bunch or topics similar but I can’t seem to find the fix…

gvm-check-setup (version 23.11.0)
fails step 5 - new extension pgcrypto does not exist for gvmd database
run sudo runuser -u postgres – /usr/share/gvm/create-postgresql-database

Step 5: Checking Postgresql DB and user ... 
        OK: Postgresql version and default port are OK.
 gvmd      | _gvm     | UTF8     | libc            | en_US.UTF-8 | en_US.UTF-8 |            |           | 
        ERROR: The new extension pgcrypto does not exist for gvmd database
        FIX: Run 'sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database'

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

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

This fails
extension pg-gvm is not available

sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database
[i] User _gvm already exists in PostgreSQL
[i] Database gvmd already exists in PostgreSQL
[i] Role DBA already exists in PostgreSQL

[*] Applying permissions
NOTICE:  role "_gvm" has already been granted membership in role "dba" by role "postgres"
[i] Extension uuid-ossp already exists for gvmd database
[i] Extension pgcrypto already exists for gvmd database
[i] Remove old parts from DB for new pg-gvm extension
NOTICE:  view "result_new_severities_dynamic" does not exist, skipping
NOTICE:  view "result_new_severities" does not exist, skipping
NOTICE:  view "result_new_severities_static" does not exist, skipping
NOTICE:  view "result_overrides" does not exist, skipping
NOTICE:  function hosts_contains() does not exist, skipping
NOTICE:  function max_hosts() does not exist, skipping
NOTICE:  function regexp() does not exist, skipping

[*] Creating extension pg-gvm
ERROR:  extension "pg-gvm" is not available
DETAIL:  Could not open extension control file "/usr/share/postgresql/16/extension/pg-gvm.control": No such file or directory.
HINT:  The extension must first be installed on the system where PostgreSQL is running.

NAME=“Kali GNU/Linux”

psql (PostgresSQL) 16.1

My apologies if this is redundant…

Hi, please take look at Troubleshooting - Greenbone Community Documentation you will find some hints for your issue.

1 Like

Thanks bricks… Looks like I followed the steps but now postgres is missing the postgresql.conf file. I think I pretty much borked postgres… I’m probably going to have to rebuild kali purple from scratch… I can’t get postgres to uninstall everything to start over…

Technolust; assuming you are trying to upgrade GSA on the current version.

First is the postgresql database for GSA running version 15 or 16; you can check this via:

sudo pg_lsclusters

If its not on version 16 then you need to upgrade the GSA database to postgresql version 16 and purge the postgresql version 15 packages.

For the missing extension ‘pg-gvm’ you need to install the postgresql 16 version using:

‘sudo apt install postgresql-16-pg-gvm’

After that rerun the:

‘sudo gvm-check-setup’

It should as per your post require you to run the following command:

sudo runuser -u postgres – /usr/share/gvm/create-postgresql-database’

After that rerun check-setup the and the install should say its fine, then manually start GSA:

‘sudo gvm-check-setup’

Hope this helps.

1 Like

Thanks Dave… The clusters were not showing up. I couldn’t even get the location of the config file. What I think happened is the 15 code was pointing to port 5432 but no actual 15 code or configs were present. When I ran through the steps and dropped 16 all the configs were gone so postrgress had nothing to run.

I’m in the middle of rebuilding Greenbone on a fresh Kali purple stack. Which to no avail has issues with nvme disks installing 2023.4 from iso. Had to install 2023.2a and upgrade to 2023.4 to get it to install on the nvme.

Thanks for the help!