Update PostgreSQL (was: Please help)

Please help how to fix this issue
──(root㉿kali)-[/home/kali]
└─# gvm-setup

[>] Starting PostgreSQL service

[>] Creating GVM’s certificate files

[>] Creating PostgreSQL database
could not change directory to “/home/kali”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.

[*] Creating database user
could not change directory to “/home/kali”: Permission denied
createuser: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.
could not change directory to “/home/kali”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.

[*] Creating database
could not change directory to “/home/kali”: Permission denied
createdb: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.
could not change directory to “/home/kali”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.

[*] 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: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.

[*] 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: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.
could not change directory to “/home/kali”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.

[*] 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: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.
could not change directory to “/home/kali”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.

[*] 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: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.
could not change directory to “/home/kali”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.

[*] 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: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.
[>] Migrating database

(gvmd:3043): md manage-WARNING **: 21:02:49.394: sql_open: PQconnectPoll failed

(gvmd:3043): md manage-WARNING **: 21:02:49.394: sql_open: PQerrorMessage (conn): connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.

(gvmd:3043): md manage-WARNING **: 21:02:49.394: init_manage_open_db: sql_open failed
[>] Checking for GVM admin user
[] Creating user admin for gvm
[
] Please note the generated admin password
[]
[
] Configure Feed Import Owner
could not change directory to “/home/kali”: Permission denied
psql: error: connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed: FATAL: the database system is not yet accepting connections
DETAIL: Consistent recovery state has not been yet reached.
[*] Define Feed Import Owner

(gvmd:3102): md main-CRITICAL **: 21:02:49.972: gvmd: g_option_context_parse: Missing argument for --value
[*] Update GVM feeds
Running as root. Switching to user ‘_gvm’ and group ‘_gvm’.
Trying to acquire lock on /var/lib/openvas/feed-update.lock
Acquired lock on /var/lib/openvas/feed-update.lock
⠹ Downloading Notus files from
rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/vt-da
ta/notus/ to /var/lib/notus
@ERROR: max connections (400) reached – try again later
rsync error: error starting client-server protocol (code 5) at main.c(1863)
[Receiver=3.2.7]

⠧ Downloading NASL files from
rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/vt-da
ta/nasl/ to /var/lib/openvas/plugins
@ERROR: max connections (400) reached – try again later
rsync error: error starting client-server protocol (code 5) at main.c(1863)
[Receiver=3.2.7]

Releasing lock on /var/lib/openvas/feed-update.lock

Trying to acquire lock on /var/lib/gvm/feed-update.lock
Acquired lock on /var/lib/gvm/feed-update.lock
⠼ Downloading SCAP data from
rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/scap-
data/ to /var/lib/gvm/scap-data
@ERROR: max connections (400) reached – try again later
rsync error: error starting client-server protocol (code 5) at main.c(1863)
[Receiver=3.2.7]

⠏ Downloading CERT-Bund data from
rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/cert-
data/ to /var/lib/gvm/cert-data
@ERROR: max connections (400) reached – try again later
rsync error: error starting client-server protocol (code 5) at main.c(1863)
[Receiver=3.2.7]

⠏ Downloading gvmd data from
rsync://feed.community.greenbone.net/community/data-feed/22.04/ to
/var/lib/gvm/data-objects/gvmd/22.04
Releasing lock on /var/lib/gvm/feed-update.lock
I want to update openvas 22.7.3 but i can’t update nvt scap cert
My version Openvas version
openvas -V
OpenVAS 22.7.3
gvm-libs 22.6.3
Most new code since 2005: (C) 2022 Greenbone Networks GmbH
Nessus origin: (C) 2004 Renaud Deraison deraison@nessus.org
License GPLv2: GNU GPL version 2
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
My kali version
Linux kali 6.3.0-kali1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.3.7-1kali1 (2023-06-29) x86_64 GNU/Linux

DETAIL: Consistent recovery state has not been yet reached. indicates that the database is in the process of recovery from some issue, such as crash recovery, and it has not yet reached a consistent state where connections can be allowed.

Looks like your PostgreSQL installation is corrupted or in recovery mode. You may want to check the PostgreSQL server logs.

1 Like

so how can i fix it, can u please tell me

