5-1-stable : Error 500 on read MR
Closed
5-1-stable : Error 500 on read MR
Created by: Isammoc
Since 5.1, a 500 error occurs when :
- Dev pushes branch
my_branch
- Dev creates a MR
my_branch
->master
- Dev pushes additional commits on
my_branch
production.log :
Started GET "/test_project/merge_requests/329" for at 2013-05-02 15:08:01 +0200
Processing by MergeRequestsController#show as HTML
Parameters: {"project_id"=>"test_project", "id"=>"329"}
Completed 500 Internal Server Error in 69ms
NoMethodError (undefined method `id' for nil:NilClass):
app/models/commit.rb:24:in `id'
lib/gitlab/git/commit.rb:107:in `init_from_grit'
lib/gitlab/git/commit.rb:21:in `initialize'
app/models/merge_request.rb:213:in `new'
app/models/merge_request.rb:213:in `block in load_commits'
app/models/merge_request.rb:213:in `map'
app/models/merge_request.rb:213:in `load_commits'
app/models/merge_request.rb:145:in `commits'
app/controllers/merge_requests_controller.rb:140:in `define_show_vars'
Created by: Isammoc
- Updating git to 1.7.10 as suggested in #3712 by @untergeek did not solve this problem
- Reverting b1a8fdd8 as @Deradon suggests did not solve this problem
By Administrator on 2013-05-02T13:49:53 (imported from GitLab project)
Created by: dprandzioch
Same problem here. Running Debian Wheezy and GitLab 5.2.
Production.log says:
ActionView::Template::Error (undefined method
id' for nil:NilClass): 18: - if merge_request.notes.any? 19: %span 20: %i.icon-comments 21: = merge_request.mr_and_commit_notes.count 22: - if merge_request.milestone_id? 23: %span 24: %i.icon-time app/models/commit.rb:24:in
id' app/models/merge_request.rb:213:innew' app/models/merge_request.rb:213:in
block in load_commits' app/models/merge_request.rb:213:inmap' app/models/merge_request.rb:213:in
load_commits' app/models/merge_request.rb:145:incommits' app/models/merge_request.rb:184:in
mr_and_commit_notes' app/views/merge_requests/_merge_request.html.haml:21:in_app_views_merge_requests__merge_request_html_haml__3298355313165456673_26656860' app/views/merge_requests/index.html.haml:24:in
_app_views_merge_requests_index_html_haml__3425671760504868750_58840700@Isammoc Your workaround seems to work for us, too - for the moment.
By Administrator on 2013-05-27T06:50:38 (imported from GitLab project)
Created by: Isammoc
reproduced in 5.2.0 02a7b127
By Administrator on 2013-06-10T10:18:48 (imported from GitLab project)
Created by: bbodenmiller
Thanks for the issue report. Please reformat your issue to conform to the issue tracker guidelines found in our contributing guidelines.
By Administrator on 2013-06-15T22:02:56 (imported from GitLab project)
Created by: vovin
I'm experiencing same error (version 5.3). It's intermittent. /edit workaround works for me too, but I've searched further. I'm not a ruby guy, but perhaps someone here will be able to figure out from this:
Error is caused by a single merge_request row in DB. It's easy to nail down the erroneous merge_request by trying to view merge requests directly. One that fails to show on the web is the one we're looking for.
So I found actual row that was causing issue, and made copy before /edit workaround.
I dumped it with
select st_commits from merge_requests where id=7
here is the output from failing merge request:
---\ - !ruby/object:Commit\ commit: !ruby/object:Grit::Commit\ repo: &60031280 !ruby/object:Grit::Repo\ path: /home/git/repositories/sandbox.git\ bare: true\ git: !ruby/object:Grit::Git\ git_dir: /home/git/repositories/sandbox.git\ work_tree: /home/git/repositories/sandbox.git\ bytes_read: 0\ id: !binary |-\ MjFiMzM5OTY2MThiNTAxMzdhNzUxMmFkYjgwN2YzNTI1MDMwNDAwZA==\ parents:\ - !ruby/object:Grit::Commit\ repo: *60031280\ id: !binary |-\ MWQwMDJiMGY2ZmY4NTI2ZGI5NWRkNjE5NzRhNTY0ZGJjODYxNTAzMQ==\ tree: !ruby/object:Grit::Tree\ repo: *60031280\ id: !binary |-\ ZjAyMmYyOWFmMzA0Mzc4ZjRlZjE3MjUzMzVkZGQ0ZTY2ZGExYmM3YQ==\ author: !ruby/object:Grit::Actor\ ...[cut rest for clarity]...
Then I corrected it with /edit workaround, and dumped same row again:
---\ - :id: !binary |-\ MjFiMzM5OTY2MThiNTAxMzdhNzUxMmFkYjgwN2YzNTI1MDMwNDAwZA==\ :message: another change after mr opened\ :parent_ids:\ - !binary |-\ MWQwMDJiMGY2ZmY4NTI2ZGI5NWRkNjE5NzRhNTY0ZGJjODYxNTAzMQ==\ :authored_date: 2013-07-16 06:59:09.000000000 +00:00\ :author_name: Pawel Rogozinski\ :author_email: fake.mail@example.com\ :committed_date: 2013-07-16 07:15:43.000000000 +00:00\ :committer_name: Pawel Rogozinski\ :committer_email: fake.mail@example.com\ - :id: !binary |-\ MWQwMDJiMGY2ZmY4NTI2ZGI5NWRkNjE5NzRhNTY0ZGJjODYxNTAzMQ==\ :message: added second line as the first one, to see if code comments will survive\ :parent_ids:\ - !binary |-\ OWNkMWRkYzkyOGI2MTNjODY1MmJkY2U3YjNkNTc1NmI0ZTA5ODllZQ==\ :authored_date: 2013-07-15 18:54:40.000000000 +00:00\ :author_name: Pawel Rogozinski\ :author_email: fake.mail@example.com\ :committed_date: 2013-07-16 07:14:15.000000000 +00:00\ :committer_name: Pawel Rogozinski\ :committer_email: fake.mail@example.com\ - :id: !binary |-\ OWNkMWRkYzkyOGI2MTNjODY1MmJkY2U3YjNkNTc1NmI0ZTA5ODllZQ==\ :message: hello world in c\ :parent_ids:\ - !binary |-\ NTlmYzMyN2M0Mzg5NTVlYjcwM2FiNjU0MjhmMzYwYWFjZGRkYmU5Ng==\ :authored_date: 2013-07-15 17:48:42.000000000 +00:00\ :author_name: Pawel Rogozinski\ :author_email: fake.mail@example.com\ :committed_date: 2013-07-16 07:14:15.000000000 +00:00\ :committer_name: Pawel Rogozinski\ :committer_email: fake.mail@example.com\
Seems to me like different serialization. Where do I fix this? Is this incorrect hook or something?
By Administrator on 2013-07-16T15:39:25 (imported from GitLab project)
Created by: kalleth
I have reproduced this error too, on 5-4-stable (upgrading from a 4.2 install, so the serialised commit data is still in the above format). I've checked and st_commits is definitely in the old format as explained by @vovin above.
By Administrator on 2013-08-19T12:43:14 (imported from GitLab project)
Created by: bladealslayer
Here's a snippet of code that can fix old merge requests: https://gist.github.com/bladealslayer/6448104
The official migration rake task, seems to loose the commits and diffs from merge requests that were closed.
By Administrator on 2013-09-05T09:52:22 (imported from GitLab project)
Created by: yaoyansi
When a 500 error happens, we add /edit to the end of the URL, and we can save again the MR which is not in error anymore (until the next change).
I'm sorry but what it means when you say "add /edit to the end of the URL"?
For example, I created a merge request at page "http://192.168.1.120/mefalo/solar-osl/merge_requests". After I press "submit merge request" button, the page jumps to a new page(http://192.168.1.120/mefalo/solar-osl/merge_requests) which complains Error500, If I add "/edit" to "http://192.168.1.120/mefalo/solar-osl/merge_requests/edit", that is "http://192.168.1.120/mefalo/solar-osl/merge_requests/edit", and press Enter key. It complains Error"404. The page you were looking for doesn't exist."
By Administrator on 2013-10-25T05:33:11 (imported from GitLab project)
Created by: jvanbaarsen
It's been at least 2 weeks (and a new release) since we heard from you. I'm closing this issue but if you still experience this problem, please open a new issue (but also reference the old issue(s)). Make sure to also include the necessary debugging information conforming to the issue tracker guidelines found in our contributing guidelines. /cc @Razer6
By Administrator on 2014-01-09T16:41:15 (imported from GitLab project)