[nexpose-users] Postgres Error (Nexpose API)

Quintin Ash qash at ligatt.com
Wed Jun 16 15:40:01 PDT 2010


Hello, 

I am testing out some of the API calls for Nexpose. I am currently using the Ruby API and have came across an error:

$ ruby nexpose_scan_pdf.rb 81
./nexpose.rb:125:in `execute': NexposeAPI: Action failed: ERROR: value too long for type character varying(255) (Nexpose::APIError)
	from ./nexpose.rb:344:in `execute'
	from ./nexpose.rb:1923:in `saveReport'
	from nexpose_scan_pdf.rb:111

I checked the logs and I came across this:

ERROR:  value too long for type character varying(255)
STATEMENT:  INSERT INTO report_sprops (rpt_id, rsec_id, pname, pvalue) VALUES ($1, $2, $3, $4)
ERROR:  value too long for type character varying(255)
STATEMENT:  INSERT INTO report_sprops (rpt_id, rsec_id, pname, pvalue) VALUES ($1, $2, $3, $4)
ERROR:  value too long for type character varying(255)
STATEMENT:  INSERT INTO report_sprops (rpt_id, rsec_id, pname, pvalue) VALUES ($1, $2, $3, $4)

What I am simply trying to do is create a site and a report though the nexpose.rb.

I know for a fact that none of the values that I am passing in are over 255 chars

Here is a snippet of the code:

  #Create a new Report configuration
  report_config = Nexpose::ReportConfig.new(nsc)

  #Choose an audit report
  report_config.set_template_id($report_temp)

  #Make the report a PDF
  report_config.set_format("pdf")

  #Save the file in this folder
  report_config.set_store_location("somedirectory/" + $folder_name.to_s)

  #Change the name of the report
  report_config.set_name("Report for " + $ip_address + " " + current_time)

  #Generate the report after the scan
  report_config.set_generate_after_scan(1)

  #Save the Report Configuration
  report_config.saveReport()

  #Here is where the error is coming in
  #Copy of the error
  #./nexpose.rb:125:in `execute': NexposeAPI: Action failed: ERROR: value too long for type character varying(255) (Nexpose::APIError)
  #	from ./nexpose.rb:344:in `execute'
  #	from ./nexpose.rb:1923:in `saveReport'
  #  	from nexpose_scan_pdf.rb:110

  #Logout of Nexpose
  nsc.logout

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.metasploit.com/pipermail/nexpose-users/attachments/20100616/4e45a055/attachment.html>


More information about the nexpose-users mailing list