Noah's Randomness

Photographer, Traveler, Geek, Pentester, Information Security Consultant, Firefighter/EMT, etc…
  • rss
  • Home
  • My Resume
  • My Photos

NeXpose and BackTrack 4: “Could not start the nxpgsql daemon” [Fixed]

Noah | December 21, 2009

UPDATE/Fix Information: I found out that this was all related to the previous solution of disabling the postgresql instance on the machine. I had (mistakenly) thought that by doing /etc/init.d/postgresql-8.3 stop that BackTrack’s posgresql instance would stop. Unfortunately I was wrong, and a “ps aux | grep -i sql” showed me this. After I did a “kill <PID>” I removed all NeXpose files/folders and reinstalled it. However it still wouldnt run correctly/gave me the same error. After some discussion in #rapid7 on irc.freenode.net, I was informed that NeXpose requires 1GB of RAM. So I edited my VMWare config to provide 1GB of RAM to my BackTrack guest.

However, then I had another issue — the NeXpose server kept crashing after starting. So, again I turned to the guys in #rapid7. With their help, I ran “cd /opt/rapid7/nexpose/nsc && rm conf/nsc.xml && ./nsc.sh” and voila! Success!

So, to reiterate, to fix “Could not start the nxpgsql daemon,” I:

  • Determine the running PostgreSQL’s PID by doing “ps aux | grep -i sql”
  • “kill <PID>” the offending PID from above
  • Reinstall NeXpose
  • If you are utilizing VMWare or some virtualization software, increase the VM’s RAM to 1GB (or greater)
  • Delete nsc.xml from /opt/rapid7/nexpose/nsc/conf/
  • Start the NeXpose daemon

Again, the cause of the “Could not start the nxpgsql daemon” is due to the fact that the nxpgsql server is trying to start, but there is already an existing PostgreSQL server running. The nxpgsql server tries to use the same default port (5432) as the existing PostgresSQL server. Knowing this, I set out to fix this problem. Here’s how I did it:

  • Edit /opt/rapid7/nexpose/nsc/conf/nsc.xml
  • Change line #4 to say: <Database dbms=”postgresql” db=”//127.0.0.1:5433/nexpose”>
    <Database dbms=”postgresql” db=”//127.0.0.1:5433/nexpose”>
  • Save nsc.xml
  • Edit /opt/rapid7/nexpose/nsc/nxpgsql/nxpdata/postgresql.conf
  • Uncomment line 60 and change it to say: “port = 5433 # (change requires restart)”
  • Save postgresql.conf


Original Post After seeing this post showing neXpose running on BackTrack 4, I wanted to try installing it on my BT4 VM. So, I followed the instructions in this video.

I went to run the neXpose client/server after install (by doing ./nsc.sh), but was met with the following error message/log:

NSC 12/21/09 6:43 PM: Initializing postgresql database manager for //127.0.0.1:5432/nexpose… postgresql 12/21/09 6:43 PM: Starting up postgresql DB system postgresql 12/21/09 6:43 PM: Nexpose PostgreSQL service status: 0 postgresql 12/21/09 6:43 PM: Nexpose PostgreSQL service status: 1 NSC 12/21/09 6:43 PM: Database initialization failed : java.sql.SQLException: Error starting PostgreSQL: com.rapid7.os.OSException: Could not start the nxpgsql daemon at com.rapid7.nexpose.datastore.A.K.E(Unknown Source) at com.rapid7.nexpose.datastore.n.H(Unknown Source) at com.rapid7.nexpose.datastore.n.E(Unknown Source) at com.rapid7.nexpose.datastore.n.E(Unknown Source) at com.rapid7.nexpose.nsc.NSC.U(Unknown Source) at com.rapid7.nexpose.nsc.NSC.ô(Unknown Source) at com.rapid7.nexpose.nsc.NSC.õ(Unknown Source) at com.rapid7.nexpose.nsc.NSC.run(Unknown Source) at com.rapid7.nexpose.nsc.NSC.main(Unknown Source) Caused by: com.rapid7.os.OSException: Could not start the nxpgsql daemon at com.rapid7.nexpose.datastore.A.K.A(Unknown Source) … 9 more SQLState=null, errorCode=0

So with that in mind I started Googling around to see what I could find. Long story short, I found the following:

  • neXpose Known Issues, which didn’t help at all/have any useful information
  • Metasploit Mailing List Post regarding a similar issue which told me to disable any existing postgresql instance and reinstall neXpose
  • neXpose Common Errors, which went so far as to suggest complete removal of postgresql from your system… which didn’t seem too logical to me seeing as Metasploit uses it…

