Skip to content

Instantly share code, notes, and snippets.

@jordansissel
Created February 2, 2012 00:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jordansissel/1720432 to your computer and use it in GitHub Desktop.
Save jordansissel/1720432 to your computer and use it in GitHub Desktop.
% gem install logstash
ERROR: Error installing logstash:
invalid gem format for /home/jls/.rvm/gems/ruby-1.9.3-p0/cache/logstash-1.1.0.gem
% rm /home/jls/.rvm/gems/ruby-1.9.3-p0/cache/logstash-1.1.0.gem
% gem install logstash
Fetching: logstash-1.1.0.gem (100%)
ERROR: Error installing logstash:
invalid gem format for /home/jls/.rvm/gems/ruby-1.9.3-p0/cache/logstash-1.1.0.gem
@qrush
Copy link

qrush commented Feb 2, 2012

Cmon now, let's be reasonable. Sounds like there was an error with how the gem was packaged. Can you unpack your original on your own machine? Hey @drbrain or @zenspider any ideas?

[/tmp] md5 logstash-1.1.0.gem 
MD5 (logstash-1.1.0.gem) = d6ffa39f6cb366039c1d906bb13e8061

[/tmp] gem unpack logstash-1.1.0.gem --debug
Exception `NameError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::UnpackCommand
Exception `OptionParser::InvalidOption' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/optparse.rb:1542 - invalid option: no-ri
Exception `OptionParser::InvalidOption' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/optparse.rb:1356 - invalid option: --no-ri
Exception `OptionParser::InvalidOption' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/optparse.rb:1542 - invalid option: no-rdoc
Exception `OptionParser::InvalidOption' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/optparse.rb:1356 - invalid option: --no-rdoc
Exception `Errno::EEXIST' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:247 - File exists - /private/tmp/logstash-1.1.0
Exception `NoMethodError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/package/tar_input.rb:57 - undefined method `readpartial' for #<Gem::Package::TarReader::Entry:0x007fe51915f300>
Exception `NoMethodError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/specification.rb:574 - undefined method `readpartial' for #<Gem::Package::TarReader::Entry:0x007fe51915f300>
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:77 - invalid value for Float(): "1.1.0"
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:83 - invalid value for Integer(): ">="
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:83 - invalid value for Integer(): "="
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:77 - invalid value for Float(): "0.1.3"
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:77 - invalid value for Float(): "0.3.0"
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:77 - invalid value for Float(): "0.2.0"
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:77 - invalid value for Float(): "0.9.0"
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:77 - invalid value for Float(): "0.0.11"
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/psych-1.2.2/lib/psych/scalar_scanner.rb:77 - invalid value for Float(): "1.8.9"
Exception `ArgumentError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/package/tar_reader/entry.rb:67 - string contains null byte
Exception `Gem::Package::TarInvalidError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/package/tar_reader/entry.rb:73 - tar is corrupt, name contains null byte
Exception `IOError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/format.rb:45 - closed stream
Exception `Gem::Package::FormatError' at /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/format.rb:50 - corrupt gem (Gem::Package::TarInvalidError: tar is corrupt, name contains null byte) in logstash-1.1.0.gem
ERROR:  While executing gem ... (Gem::Package::FormatError)
    corrupt gem (Gem::Package::TarInvalidError: tar is corrupt, name contains null byte) in logstash-1.1.0.gem
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/format.rb:50:in `rescue in from_file_by_path'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/format.rb:44:in `from_file_by_path'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/installer.rb:249:in `unpack'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/commands/unpack_command.rb:73:in `block in execute'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/commands/unpack_command.rb:47:in `each'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/commands/unpack_command.rb:47:in `execute'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/command.rb:278:in `invoke'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/command_manager.rb:147:in `process_args'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/command_manager.rb:117:in `run'
    /Users/qrush/.rbenv/versions/1.9.3-p0/lib/ruby/1.9.1/rubygems/gem_runner.rb:65:in `run'
    /Users/qrush/.rbenv/versions/1.9.3-p0/bin/gem:21:in `<main>'

@lusis
Copy link

lusis commented Feb 2, 2012

@jordansissel was the gem packaged with JRuby? (Part of our makefile stuff?)

@jordansissel
Copy link
Author

I'll indulge your desire to debug this right now, but I do think I'm done with rubygems. This past year has been a constant source of problems with rubygems that I don't have the energy or patience to suffer.

Anyway, I'll upload the original gem somewhere, too.

@jordansissel
Copy link
Author

Pretty sure this is the original:

carrera(~/projects/logstash) % md5sum logstash-1.1.0.gem
d6ffa39f6cb366039c1d906bb13e8061  logstash-1.1.0.gem

carrera(~/projects/logstash) % gem unpack ./logstash-1.1.0.gem
ERROR:  While executing gem ... (Gem::Package::FormatError)
    corrupt gem (Gem::Package::TarInvalidError: tar is corrupt, name contains null byte) in ./logstash-1.1.0.gem

@qrush
Copy link

qrush commented Feb 2, 2012

Quite curious if this is a JRuby bug. At least I this verifies that rubygems.org/CloudFront didn't mangle the gem.

@jordansissel
Copy link
Author

Unpacking the data.tar.gz:

% tar -ztf data.tar.gz
lib/logstash/util/buftok.rb
lib/logstash/certs/cacert.pem
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

Rebuilding it with 'gem build blah.gemspec' produces a working gem.

@jordansissel
Copy link
Author

I don't remember what ruby was used to build the gem, for what it's worth.

@jordansissel
Copy link
Author

rather, above, rebuilding I tried with ruby 1.9.3-p0

@jordansissel
Copy link
Author

mass yank of logstash complete: https://gist.github.com/1720739

@qrush
Copy link

qrush commented Feb 2, 2012

This seems like an overreaction that will do nothing but disservice your users, especially with 17,000+ downloads. Not saying it's not your choice to pull the gem, but it just feels to me like there's some other problem at work here.

I wish I could help more, sorry dude.

@jordansissel
Copy link
Author

I literally don't have the energy to deal with rubygems problems anymore. I greatly respect and appreciate the folks involved and the problems being solved, but I can't deal with the frequent problems anymore.

I appreciate your efforts in debugging this, but I don't think there's anything left for me to do here. Using rubygems is a disservice to logstash users with the rubygems problems. New users will equate 'gem install' problems to poor release quality, and that hurts logstash.

Honestly, I should've introduced myself to the rubygems ticket system and community before I got burned out dealing with rubygems problems.

Thanks for your efforts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment