Results 1 to 7 of 7

Thread: msf fails to connect to db

  1. #1
    Just burned their ISO
    Join Date
    Aug 2009
    Posts
    3

    Default msf fails to connect to db

    I'm getting this error when starting the msfconsole
    Code:
    root@bt:~# msfconsole 
    [-] ***
    [-] *
    [-] * Metasploit now requires version 0.11 or higher of the 'pg' gem for database support
    [-] * There a three ways to accomplish this upgrade:
    [-] * 1. If you run Metasploit with your system ruby, simply upgrade the gem:
    [-] *    $ rvmsudo gem install pg 
    [-] * 2. Use the Community Edition web interface to apply a Software Update
    [-] * 3. Uninstall, download the latest version, and reinstall Metasploit
    [-] *
    [-] ***
    [-] 
    [-] 
    [-] Failed to connect to the database: Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (RubyGem version error: pg(0.9.0 not ~> 0.11)
    ) {"adapter"=>"postgresql", "database"=>"msf3", "username"=>"msf3", "password"=>"cc714249", "host"=>"127.0.0.1", "port"=>7175, "pool"=>75, "timeout"=>5} ["/opt/framework/ruby/lib/ruby/1.9.1/rubygems.rb:751:in `report_activate_error'", "/opt/framework/ruby/lib/ruby/1.9.1/rubygems.rb:214:in `activate'", "/opt/framework/ruby/lib/ruby/1.9.1/rubygems.rb:1054:in `gem'", "/opt/framework/msf3/lib/gemcache/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:7:in `<top (required)>'", "/opt/framework/msf3/lib/fastlib.rb:374:in `require'", "/opt/framework/msf3/lib/fastlib.rb:374:in `require'", "/opt/framework/msf3/lib/gemcache/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'", "/opt/framework/msf3/lib/gemcache/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'", "/opt/framework/msf3/lib/gemcache/ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'", "/opt/framework/msf3/lib/gemcache/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:50:in `resolve_hash_connection'", "/opt/framework/msf3/lib/gemcache/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:29:in `spec'", "/opt/framework/msf3/lib/gemcache/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:129:in `establish_connection'", "/opt/framework/msf3/lib/msf/core/db_manager.rb:208:in `connect'", "/opt/framework/msf3/lib/msf/ui/console/driver.rb:195:in `initialize'", "/opt/framework/msf3/msfconsole:148:in `new'", "/opt/framework/msf3/msfconsole:148:in `<main>'"]
    I installed the postgresql adapter
    Code:
    root@bt:~# gem install activerecord-postgresql-adapter
    Successfully installed activerecord-postgresql-adapter-0.0.1
    1 gem installed
    Installing ri documentation for activerecord-postgresql-adapter-0.0.1...
    Installing RDoc documentation for activerecord-postgresql-adapter-0.0.1...
    Also the pg
    Code:
    root@bt:~# gem install pg
    Building native extensions.  This could take a while...
    Successfully installed pg-0.14.1
    1 gem installed
    Installing ri documentation for pg-0.14.1...
    Installing RDoc documentation for pg-0.14.1...
    Reinstalled postgresql
    Code:
    root@bt:~# apt-get install postgresql
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    postgresql is already the newest version.
    The following packages were automatically installed and are no longer required:
      ettercap
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 24 not upgraded.

    And after all this, I still get the same error above.

    What should I do next?

  2. #2
    Administrator sickness's Avatar
    Join Date
    Jan 2010
    Location
    Behind the screen.
    Posts
    2,921

    Default Re: msf fails to connect to db

    I fail to encounter this issue:
    Code:
    root@bt:~# msfconsole 
    
         ,           ,
        /             \
       ((__---,,,---__))
          (_) O O (_)_________
             \ _ /            |\
              o_o \   M S F   | \
                   \   _____  |  *
                    |||   WW|||
                    |||     |||
    
    
    
    
           =[ metasploit v4.5.0-dev [core:4.5 api:1.0]
    + -- --=[ 991 exploits - 560 auxiliary - 163 post
    + -- --=[ 262 payloads - 28 encoders - 8 nops
    
    
    msf >
    Metasploit uses it's own postgresql database so chances are you may have broken something. I would suggest you join their IRC channel and look for help.
    Also reinstalling msf might solve the problems.
    Back|track giving machine guns to monkeys since 2007 !

    Do not read the Wiki, most your questions will not be answered there !
    Do not take a look at the: Forum Rules !

  3. #3
    Just burned their ISO
    Join Date
    Aug 2009
    Posts
    3

    Default Re: msf fails to connect to db

    Originally I had a problem with Armitage after an msfupdate.

    After several hours of running through every option available I had to purge msf.
    Re-installed it and then this was the issue:
    Failed to connect to the database: Please install the postgresql adapter: `gem install activerecord-postgresql-adapter`

    I thought I took care of it but it keeps coming up.

    Have I miss something?... I don't have a clue as to what to try next.


    Thanks for replying.

  4. #4
    Administrator sickness's Avatar
    Join Date
    Jan 2010
    Location
    Behind the screen.
    Posts
    2,921

    Default Re: msf fails to connect to db

    Try completely removing metasploit and download a fresh copy from their official website, see if that works for you.
    Back|track giving machine guns to monkeys since 2007 !

    Do not read the Wiki, most your questions will not be answered there !
    Do not take a look at the: Forum Rules !

  5. #5
    Very good friend of the forum maverik35's Avatar
    Join Date
    Sep 2009
    Location
    Debian land
    Posts
    734

    Default Re: msf fails to connect to db

    I've seen people reinstalling msf due to update...All came out just fine after re- installation..So do as sickness says...

  6. #6
    Just burned their ISO
    Join Date
    Aug 2009
    Posts
    3

    Default Re: msf fails to connect to db

    So after several hours of downloading and re-installing, I've decided to move to a new VM.

    I'm keeping the old one to eventually learn from it as I progress.


    Thanks a lot for your answers guys.

  7. #7
    Very good friend of the forum maverik35's Avatar
    Join Date
    Sep 2009
    Location
    Debian land
    Posts
    734

    Default Re: msf fails to connect to db

    If I were you , I would dual boot..

    But it's up to you...It's your call.

    Luck.

Similar Threads

  1. Wicd fails to get IP from wifi router - Unable to connect to Wifi
    By tesla88 in forum BackTrack 5 Beginners Section
    Replies: 25
    Last Post: 03-26-2013, 03:54 AM
  2. Replies: 4
    Last Post: 07-17-2010, 01:58 PM
  3. APT-GET fails
    By spriggsy in forum Beginners Forum
    Replies: 2
    Last Post: 05-15-2010, 04:27 PM
  4. WG111v2 usb adapter, fails to connect..help
    By humpy in forum OLD Newbie Area
    Replies: 2
    Last Post: 07-08-2009, 07:30 AM
  5. wep key successfully decrypted, but wep connect fails
    By risqqq in forum OLD Newbie Area
    Replies: 6
    Last Post: 01-21-2009, 12:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •