PDA

View Full Version : OpenVas error



CyberAstraa
2023-07-28, 05:38
Hello, Iam new to security community. ihave been trying to install gvm openvas ..i ran following command to set up
sudo gvm-setup..
This is the error i got first ..
-------------------------------------------------------------------------------------------------------------------------
Step 5: Checking Postgresql DB and user ...
OK: Postgresql version and default port are OK.
WARNING: database "postgres" has a collation version mismatch
DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
ERROR: The Postgresql DB does not exist.
FIX: Run 'sudo runuser -u postgres -- /usr/share/gvm/create-postgresql-database'

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

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

-----------------------------------------------------------------------
Then i ran the FIX command ... And i got this error...
could not change directory to "/home/kali": Permission denied
WARNING: database "postgres" has a collation version mismatch
DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
[i] User _gvm already exists in PostgreSQL
could not change directory to "/home/kali": Permission denied
WARNING: database "postgres" has a collation version mismatch
DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
Creating database
could not change directory to "/home/kali": Permission denied
WARNING: database "postgres" has a collation version mismatch
DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
createdb: error: database creation failed: ERROR: template database "template1" has a collation version mismatch
DETAIL: The template database was created using collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in the template database that use the default collation and run ALTER DATABASE template1 REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
could not change directory to "/home/kali": Permission denied
WARNING: database "postgres" has a collation version mismatch
DETAIL: The database was created using collation version 2.36, but the operating system provides version 2.37.
HINT: Rebuild all objects in this database that use the default collation and run ALTER DATABASE postgres REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
Creating permissions
could not change directory to "/home/kali": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
Applying permissions
could not change directory to "/home/kali": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/home/kali": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
Creating extension uuid-ossp
could not change directory to "/home/kali": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/home/kali": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
Creating extension pgcrypto
could not change directory to "/home/kali": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
could not change directory to "/home/kali": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist
Creating extension pg-gvm
could not change directory to "/home/kali": Permission denied
psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: database "gvmd" does not exist

-------------------------------------
Can someone help me to fix this issue

Jenner
2023-08-19, 17:33
I had the same problem and here is how I solved it:


sudo -u postgres psql -d postgres -c 'ALTER DATABASE postgres REFRESH COLLATION VERSION;'
sudo su
/usr/share/gvm/create-postgresql-database
sudo -u postgres psql
ALTER DATABASE template1 REFRESH COLLATION VERSION;
\q
exit
sudo -u postgres /usr/share/gvm/create-postgresql-database
sudo gvm-check-setup


I hope this stape will help you

skullsec
2023-08-24, 13:46
Please follow the below steps in the order:


1. Warning Message Explanation: The warning indicates a collation version mismatch in the PostgreSQL database. The database was created with version 2.36, while the operating system provides version 2.37.


2. Resolution Steps:

a. Rebuild Objects: Rebuild all objects in the database that use the default collation. Run the following command:


sudo -u postgres psql -d postgres -c "COLLATE "C""


b. Refresh Collation Version: Run the following command to refresh the collation version:


sudo -u postgres psql -d postgres -c "ALTER DATABASE postgres REFRESH COLLATION VERSION"


c. Update PostgreSQL:
If the issue persists, you might need to rebuild PostgreSQL with the correct library version. However, this step is more complex and may require additional research.


d. Missing Database Error: The "ERROR: The PostgreSQL DB does not exist" error can be resolved by running the following command:

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


e. Incomplete Installation:
The final "ERROR: Your GVM-22.5.0 installation is not yet complete!" error indicates that the setup is not finished. Re-run the "gvm-setup" and see if you get the errors or not.