Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msfdb init command fails to start database service in linux #16086

Closed
3V3RYONE opened this issue Jan 22, 2022 · 4 comments · Fixed by #16094
Closed

msfdb init command fails to start database service in linux #16086

3V3RYONE opened this issue Jan 22, 2022 · 4 comments · Fixed by #16094
Labels
bug not-stale Label to stop an issue from being auto closed

Comments

@3V3RYONE
Copy link
Contributor

The ./msfdb init command fails to start the database service in a Linux system. It fails with an error.

Steps to reproduce

  1. git clone the msf repository in a linux system and setup the environment (bundle install)
  2. cd metasploit-framework, change into installed directory
  3. run ./msfdb init
  4. Type no for init webservices, as its not necessary
  5. Check how the script fails with an error message.

Although I am running the MSF through the github repo version, I'm sure this issue would still arise if we install MSF from the installers available online (https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers)

Expected behavior

The script should continue to initialize the database service.

Current behavior

The script fails with an error.

Error Log:

./msfdb init
[?] Would you like to init the webservice? (Not Required) [no]: no
Clearing http web data service credentials in msfconsole
Running the 'init' command for the database:
Creating database at /home/beleswar/.msf4/db
Starting database at /home/beleswar/.msf4/db...failed
Creating database users
/home/beleswar/.local/share/gem/ruby/3.0.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad)
	Is the server running on host "127.0.0.1" and accepting
	TCP/IP connections on port 5433?

Metasploit version

Framework: 6.1.24-dev-8e6fa39a93
Console : 6.1.24-dev-8e6fa39a93

@3V3RYONE 3V3RYONE added the bug label Jan 22, 2022
@3V3RYONE
Copy link
Contributor Author

Was working on this, and the error mentioned in the above issue is fixed.
But there is a new error now, which still fails the ./msfdb init command. Working on the new error now.

Log:

./msfdb init
[?] Would you like to init the webservice? (Not Required) [no]: no
Clearing http web data service credentials in msfconsole
Running the 'init' command for the database:
Creating database at /home/beleswar/.msf4/db
Starting database at /home/beleswar/.msf4/db...success
Creating database users
/home/beleswar/.local/share/gem/ruby/3.0.0/gems/pg-1.2.3/lib/pg.rb:58:in `initialize': FATAL:  role "msf" does not exist (PG::ConnectionBad)

@github-actions
Copy link

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Feb 22, 2022
@github-actions
Copy link

Hi again!

It’s been 60 days since anything happened on this issue, so we are going to close it.
Please keep in mind that I’m only a robot, so if I’ve closed this issue in error please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@3V3RYONE
Copy link
Contributor Author

Open

@adfoster-r7 adfoster-r7 reopened this May 31, 2022
@github-actions github-actions bot removed the Stale Marks an issue as stale, to be closed if no action is taken label May 31, 2022
@adfoster-r7 adfoster-r7 added the not-stale Label to stop an issue from being auto closed label May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug not-stale Label to stop an issue from being auto closed
Projects
None yet
2 participants