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

Past Scans Throwing n API Error #222

Closed
TheCaucasianAsian opened this issue Apr 29, 2016 · 3 comments
Closed

Past Scans Throwing n API Error #222

TheCaucasianAsian opened this issue Apr 29, 2016 · 3 comments

Comments

@TheCaucasianAsian
Copy link

Here is my code:
scans = nsc.past_scans
scans.each do |scan|
puts "Site ID: " << scan.site_id.to_s
puts "Start Time" << scan.start_time.to_s
puts "*************************************"
end

I dug into the error:
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nexpose-3.3.1/lib/nexpose/a
jax.rb:170:in request': NexposeAPI: GET request to /ajax/user_pref_set.txml?nam e=global-completed-scans.rows&value= failed. request body: (Nexpose::APIError) from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nexpose-3.3.1/ lib/nexpose/ajax.rb:34:inget'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nexpose-3.3.1/
lib/nexpose/ajax.rb:267:in set_rows' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nexpose-3.3.1/ lib/nexpose/ajax.rb:225:inensure in preserving_preference'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nexpose-3.3.1/
lib/nexpose/ajax.rb:225:in preserving_preference' from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/nexpose-3.3.1/ lib/nexpose/scan.rb:374:inpast_scans'
from connect2.rb:398:in `

'

By adding code into Ajax.rb, here is the-
request: #Net::HTTP::Get:0x2b51b00
and the response: #Net::HTTPInternalServerError:0x27cf468
I haven't checked if I can call the old xml api with fiddler yet, but I might once I commit to waking up.

Thanks for all your help!
-Bryan

@sgreen-r7
Copy link
Contributor

#221

Hi Bryan @TheCaucasianAsian - we're merging this PR today which should fix your issue. Thank you for digging into the error though!

@sgreen-r7
Copy link
Contributor

@TheCaucasianAsian version 3.3.2 of the gem has been released and your issue should be fixed.

@TheCaucasianAsian
Copy link
Author

You guys are awesome!! Thank you for getting on top of these so quickly!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants