Error 500 when creating merge requests
When we try to create merge requests for a project, error 500 is thrown. We are running GitLab 8.2.2 omnibus package on Debian 7.
The issue is also visible in production.log:
Completed 500 Internal Server Error in 9376ms (ActiveRecord: 38.5ms)
ActionView::Template::Error (undefined method `mime_type' for nil:NilClass):
11: %span.wrap
12: .frame.deleted
13: %a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(@commit.parent_id, diff.old_path))}
14: %img{src: "data:#{old_file.mime_type};base64,#{Base64.encode64(old_file.data)}"}
15: %p.image-info.hide
16: %span.meta-filesize= "#{number_to_human_size old_file.size}"
17: |
app/views/projects/diffs/_image.html.haml:14:in `_app_views_projects_diffs__image_html_haml___3277172520752332982_49665140'
app/views/projects/diffs/_file.html.haml:42:in `_app_views_projects_diffs__file_html_haml___4432573599310294193_49810020'
app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml__1535089848600712864_34883100'
app/views/projects/diffs/_diffs.html.haml:17:in `each'
app/views/projects/diffs/_diffs.html.haml:17:in `each_with_index'
app/views/projects/diffs/_diffs.html.haml:17:in `_app_views_projects_diffs__diffs_html_haml__1535089848600712864_34883100'
app/views/projects/merge_requests/_new_submit.html.haml:37:in `_app_views_projects_merge_requests__new_submit_html_haml___1332047566409503028_56668280'
app/views/projects/merge_requests/new.html.haml:5:in `_app_views_projects_merge_requests_new_html_haml___3144171230923591329_56894100'
Designs
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Author Contributor
After deleting line 14 from the haml-file, another error occured:
Completed 500 Internal Server Error in 8969ms (ActiveRecord: 48.4ms) ActionView::Template::Error (undefined method `size' for nil:NilClass): 12: .frame.deleted 13: %a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(@commit.parent_id, diff.old_path))} 14: %p.image-info.hide 15: %span.meta-filesize= "#{number_to_human_size old_file.size}" 16: | 17: %b W: 18: %span.meta-width app/views/projects/diffs/_image.html.haml:15:in `_app_views_projects_diffs__image_html_haml___3277172520752332982_49765560' app/views/projects/diffs/_file.html.haml:42:in `_app_views_projects_diffs__file_html_haml___4432573599310294193_49325980' app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml__1535089848600712864_18901860' app/views/projects/diffs/_diffs.html.haml:17:in `each' app/views/projects/diffs/_diffs.html.haml:17:in `each_with_index' app/views/projects/diffs/_diffs.html.haml:17:in `_app_views_projects_diffs__diffs_html_haml__1535089848600712864_18901860' app/views/projects/merge_requests/_new_submit.html.haml:37:in `_app_views_projects_merge_requests__new_submit_html_haml___1332047566409503028_55618580' app/views/projects/merge_requests/new.html.haml:5:in `_app_views_projects_merge_requests_new_html_haml___3144171230923591329_56153320'
So I deleted all calls to old_file from the haml-file, and the merge request was created successfully.
I just hit a near-identical situation, with the same kind of log messages.
Completed 500 Internal Server Error in 3429ms (ActiveRecord: 35.3ms) ActionView::Template::Error (undefined method `path' for nil:NilClass): 3: - if diff_file.diff.submodule? 4: %span 5: - submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path) 6: = submodule_link(submodule_item, @commit.id, project.repository) 7: - else 8: %span 9: - if diff_file.deleted_file app/helpers/submodule_helper.rb:6:in `submodule_links' app/helpers/diff_helper.rb:161:in `submodule_link' app/views/projects/diffs/_file.html.haml:6:in `_app_views_projects_diffs__file_html_haml___1399985636290125545_59936220' app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml__1133061831504487495_65685960' app/views/projects/diffs/_diffs.html.haml:17:in `each' app/views/projects/diffs/_diffs.html.haml:17:in `each_with_index' app/views/projects/diffs/_diffs.html.haml:17:in `_app_views_projects_diffs__diffs_html_haml__1133061831504487495_65685960' app/views/projects/merge_requests/_new_submit.html.haml:37:in `_app_views_projects_merge_requests__new_submit_html_haml__3510691546833590862_67493620' app/views/projects/merge_requests/new.html.haml:5:in `_app_views_projects_merge_requests_new_html_haml__3430188554032283092_67329840'
The to-be-merged commit was 1 line with a small change, nothing special. Looks like a piece of data isn't there and turns out to be nil which makes the rest of the template very unhappy.
In addition, creating a new merge request from the commit page causes this error 500, but creating the same MR from the Merge Requests page works fine.
Running 8.2.2 on Debian 8.
Edited by username-removed-232456- Author Contributor
I can't give access to the repository that exhibits the problem. I created a new repository today and added, changed and deleted some files. So far, I was unable to reproduce the issue with the new repository. I will add some commits later so that I'm hopefully able to reproduce the issue with the sample repository again.
Hi
We are getting the same error, when trying to create a MR after doing a rename of a git submodule:
git diff master | more diff --git a/.gitmodules b/.gitmodules index 41b1063..fc59540 100644 --- a/.gitmodules +++ b/.gitmodules @@ -142,6 +142,6 @@ [submodule "modules/tdch/crontabs"] path = modules/tdch/crontabs url = ../../puppetmodules/crontabs.git -[submodule "migrate2piggy"] - path = migrate2piggy +[submodule "modules/tdch/migrate2piggy"] + path = modules/tdch/migrate2piggy url = ../../puppetmodules/migrate2piggy.git diff --git a/migrate2piggy b/migrate2piggy deleted file mode 160000 index 287f3d8..0000000 --- a/migrate2piggy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 287f3d8aafc3a30a600e19b74d05f3cbcc4e4cc5 diff --git a/modules/tdch/migrate2piggy b/modules/tdch/migrate2piggy new file mode 160000 index 0000000..287f3d8 --- /dev/null +++ b/modules/tdch/migrate2piggy @@ -0,0 +1 @@ +Subproject commit 287f3d8aafc3a30a600e19b74d05f3cbcc4e4cc5
Completed 500 Internal Server Error in 265ms (ActiveRecord: 9.4ms) ActionView::Template::Error (undefined method `path' for nil:NilClass): 3: - if diff_file.diff.submodule? 4: %span 5: - submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path) 6: = submodule_link(submodule_item, @commit.id, project.repository) 7: - else 8: %span 9: - if diff_file.deleted_file app/helpers/submodule_helper.rb:6:in `submodule_links' app/helpers/diff_helper.rb:157:in `submodule_link' app/views/projects/diffs/_file.html.haml:6:in `_app_views_projects_diffs__file_html_haml___421237125414719728_60332420' app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml___2384134035172871938_104927820' app/views/projects/diffs/_diffs.html.haml:17:in `each' app/views/projects/diffs/_diffs.html.haml:17:in `each_with_index' app/views/projects/diffs/_diffs.html.haml:17:in `_app_views_projects_diffs__diffs_html_haml___2384134035172871938_104927820' app/views/projects/merge_requests/_new_submit.html.haml:37:in `_app_views_projects_merge_requests__new_submit_html_haml__2548131081126440588_108495040' app/views/projects/merge_requests/new.html.haml:5:in `_app_views_projects_merge_requests_new_html_haml__3532630288002028235_108584520'
I could theoretically give non-public access.
I am getting the same issue. It appears to be changes in submodule commits that is causing the issue.
Started GET "/FooTeam/FooProject/commit/76ed419adc0ee53198cec7b3b8a327ef560f3a7e" for 127.0.0.1 at 2015-12-15 12:00:48 +0000 Processing by Projects::CommitController#show as HTML Parameters: {"namespace_id"=>"FooTeam", "project_id"=>"FooProject", "id"=>"76ed419adc0ee53198cec7b3b8a327ef560f3a7e"} Completed 500 Internal Server Error in 555ms (ActiveRecord: 10.8ms) ActionView::Template::Error (undefined method `path' for nil:NilClass): 3: - if diff_file.diff.submodule? 4: %span 5: - submodule_item = project.repository.blob_at(@commit.id, diff_file.file_path) 6: = submodule_link(submodule_item, @commit.id, project.repository) 7: - else 8: %span 9: - if diff_file.deleted_file app/helpers/submodule_helper.rb:6:in `submodule_links' app/helpers/diff_helper.rb:161:in `submodule_link' app/views/projects/diffs/_file.html.haml:6:in `_app_views_projects_diffs__file_html_haml___2534097047021710941_60536320' app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml___3790141050834119730_50882100' app/views/projects/diffs/_diffs.html.haml:17:in `each' app/views/projects/diffs/_diffs.html.haml:17:in `each_with_index' app/views/projects/diffs/_diffs.html.haml:17:in `_app_views_projects_diffs__diffs_html_haml___3790141050834119730_50882100' app/views/projects/commit/show.html.haml:5:in `_app_views_projects_commit_show_html_haml___4154109768477026444_64730040' app/controllers/projects/commit_controller.rb:26:in `show'
--- a/some/foo/dir +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ce9e65b1c26d9db41cef5ce080a1ce98dee742fa
- Author Contributor
Our repository doesn't make use of submodules.
Others here are posting about submodules. There is probably more than one issue here.
- username-removed-16624 mentioned in issue #4102 (closed)
mentioned in issue #4102 (closed)
- Contributor
Same issue here.
When commit was not rightly handled with sidekiq(or some thing else), compare requests will fall as shown above.
But just after push one more commit(just add one blank space or so), compare requests works fine for us.
(Do not using any submodules)Edited by username-removed-1318 We are using gitlab
v7.13
.In our merge request, we have
-
.js
,.scss
,.html
changes -
.js
and.html
file renames -
.html
deletes -
.png
file renames
I wonder if the
old_file
for an image assumes the image was the same name? Does anyone else having this issue have images in the merge?-
- DJ Mountney mentioned in issue omnibus-gitlab#1209 (closed)
mentioned in issue omnibus-gitlab#1209 (closed)
Same issue here when creating a merge request containing several commits
- commit 1
.png
Files removed - commit 2
.png
Files added with identical paths
we are running gitlab 8.7.5-ee
ActionView::Template::Error (undefined method `size' for nil:NilClass): 19: %a{href: namespace_project_blob_path(@project.namespace, @project, tree_join(old_commit_id, diff.old_path))} 20: %img{src: old_file_raw_path} 21: %p.image-info.hide 22: %span.meta-filesize= "#{number_to_human_size old_file.size}" 23: | 24: %b W: 25: %span.meta-width app/views/projects/diffs/_image.html.haml:22:in `_app_views_projects_diffs__image_html_haml__707548398507873416_61722260' app/views/projects/diffs/_file.html.haml:56:in `_app_views_projects_diffs__file_html_haml___4455195444206947959_160436540' app/views/projects/diffs/_diffs.html.haml:22:in `block in _app_views_projects_diffs__diffs_html_haml___2331130126330673002_159335400' app/views/projects/diffs/_diffs.html.haml:17:in `each_with_index' app/views/projects/diffs/_diffs.html.haml:17:in `_app_views_projects_diffs__diffs_html_haml___2331130126330673002_159335400' app/views/projects/merge_requests/_new_submit.html.haml:45:in `_app_views_projects_merge_requests__new_submit_html_haml__4178494083958412449_156538920' app/views/projects/merge_requests/new.html.haml:5:in `_app_views_projects_merge_requests_new_html_haml__1877376173658968755_156437040' lib/gitlab/middleware/go.rb:16:in `call' lib/gitlab/middleware/readonly_geo.rb:29:in `call'
Edited by username-removed-459099- commit 1
- Stan Hu mentioned in merge request !4816 (closed)
mentioned in merge request !4816 (closed)
- Stan Hu mentioned in issue #19545 (closed)
mentioned in issue #19545 (closed)
- Stan Hu mentioned in issue #19594 (moved)
mentioned in issue #19594 (moved)
- username-removed-293650 Added ~313020 label
Added ~313020 label
- Contributor
Reported by premium customer at https://gitlab.zendesk.com/agent/tickets/40815
- username-removed-128633 Mentioned in merge request !7457 (merged)
Mentioned in merge request !7457 (merged)
- username-removed-128633 Reassigned to @rymai
Reassigned to @rymai
- Douwe Maan Status changed to closed by merge request !7457 (merged)
Status changed to closed by merge request !7457 (merged)