md main-Message: 16:51:14.368: Greenbone Vulnerability Manager version 22.4.0~dev1 (DB revision 250)
(gvmd:17404): md manage-WARNING **: 16:51:14.368: Failed to open lock file '/run/gvmd/gvm-checking': No such file or directory
Permissions for /run/gvmd are:
drwxr-xr-x 2 gvm gvm 120 Jan 11 17:00 gvmd
Weird. So i went ahead and touched that file as sudo, changed the ownership to gvm:gvm and got past that error.
Next error is:
“Can not open ‘/var/log/gvm/gvmd.log’ logfile: Permission denied”
Permission for folder /var/log/gvm/: drwxr-xr-x 2 gvm gvm 4.0K Jan 11 17:11 gvm
Permission for file: -rw-r--r-- 1 gvm gvm 0 Jan 11 17:11 /var/log/gvm/gvmd.log
So i did a chmod 664 for the gvmd.log. (Since i start it as normal user, which is part of the gvm group)
error is gone, but:
I dont get any output from the command.
The gvmd.log now contains a fatal error:
“sql_open: PQerrorMessage (conn): connection to server on socket “/var/run/postgresql/.s.PGSQL.5432” failed:role $MYUSERNAME” does not exist."
$MYUSERNAME is my actual username that i replaced in the output.
I followed every single step throughout the documentation, so i guess its wrong or missing a important step at one point.
Thanks for your response. I just went through the entire process again, and ended up with the same result.
I guess there is something wrong with the documentation.
I noticed a few times when i used the “copy button” next to the commands to run on console: its not doing what its supposed to do!
for example, https://greenbone.github.io/docs/latest/22.4/source-build/index.html#id117
when i copy the block using the button the directory “/run/gvmd” doesnt get created.
How is it “supposed” to work?
I run all the commands as normal user, some of them as sudo. (where told to)
My user is member of the group gvm.
But… i dont see where postgresql is told that all members of the group gvm get dba rights: only the user gvm.
So thats probably why the error message appears:
“failed: FATAL: role “MYUSERNAME” does not exist”
yep, from my understanding: it never got created.
So i guess the command “gvmd --create-user=admin” should get run as gvm user, and not as “normal” user OR the normal user needs a role in posgresql?
EDIT: I just tested this theory, once i ran “gvmd --create-user=admin” as gvm the command worked and i got a password for the admin. (had to change owner of files in /run/gvmd to gvm:gvm since they were owned by my user)
I ran those commands, but i suspect that there might was another problem with the copy function of the site with that script block as well.
I run firefox 109 on windows and connected to the server via putty. shrug nothing fancy or extraordinary here.
Since i now know that there is a problem with that button, maybe i should do the entire build process once more and copy all the commands without the use of this button.
Maybe no, but If your Ubuntu VM already has postgreSQL installed, there may be some conflict. I have had this issue with GVM install on Ubuntu before. Then maybe it can’t find the username because looking at the different PG service?