Sharing on how to resolve 'gvmd migration issue' with small issues to discuss

this post is mainly for discussion, the issue has been resolved but with some interesting side effects, might be some small bugs

GVM versions

gsad: Greenbone Security Assistant 20.08.0~git
gvmd: Greenbone Vulnerability Manager 20.08.0 Manager DB revision 233
openvas-scanner: OpenVAS 20.8.0
gvm-libs: gvm-libs 20.8.0

Environment

Operating system: KALI
Kernel: Linux kali 5.8.0-kali3-amd64 #1 SMP Debian 5.8.14-1kali1 (2020-10-13) x86_64 GNU/Linux
Installation method / source: apt install gvm

Issues and solution

I’ve upgrade gvm to latest 20.08.0 through apt upgrade, and run into “Gvmd: database is wrong version”, then I followed tips from another post here

And I managed to migrate using the role provided by kali:_gvm

                                   List of roles
 Role name |                         Attributes                         | Member of
-----------+------------------------------------------------------------+-----------
 _gvm      |                                                            | {dba}
 dba       | Superuser, No inheritance, Cannot login                    | {}
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}

after execute
sudo -u _gvm gvmd --migrate, nothing appear on the terminal, it just returned, from gvm.log I found it’s successful but with some warnings:

md   main:MESSAGE:2020-12-02 02h05.36 utc:54140:    Greenbone Vulnerability Manager version 20.08.0 (DB revision 233)
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating database.
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 222
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 223
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 224
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 225
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 226
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 227
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 228
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 229
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 230
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 231
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 232
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Migrating to 233
md   main:WARNING:2020-12-02 02h05.36 utc:54140: migrate_232_to_233_set_predefined: Failed to open directory '/var/lib/gvm/data-objects/gvmd/20.08/report_formats': Error opening directory “
cts/gvmd/20.08/report_formats”
md   main:WARNING:2020-12-02 02h05.36 utc:54140: migrate_232_to_233_set_predefined: Failed to open directory '/var/lib/gvm/data-objects/gvmd/20.08/configs': Error opening directory “
d/20.08/configs”
md   main:WARNING:2020-12-02 02h05.36 utc:54140: migrate_232_to_233_set_predefined: Failed to open directory '/var/lib/gvm/data-objects/gvmd/20.08/port_lists': Error opening directory “
gvmd/20.08/port_lists”
md   main:WARNING:2020-12-02 02h05.36 utc:54140: migrate_232_to_233_set_predefined: Failed to open directory '/var/lib/gvm/data-objects/gvmd/20.08/report_formats': Error opening directory “
cts/gvmd/20.08/report_formats”
md   main:WARNING:2020-12-02 02h05.36 utc:54140: migrate_232_to_233_set_predefined: Failed to open directory '/var/lib/gvm/data-objects/gvmd/20.08/configs': Error opening directory “
d/20.08/configs”
md   main:WARNING:2020-12-02 02h05.36 utc:54140: migrate_232_to_233_set_predefined: Failed to open directory '/var/lib/gvm/data-objects/gvmd/20.08/port_lists': Error opening directory “
gvmd/20.08/port_lists”
md   main:   INFO:2020-12-02 02h05.36 utc:54140:    Analyzing the database. This may take up to several hours.
md   main:   INFO:2020-12-02 02h05.45 utc:54140:    Migration succeeded.

and then I did gvm-check-setup, the result looks fine:

root@kali:/home/lyhistory# gvm-check-setup
gvm-check-setup 20.8.0
  Test completeness and readiness of GVM-20.8.0
Step 1: Checking OpenVAS (Scanner)...
        OK: OpenVAS Scanner is present in version 20.8.0.
        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: _gvm owns all files in /var/lib/openvas/plugins
        OK: NVT collection in /var/lib/openvas/plugins contains 63037 NVTs.
Checking that the obsolete redis database has been removed
        OK: No old Redis DB
        OK: ospd-OpenVAS is present in version 20.8.0.
Step 2: Checking GVMD Manager ...
        OK: GVM Manager (gvmd) is present in version 20.08.0.
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 ...
        OK: Postgresql version and default port are OK.
 gvmd      | _gvm     | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
        OK: At least one user exists.
Step 6: Checking Greenbone Security Assistant (GSA) ...
Oops, secure memory pool already initialized
        OK: Greenbone Security Assistant is present in version 20.08.0~git.
Step 7: Checking if GVM services are up and running ...
        OK: ospd-openvas service is active.
        OK: gvmd service is active.
        OK: greenbone-security-assistant service is active.
Step 8: Checking few other requirements...
        OK: nmap is present in version 20.08.0~git.
        OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work.
        WARNING: Could not find makensis binary, LSC credential package generation for Microsoft Windows targets will not work.
        SUGGEST: Install nsis.
        OK: xsltproc found.
        WARNING: Your password policy is empty.
        SUGGEST: Edit the /etc/gvm/pwpolicy.conf file to set a password policy.

It seems like your GVM-20.8.0 installation is OK.

and finally I gave it a test, but I failed login with the admin username&password which worked on previous version!!!
not sure if it’s because of the db migration might has some small bugs, anyway I manually changed the password and then can login with the new password again, I don’t know whether other people has the same issue, please let me know, thanks

The migration errors looks to me to some kind of problems in the Kali packages so i would suggest that you open an issue about that on http://bugs.kali.org/.

Note: Greenbone isn’t involved in the Kali packaging.

The GVM-20.08 packages on Kali looks fairly new and it might be possible that the package maintainer have missed some of the “Notable Changes in this Release” mentioned here:

1 Like

There is now an open bug tracked for the Kali package maintainers here:

https://bugs.kali.org/view.php?id=6900

containing the following note:

The user needs to run gvm-setup after the upgrade. I will document it better in the package.

yeah, that’s my ticket, thanks

1 Like