gitlabhq / grit

Grit gives you object oriented read/write access to Git repositories via Ruby. Patched for GitLab
gitlab.org
MIT License
59 stars 55 forks source link

Grit::GitRuby::Internal::PackFormatError (has discontinuous index 1) #16

Open mjaros opened 11 years ago

mjaros commented 11 years ago

I recently started getting this error:

Started GET "/vesseltracker/vtr_weather" for 127.0.0.1 at 2013-03-17 13:53:09 +0100
Processing by ProjectsController#show as HTML
Parameters: {"id"=>"vesseltracker/vtr_weather"}
Completed 500 Internal Server Error in 26ms
Grit::GitRuby::Internal::PackFormatError (pack /home/git/repositories/vesseltracker/vtr_weather.git/objects/pack/pack-0f0743045e023e6d59ef55b70fca377494498cca.pack has discontinuous index 1):
app/models/commit.rb:22:in `find_or_first'
app/models/repository.rb:38:in `commit'
app/models/repository.rb:101:in `has_commits?'
app/models/repository.rb:107:in `empty?'
app/controllers/projects_controller.rb:60:in `block (2 levels) in show'
app/controllers/projects_controller.rb:58:in `show'

On the upstream they are having the same issue but it seems like someone solved it: https://github.com/mojombo/grit/issues/117

zealot128 commented 11 years ago

same here, using Ruby 2.0.0-p0

mjaros commented 11 years ago

I have fixed this for now by using Ruby 1.9.3. It looks like the problem is that Ruby 2.0.0 handles everything as utf-8 by default.

falk commented 11 years ago

Also happens with 1.9.3. Fixed it by changing the grit gem to gem 'grit', :git => 'git://github.com/styx/grit.git' in Gemfile in gitlab.

sameera207 commented 11 years ago

I had the same issue with ruby 2.0.0p0 (2013-02-24 revision 39474) [i686-linux]

and seems like its a grit gem issue with ruby 2.0, but above, @falk s solution worked for me (https://github.com/gitlabhq/grit/issues/16#issuecomment-15300341)