FEED Sync ALL falling

Hi everyone, I’m having problems updating all the feeds manually.

Running:

$ docker compose -f ./greenbone-community-container/docker-compose.yml -p greenbone-community-edition run --rm greenbone-feed-sync greenbone-feed-sync --type all
Traceback (most recent call last):
  File "/usr/local/bin/greenbone-feed-sync", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/greenbone/feed/sync/main.py", line 221, in main
    sys.exit(asyncio.run(feed_sync(console, error_console)))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/greenbone/feed/sync/main.py", line 173, in feed_sync
    async with flock_wait(
  File "/usr/lib/python3.11/contextlib.py", line 204, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/greenbone/feed/sync/helper.py", line 61, in flock_wait
    with path.open("w", encoding="utf8") as fd0:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/pathlib.py", line 1045, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/var/lib/openvas/feed-update.lock'


$ docker compose -f ./greenbone-community-container/docker-compose.yml -p greenbone-community-edition run --rm greenbone-feed-sync greenbone-feed-sync --type port-list
Trying to acquire lock on /var/lib/gvm/feed-update.lock
Acquired lock on /var/lib/gvm/feed-update.lock
⠇ Downloading port lists from rsync://feed.community.greenbone.net/community/data-feed/22.04/port-lists/ to /var/lib/gvm/data-objects/gvmd/22.04/port-lists
Releasing lock on /var/lib/gvm/feed-update.lock

I feel that many problems that I’m having are related with this error.

Extra info:
(choose from ‘all’, ‘nvt’, ‘gvmd-data’, ‘scap’, ‘cert’, ‘notus’, ‘nasl’, ‘report-format’, ‘scan-config’, ‘port-list’)
all, nvt, notus and nasl - NOK

this is the docker ps:

$ docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED        STATUS          PORTS                    NAMES
8d1100521a57   greenbone/gsa:stable            "/usr/local/bin/entr…"   14 hours ago   Up 6 hours      127.0.0.1:9392->80/tcp   greenbone-community-edition-gsa-1
cc333efd022f   greenbone/gvmd:stable           "/usr/local/bin/entr…"   14 hours ago   Up 33 minutes                            greenbone-community-edition-gvmd-1
cfddae9db24a   greenbone/ospd-openvas:stable   "/usr/bin/tini -- /u…"   14 hours ago   Up 3 hours                               greenbone-community-edition-ospd-openvas-1
465f4d012da7   greenbone/redis-server          "/bin/sh -c 'rm -f /…"   14 hours ago   Up 6 hours                               greenbone-community-edition-redis-server-1
1dd24de3b855   greenbone/pg-gvm:stable         "/usr/local/bin/entr…"   14 hours ago   Up 6 hours                               greenbone-community-edition-pg-gvm-1
cfbf4cb1c934   greenbone/mqtt-broker           "/bin/sh -c 'mosquit…"   14 hours ago   Up 6 hours                               greenbone-community-edition-mqtt-broker-1

Thank you.

Extra:

Hi,

it should never be necessary to do a manual feed “sync”. Running greenbone-feed-sync only downloads new feed data from the feed server. This is the same as pulling new feed data containers. Therefore most likely this is not an issue with the feed download. Instead this is an issue with gvmd not loading the downloaded feed data. Therefore you need to inspect the log messages of gvmd.

You can also try to force gvmd to load the downloaded scan configs, port lists and report formats by running

docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition exec gvmd gvmd --rebuild-gvmd-data=all

To take a look a the latest logs of gvmd you can run

docker compose -f $DOWNLOAD_DIR/docker-compose.yml -p greenbone-community-edition logs -f gvmd
1 Like

Hi thank you for help, at this stage I’m having and error when running:

$ date; docker compose -f ./greenbone-community-container/docker-compose.yml -p greenbone-community-edition exec gvmd gvmd --rebuild-gvmd-data=all
seg 18 mar 2024 09:06:36 UTC

In the log:

gvmd-1  | md   main:MESSAGE:2024-03-18 09h06.25 utc:23204:    Greenbone Vulnerability Manager version 23.5.1 (DB revision 255)
gvmd-1  | md manage:WARNING:2024-03-18 09h06.25 utc:23204: sql_open: PQconnectPoll failed
gvmd-1  | md manage:WARNING:2024-03-18 09h06.25 utc:23204: sql_open: PQerrorMessage (conn): FATAL:  role "root" does not exist
gvmd-1  | md manage:WARNING:2024-03-18 09h06.25 utc:23204: init_manage_open_db: sql_open failed

Any ideia how to solve it?

Thank you for your help.

I am not sure if this is the real cause of your issue, but it seems your database container is broken. If you don’t have any data that you want to keep the easiest solution is to start from scratch. See

1 Like