ericpaulbishop/redmine_git_hosting — Issue #142: Inserting large changeset in the cache breaks Repository view
Author: Lncn
Created: 2012-01-21 21:32:02+00:00
State: open

This may or may not be the exact cause, but I don't have much experience with the internals of this plugin or Redmine (Or Ruby/Rails to be honest). Here is a little background, as my setup may have something to do with the problem:

I am running Redmine (1.3) on an internal network in my office and I wanted to create a project for users to post issues on bugs and feature requests for Redmine itself so we can track any changes we make to the server.

I basically wanted to keep the production/test code under git control on the server and I will simply 'git push' from the served directory to the git repository where Gitolite stores the repos. This basically acts as a working backup and allows us to visually track our Redmine setup's changesets within Redmine repository browser.

I set this up today and was apparently wrong is how easy I thought this would be. Here is what I did:

1) Created "Redmine" project within Redmine
2) On the server's Redmine directory, /var/www/redmine/, I did a `git init` to initialize the repo and `git add .` to add all files under redmine. I committed this to the local repo as the Initial commit
3) Now, I wanted to have the redmine code show up on the project's repository tab, so I did a `git push` and got no complaints from the git or the gitolite server

Now, when I check the repository tab in our Redmine project, I get a 404 error. I did a little snooping and noticed that the production.log said that the MySQL INSERT into the changeset cache was failing. (Also, I noticed the log jumps ~30MB each time I do this):

Processing RepositoriesController#show (for 10.0.13.126 at 2012-01-21 12:18:20)
Parameters: {"action"=>"show", "id"=>"tmsmine", "controller"=>"repositories"}
Fethcing changes for /tmp/redmine_git_hosting/gitolite-admin
Creating MD5 digests for Redmine Git Hosting hook
Digest for post-receive.redmine_gitolite.rb: 08e9b3cf99fa6285331ccdcef8b9a0d3
Our hook is already installed

ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone away: INSERT
lib/redmine/scm/adapters/git_adapter.rb:301:in `diff'
app/models/repository.rb:144:in `diff'
vendor/plugins/redmine_diff_email/app/models/diff_mailer.rb:11:in `diff_notifi
app/models/repository/git.rb:180:in `save_revision'
app/models/repository/git.rb:156:in `fetch_changesets'
app/models/repository/git.rb:154:in `fetch_changesets'
lib/redmine/scm/adapters/git_adapter.rb:279:in `revisions'
lib/redmine/scm/adapters/git_adapter.rb:203:in `revisions'
app/models/repository/git.rb:152:in `fetch_changesets'
app/models/repository/git.rb:147:in `each'
app/models/repository/git.rb:147:in `fetch_changesets'
app/controllers/repositories_controller.rb:92:in `show_without_git_instruction
passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `proces
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `a
passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `m
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:
passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_mai
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_sync
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `
passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_applic
passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_mai
passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_sync
passenger (3.0.11) helper-scripts/passenger-spawn-server:99

As you can obviously see, these lines aren't complete. The rest of the '''ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone away: INSERT''' line is something like 30MB long!! It's the command_output response to the `git show`. Obviously, this show command's diff is VERY large, since I added all files in a single commit, so this could be the problem...

I'm assuming either I don't have something set up correctly to accept such a large response in the MySQL table, or I'm hitting a timeout or something. Anyone have any clue on what I could do to fix this or if this is actually a bug?