Skip to content

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

Closed
@3V3RYONE

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugnot-staleLabel to stop an issue from being auto closed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions