Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Upload gem failure on open_ssl #61

Open
sheehacm opened this issue Mar 17, 2016 · 6 comments
Open

Upload gem failure on open_ssl #61

sheehacm opened this issue Mar 17, 2016 · 6 comments

Comments

@sheehacm
Copy link

I have been working on automating the upload of a custom gem to nexus. In order to do so I have created a rake tasks which builds the gem and then runs the command 'gem nexus test-gem-1.0.0'. The task creates the credentials file and stores the url and the authorization within this file the same way the gem would.

When I try running 'gem nexus test-gem-1.0.0' I receive the following error:

Exception LoadError' at /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55 - cannot load such file -- rubygems/commands/nexus_command ExceptionLoadError' at /opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:132 - cannot load such file -- rubygems/commands/nexus_command
Uploading gem to Nexus...
PUT https://test-test.com/nexus/content/repositories/hostedgems/gems/test-0.1.64.gem
use authorization
Exception `OpenSSL::SSL::SSLErrorWaitReadable' at /opt/chefdk/embedded/lib/ruby/2.1.0/openssl/buffering.rb:182 - read would block
something went wrong

Any idea what could be causing this?

@mkristian
Copy link
Contributor

is it possible to try without ssl, i.e. with http://test-test.com/ ? just to make sure it is a SSL problem.

@sheehacm
Copy link
Author

There is not a way for me to do this. I am assuming this has to related to the way I created the credential file and stored the information. This was done in a rake task.
`if File.exist?('/var/lib/jenkins/.gem/nexus')
puts "credentials file already exists"
else
credentials = File.new('/var/lib/jenkins/.gem/nexus', "w+")
credentials.close
end

token = "#{username}:#{password}"
auth = "Basic #{Base64.encode64(token).gsub(/\s+/, '')}"
@ALL = {
:url => url,
:authorization => auth
}

File.open('/var/lib/jenkins/.gem/nexus', 'w') {|f| f.write @all.to_yaml}
File.chmod(0100600, '/var/lib/jenkins/.gem/nexus') rescue nil
system "gem nexus test-gem-1.0.0.gem"`

@mkristian
Copy link
Contributor

the ~/.gem/nexus files looks OK

something went wrong is an error on the nexus server, something like the gem file-name 'test-gem-1.0.0.gem' does not match what the specification of the gem would produce. did you build the gem with gem build test-gem.gemspec ?

looking at the server logs can reveal something

@sheehacm
Copy link
Author

after looking at the logs I noticed that the jvm is out of heap space. After clearing this up it should work. Thanks for the help!

@sheehacm
Copy link
Author

I'm not exactly sure how the credentials should be handled. Right now I have created the ~/.gem/nexus file myself and provide the credentials. I am doing this in order to skip the step of being asked for the information. I am unsure if the gem will except these in the way they are provided. Is there anything I am missing from the script I provided above?

@mkristian
Copy link
Contributor

something went wrong should produce a server side log entry. no the script looks good from here

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

No branches or pull requests

2 participants