Closed HIMANSHU-ELIGIBLE closed 7 years ago
Hi Himanshu
This problem was resolved in ruby-jss version 0.9.2. Please update your copy of the gem. If you installed it with rubygems, you can update it with gem update ruby-jss
.
Feel free to reach out again if you still have problems. Cheers! -Chris
Thanks for response @glenfarclas17
I updated the version but still not able to connect. Keep getting error "Connection reset by peer"
read_nonblock' from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/protocol.rb:153:in
rbuf_fill'
from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/protocol.rb:134:in readuntil' from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/protocol.rb:144:in
readline'
from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http/response.rb:39:in read_status_line' from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http/response.rb:28:in
read_new'
from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1414:in block in transport_request' from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1411:in
catch'
from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1411:in transport_request' from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:1384:in
request'
from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/rest-client-1.8.0/lib/restclient/request.rb:270:in net_http_do_request' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/rest-client-1.8.0/lib/restclient/request.rb:418:in
block in transmit'
from /Users/Himanshu/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:853:in start' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/rest-client-1.8.0/lib/restclient/request.rb:413:in
transmit'
from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/rest-client-1.8.0/lib/restclient/request.rb:176:in execute' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/rest-client-1.8.0/lib/restclient/request.rb:41:in
execute'
from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/rest-client-1.8.0/lib/restclient/resource.rb:51:in get' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/ruby-jss-0.9.2/lib/jss/api_connection.rb:383:in
get_rsrc'
from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/ruby-jss-0.9.2/lib/jss/api_connection.rb:599:in verify_server_version' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/ruby-jss-0.9.2/lib/jss/api_connection.rb:315:in
connect'
from (irb):2
from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands/console.rb:110:in start' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands/console.rb:9:in
start'
from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:68:in console' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in
run_command!'
from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in <top (required)>' from bin/rails:4:in
require'Thanks Himanshu
Ahh - I think you've hit another bug, which was introduced more recently, for which the fix is coming, but not there yet. If you connect on port 443 (rather than the JSS default 8443) ruby-jss doesn't assume SSL is needed. Try adding use_ssl: true
to your API connection parameters.
I"ll be making ruby-jss assume SSL on port 443 in the next release. Sorry bout that! -Chris
Actually I just pushed that fix as a pre-release v0.10.0a1, and its in rubygems.org too. You're welcome to try it out, but beware: there are a lot of other APIConnection changes in that release that need more testing before I call it good.
JSS API connection has started failing since last 2 days for me. Talked to jamf support regarding it and they said they have updated servers over weekend when we started seeing this issue. Pasting the error below -
2.2.3 :001 > require 'ruby-jss' => false 2.2.3 :002 > JSS::API.connect(user: "himanshu", pw: :prompt, server: 'eligible.jamfcloud.com', port:443) Enter the password for JSS user himanshu@eligible.jamfcloud.com: JSS::UnsupportedError: Your JSS Server version, 9.100.0-t1499435238, is to low. Must be 9.4 or higher. from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/ruby-jss-0.7.0/lib/jss/api_connection.rb:231:in'
connect' from (irb):2 from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands/console.rb:110:in
start' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands/console.rb:9:instart' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:68:in
console' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:inrun_command!' from /Users/Himanshu/.rvm/gems/ruby-2.2.3/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in
<top (required)>' from bin/rails:4:inrequire' from bin/rails:4:in
Also jamf support confirmed that "9.100.0-t1499435238" is latest version while 9.4 is old one.
Thanks Himanshu