So with all that said, I’m still stuck. I’m hoping that @rapid7 responds to my Tweet (@rapid7 HELP! Can’t get #neXpose to work on BT4. So far, no go: “Could not start the nxpgsql daemon.” Full error paste: http://bit.ly/6pJ1Ve), but we’ll see.

If anyone has encountered this before and/or has any ideas on how to fix it, please leave me a comment below. Thanks!

Categories
How To
Tags
BackTrack, fix, How To, Howto, infosec, NeXpose, Security
Comments rss
Comments rss
Trackback
Trackback

« 2002 Volvo S40 vs Deer: Before and After Eye-Fi vs PixelPipe iPhone Apps Reviewed »

7 Responses to “NeXpose and BackTrack 4: “Could not start the nxpgsql daemon” [Fixed]”

  1. Chad Loder says:
    December 22, 2009 at 2:12 am

    Hi Noah. I think I know what the issue may be. Look at the contents of /opt/rapid7/nexpose/nsc/nxpgsql/nxpdata/nxpgsql.log. If this file exists, you may see an error message like the following:

    FATAL: could not create lock file “/tmp/.s.PGSQL.5432.lock”: Permission denied

    If you see this error message, this is because the nxpgsql user does not have permission to write to /tmp. If you chmod go+w /tmp, this should work for you when you restart NeXpose.

  2. Bizaily says:
    December 22, 2009 at 10:19 am

    Just Tweeted you, but it is hard to say the full error without the nxpgsql.log

  3. Archangel.Amael says:
    April 12, 2010 at 11:18 am

    Hey thanks for linking my video guide. Apparently the above problem still exists for some users. http://www.backtrack-linux.org/forums/experts-forum/27080-nexpose-backtrack-4-beta-vmware.html Just as a FYI I did not use BT4 beta but a vanilla BT4 Pre-Final as the base, not sure if that is what you did.

    Cheers

  4. Logan says:
    June 21, 2011 at 5:47 pm

    Hy,

    is there any possibility to the same PostgreSql database with nexpose AND metasploit? I am using Backtrack5 with metasploit 3.7.2 and Postgresql as tutorialed here: http://www.backtrack-linux.org/forums/backtrack-5-experts-section/40377-bt5-metasploit-postgresql.html

    my regards

  5. Noah says:
    June 23, 2011 at 9:58 am

    Hi Logan,

    I don’t see any reason why you couldn’t use the same PostgreSQL database engine with both Nexpose and Metasploit. They would have their own databases within PostgreSQL. However, if you mean actually sharing data between the two, I’m not quite sure if that’d be possible.

    Apparently, per this link: https://community.rapid7.com/docs/DOC-1266, you can use a Nexpose plugin to integrate with Metasploit. Might try looking into that as well.

    Hope that helps. Let me know if I can do anything else!

    -Noah

  6. TeNeX says:
    June 29, 2011 at 9:02 pm

    Hi i have an issue when start my nexpose installation cause i kill postgres PID by a finger mistake so obviously my nexpose send me the this error when log in:

    NeXpose has reported the following error: Critical error during initialization: Failed to init login module: SQL Exception: Database ‘nexpose’ not found.

    so when i go to “HOME” page shows following mistake:

    Home :: Error An error was encountered processing your request.

    Source page: /home.html

    Error code: 500

    Error message: server not configured to handle request for /home.html

    so… i though maybe whether a solution to avoid reinstallation is trying to restore a back up from other nexpose?

  7. Noah says:
    August 11, 2011 at 9:19 am

    You should be able to restart your postgresql daemon without having to totally reinstall Postgres. What OS are you installing this on?

Leave a Reply

Click here to cancel reply.

Categories

  • Bloomington Twp Fire Dept
  • Fire/EMS
  • How To
  • InfoSec
  • iPhone
  • Review
  • Uncategorized

What I'm Doing/My Tweets...

  • RT @DEVOPS_BORAT Walk before run. C before C++ before Java before Scala. (RT'ed  for your entertainment, @lucasjmorris) 1 week ago
  • I am highly considering commenting the Perl code/script I'm writing tonight with the one liners, quotes, etc from the Republican debates #FB 1 week ago
  • Checked the first item off my to-do list for tonight, now onto the second one: Perl coding. Last few times Perl won. Not this time! #FB 1 week ago
  • Wow... just wow... http://t.co/wIgHFrO1 #AuditorFail 1 week ago
  • @MDel78 I love New Glarus brewery! :-) 2 weeks ago
  • More updates...

Posting tweet...

Powered by Twitter Tools

Google Voice

Ads:

Calendar

December 2009
M T W T F S S
« Nov   Mar »
 123456
78910111213
14151617181920
21222324252627
28293031  

Recent Comments

  • Noah Jaehnert (@njaehner) on Nest Learning Thermostat Unboxing/Install
  • Noah on Facebook Old Password vs Incorrect Password
  • Ariana on Facebook Old Password vs Incorrect Password
  • Noah on NeXpose and BackTrack 4: “Could not start the nxpgsql daemon” [Fixed]
  • TeNeX on NeXpose and BackTrack 4: “Could not start the nxpgsql daemon” [Fixed]

Akismet

4,860 spam comments blocked by
Akismet

Tags

awesome BackTrack Blackberry Blackberry Torch BTFD EMS Eye-Fi Fire Fire/EMS Fire Department fix funny gentoo How To Howto infosec iPhone NeXpose Passwords PixelPipe reddit Security Site Update Starbucks wordpress
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox