rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.89k stars 2k forks source link

error "tar_input.rb:49:in `initialize': not in gzip format (Zlib::GzipFile::Error)" when deploying to Heroku #404

Closed Florent2 closed 14 years ago

Florent2 commented 14 years ago

When deploying my Rails3beta4 application (using Bundler 0.9.26) to heroku, I got the following error. I do not have this error when doing a local "bundle install" which works fine. Heroku support told me to fill a bug here. Here is the error and the Gemfile:

\ the error **

$ git push heroku Counting objects: 206, done. [...] -----> Heroku receiving push -----> Rails app detected -----> Detected Rails is not set to serve static_assets Installing rails3_serve_static_assets... done -----> Gemfile detected, running Bundler Unresolved dependencies detected; Installing... Fetching source index from http://rubygems.org/ Using rake (0.8.7) from system gems [...] Installing twitter (0.9.0) from rubygems repository at http://rubygems.org/ Your bundle is complete! Use bundle show [gemname] to see where a bundled gem is installed. Locking environment /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in initialize': not in gzip format (Zlib::GzipFile::Error) from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:innew' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in initialize' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:63:ineach' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in loop' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:ineach' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:32:in initialize' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:17:innew' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:17:in open' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package.rb:55:inopen' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/format.rb:63:in from_io' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/format.rb:51:infrom_file_by_path' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/format.rb:50:in open' from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/format.rb:50:infrom_file_by_path' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/source.rb:149:in specs' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/source.rb:148:ineach' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/source.rb:148:in specs' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/index.rb:43:infrom_cached_specs' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/index.rb:39:in system_cached_gems' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/index.rb:27:incached_gems' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/index.rb:5:in build' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/index.rb:25:incached_gems' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/environment.rb:15:in index' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/index.rb:5:inbuild' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/environment.rb:13:in index' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/environment.rb:59:inresolve_locally' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/environment.rb:28:in specs' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:129:indetails' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:118:in write_yml_lock' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/runtime.rb:65:inlock' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/cli.rb:115:in lock' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/task.rb:33:insend' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/task.rb:33:in run' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:109:ininvoke' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:116:in call' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/invocation.rb:116:ininvoke' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor.rb:137:in start' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor/base.rb:378:instart' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/lib/bundler/vendor/thor.rb:124:in start' from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-0.9.26/bin/bundle:13 from /usr/ruby1.8.7/bin/bundle:19:inload' from /usr/ruby1.8.7/bin/bundle:19 FAILED: Could not lock dependencies. Have you updated to use a 0.9 Gemfile? http://docs.heroku.com/gems#gem-bundler

error: hooks/pre-receive exited with error code 1 To git@heroku.com:myapp.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'git@heroku.com:myapp.git'

\ the gemfile **

source 'http://rubygems.org'

gem 'rails', '3.0.0.beta4'

gem 'mongoid', '2.0.0.beta7' gem 'haml' gem 'compass' gem 'twitter' gem 'paperclip' gem 'bson_ext' gem 'chargify' gem 'rails3-generators' gem 'devise', '1.1.rc2' gem 'fbgraph'

gem 'machinist', :group => [:development, :test] gem 'machinist_mongo', :require => 'machinist/mongoid', :group => [:development, :test] gem 'faker', :group => [:development, :test]

group :test do gem 'rspec-rails', '>= 2.0.0.beta.10' gem 'mongoid-rspec' end

group :cucumber do gem "rspec" gem "rspec-rails" gem "cucumber" gem "cucumber-rails" gem "launchy" gem "capybara" gem "database_cleaner"

gem 'email_spec', :require => "email_spec", :git => "git://github.com/bmabey/email-spec.git", :branch => "rails3"

end

Florent2 commented 14 years ago

Finally I could "fix" the problem by deleting my Heroku and recreate app. With the new created app, I did not face the problem.

indirect commented 14 years ago

Great, thanks for reporting back your solution. Sounds like you just had bad luck the first time, and wound up with a corrupted gem.

m3talsmith commented 14 years ago

I bumped in to the same problem using rails 2.3.5 and the Bamboo REE 1.8.7 stack. I even destroyed and recreated the app as suggested above and still got the error. I would call this an ongoing problem to look out for; at least for a little bit.

m3talsmith commented 14 years ago

Hmm. Apparently it was because I was using the factory girl gem from github. Moved to using the gemcutter version (like I'm supposed to be doing) and everything works fine.

It would be nice to have a message that actually pointed us in the right direction from bundler. Thanks!

indirect commented 14 years ago

I would be fascinated to know how we can tell that an error from Zlib means you should change your Factory_girl source :\

m3talsmith commented 14 years ago

Fascinated ehh? Well all you have to do is dig around to find out that the zlib error comes from not being able to connect to the resource. It's a failed connection. It doesn't matter if it's factory girl or some other gem; if it doesn't connect it's not failing gracefully. That's an issue.

But enough bickering. I'll just fork this and fix it myself. I just thought you may be more interested in this than you are I guess.

indirect commented 14 years ago

Sorry that came across as sarcastic. I really do want to fix this, I just didn't understand the actual problem based on your description. This ticket was originally about (afaict) a genuinely corrupted gem, so changing sources didn't make sense to me as a solution.

Since you're seeing a different Zlib error, I'd love a direct repro writeup or a patch. Thanks for the report, we really do appreciate them, honest.

m3talsmith commented 14 years ago

Hi indirect. Thank you for the note. I did fork this and am writing tests to reproduce and fix this issue. I will let you know as soon as I fix it :)