How did you install Greenbone?

sudo apt install gvm
and then kali auto update openvas to 22.7.2 but when setup the error is come like my topic.

For non-Greenbone provided software it is suggested to ask the provider of that software for support / look into the relevant documentation of the software.

The reason for this is that a support forum for a product just using that software is usually not able to provide adequate support for 3rdparty products.

In the case of PostgreSQL this should be:

https://www.postgresql.org/support/

so how can i update from openvas version22.4 to 22.5 or 22.6. why i want to update becuase when i scan of pc this issue(Report outdated / end-of-life Scan Engine / Environment (local)) is come and i read the caption they want me to update the version.
(Solution
Solution Type:
Vendorfix
Update to the latest available stable release for your scan
environment. Please check the references for more information. If you’re using packages provided
by your Linux distribution please contact the maintainer of the used distribution / repository and
request updated packages.

If you want to accept the risk of a possible decreased scan coverage or missing detection of
vulnerabilities on the target you can set a global override for this script as described in the
linked GSM manual.)

Please fix the PostgreSQL database error with the help of the PostgreSQL support and subsequent scans shouldn’t show this message anymore (as the packages seems to have been already updated to the newest versions according to the posted messages).

(moderator note, updated title to reflect issue and moved thread)

1 Like

(kali㉿kali)-[~]
└─$ sudo gvm-setup

[>] Starting PostgreSQL service

[>] Creating GVM’s certificate files

[>] Creating PostgreSQL database
could not change directory to “/home/kali”: Permission denied
[i] User _gvm already exists in PostgreSQL
could not change directory to “/home/kali”: Permission denied
[i] Database gvmd already exists in PostgreSQL
could not change directory to “/home/kali”: Permission denied
[i] Role DBA already exists in PostgreSQL

[*] Applying permissions
could not change directory to “/home/kali”: Permission denied
NOTICE: role “_gvm” is already a member of role “dba”
GRANT ROLE
could not change directory to “/home/kali”: Permission denied
[i] Extension uuid-ossp already exists for gvmd database
could not change directory to “/home/kali”: Permission denied
[i] Extension pgcrypto already exists for gvmd database
could not change directory to “/home/kali”: Permission denied
[i] Extension pg-gvm already exists for gvmd database
[>] Migrating database

(gvmd:12377): md manage-WARNING **: 23:20:08.933: sql_open: PQconnectStart to ‘gvmd’ failed: 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?

(gvmd:12377): md manage-WARNING **: 23:20:08.933: init_manage_open_db: sql_open failed
[>] Checking for GVM admin user
[] Creating user admin for gvm
[
] Please note the generated admin password
[]
[
] Configure Feed Import Owner
could not change directory to “/home/kali”: Permission denied
[*] Update GVM feeds
Running as root. Switching to user ‘_gvm’ and group ‘_gvm’.
Trying to acquire lock on /var/lib/openvas/feed-update.lock
Acquired lock on /var/lib/openvas/feed-update.lock
⠏ Downloading Notus files from rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/vt-data/notus/ to
/var/lib/notus
⠏ Downloading NASL files from rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/vt-data/nasl/ to
/var/lib/openvas/plugins
Releasing lock on /var/lib/openvas/feed-update.lock

Trying to acquire lock on /var/lib/gvm/feed-update.lock
Acquired lock on /var/lib/gvm/feed-update.lock
⠼ Downloading SCAP data from rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/scap-data/ to
/var/lib/gvm/scap-data
⠏ Downloading CERT-Bund data from rsync://feed.community.greenbone.net/community/vulnerability-feed/22.04/cert-data/ to
/var/lib/gvm/cert-data
⠙ Downloading gvmd data from rsync://feed.community.greenbone.net/community/data-feed/22.04/ to
/var/lib/gvm/data-objects/gvmd/22.04
Releasing lock on /var/lib/gvm/feed-update.lock
(after i solved the postgresql and then thif issue has come how to fix this please help )

This still looks like a PostgreSQL database problem unrelated to the Greenbone software stack.

I’m not understanding the problem. Looks like the database is updating the feeds just fine.

You can check postgeSQL is running:

systemctl status postgresql

or run the GVM system check built into Kali:

sudo gvm-check-setup