Stash pull-request failing
I had stash pull-request configured and working fine but it suddenly stopped working. Here is the error I get: error: undefined method `+' for nil:NilClass. Use --trace to view backtrace
I think it may be use to a recent stash upgrade. We r currently at v2.12.3
Comments (9)
-
Account Deactivated -
reporter ruby version - 1.9.3p448 (2013-06-27) [i386-mingw32]
C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:1405:in
addr_port': undefined method
+' for nil:NilClass (NoMethodError) from C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:1340:inbegin_transport' from C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:1316:in
transport_request' from C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:1294:inrequest' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/lib/atlassian/stash/pull_request.rb:80:in
block in create_pull_request' from C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:746:instart' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/lib/atlassian/stash/pull_request.rb:80:in
create_pull_request' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/bin/stash:84:inblock (3 levels) in <top (required)>' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/lib/atlassian/stash/git.rb:25:in
ensure_within_git!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/bin/stash:82:inblock (2 levels) in <top (required)>' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:180:in
call' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:180:incall' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:155:in
run' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/runner.rb:422:inrun_active_command' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/runner.rb:82:in
run!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/delegates.rb:12:inrun!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/import.rb:10:in
block in <top (required)>' -
reporter When doing stash configure, what should be the value of Stash URL? Should it be just the name of the server without http/https (e.g. git.myorg.com)?
-
Account Deactivated The server value should be the fully qualified server name (including the scheme and port if required).
Can you please reformat your comment with proper markdown syntax as in it's current form it is impossible to read the stack :). Thanks!
-
reporter Sorry about that. Here you go:
C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:1405:in `addr_port': undefined method `+' for nil:NilClass (NoMethodError) from C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:1340:in `begin_transport' from C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request' from C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:1294:in `request' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/lib/atlassian/stash/pull_request.rb:80:in `block in create_pull_request' from C:/opscode/chef/embedded/lib/ruby/1.9.1/net/http.rb:746:in `start' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/lib/atlassian/stash/pull_request.rb:80:in `create_pull_request' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/bin/stash:84:in `block (3 levels) in <top (required)>' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/lib/atlassian/stash/git.rb:25:in `ensure_within_git!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/bin/stash:82:in `block (2 levels) in <top (required)>' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:180:in `call' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:180:in `call' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:155:in `run' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/runner.rb:422:in `run_active_command' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/runner.rb:82:in `run!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/delegates.rb:12:in `run!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/import.rb:10:in `block in <top (required)>'
-
Account Deactivated I think you need to set the scheme on the server. Can you please check if this fixes your problem? If so, I think I can also put smarter logic into the lib.
-
reporter What do u mean by scheme - http/https? When I include https, i get SSL cert error. I changed it to http and get the below error:
C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/json-1.7.7/lib/json/common.rb:155:in `initialize': A JSON text must at least contain two octets! (JSON::ParserError) from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/json-1.7.7/lib/json/common.rb:155:in `new' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/json-1.7.7/lib/json/common.rb:155:in `parse' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/lib/atlassian/stash/pull_request.rb:83:in `create_pull_request' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/bin/stash:84:in `block (3 levels) in <top (required)>' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/lib/atlassian/stash/git.rb:25:in `ensure_within_git!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/atlassian-stash-0.2.0/bin/stash:82:in `block (2 levels) in <top (required)>' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:180:in `call' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:180:in `call' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/command.rb:155:in `run' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/runner.rb:422:in `run_active_command' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/runner.rb:82:in `run!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/delegates.rb:12:in `run!' from C:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/commander-4.1.6/lib/commander/import.rb:10:in `block in <top (required)>'
-
Account Deactivated Yes, the scheme is http or https. You should only set https if your stash server is hosted behind https. If you have stash hosted with a self signed certificate then please set
ssl_no_verify: true
in your config file.The error you are seeing is because no JSON content is being returned from the server which indicates that you have a malformed config (probably the https note just above).
-
Account Deactivated - changed status to invalid
Closing due to inactivity
- Log in to comment
Can you post the trace please.
Which version of Ruby are you using.