Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #3806

Closed
Open
Created 12 years ago by Administrator@rootOwner
  • New issue

  • Report abuse

  • New issue

  • Report abuse

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 :

  1. Dev pushes branch my_branch
  2. Dev creates a MR my_branch -> master
  3. 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'

Linked issues
...

    Related merge requests

    • Administrator
      Administrator @root · 12 years ago
      Owner

      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)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      Created by: Isammoc

      We found a workaround not to be blocked : 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).

      By Administrator on 2013-05-07T09:06:59 (imported from GitLab project)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      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:inid' app/models/merge_request.rb:213:in new' app/models/merge_request.rb:213:inblock in load_commits' app/models/merge_request.rb:213:in map' app/models/merge_request.rb:213:inload_commits' app/models/merge_request.rb:145:in commits' app/models/merge_request.rb:184:inmr_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)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      Created by: Isammoc

      reproduced in 5.2.0 02a7b127

      By Administrator on 2013-06-10T10:18:48 (imported from GitLab project)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      Created by: nTraum

      confirming the bug on 5.2 confirming the workound by adding /edit to the URL

      By Administrator on 2013-06-15T07:17:44 (imported from GitLab project)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      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)

    • Administrator
      Administrator @root · 11 years ago
      Owner

      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)

    • Administrator
      Administrator @root · 11 years ago
      Owner

      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)

    • Administrator
      Administrator @root · 11 years ago
      Owner

      Created by: raidenz204

      Having the exact same issue upgrading from Gitlab 5.0 -> 6.0. If I add /edit to the url, that's a temporary workaround. So what is the proper fix to not always having to add /edit to the url?

      By Administrator on 2013-08-27T18:46:06 (imported from GitLab project)

    • Administrator
      Administrator @root · 11 years ago
      Owner

      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)

    • Administrator
      Administrator @root · 11 years ago
      Owner

      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)

    • Administrator
      Administrator @root · 11 years ago
      Owner

      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)

    • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
    Please register or sign in to reply
    0 Assignees
    Assign to
    Milestone
    No milestone
    None
    None
    Time tracking
    Due date
    None
    None
    2
    Labels
    Awaiting feedback Crashes - 500 errors
    Assign labels
    • No matching results
    • Manage project labels
    Confidentiality
    Not confidential

    You are going to turn on confidentiality. Only team members with at least Reporter access will be able to see and leave comments on the issue.

    Lock issue
    Unlocked
    participants
    Reference:

    Menu

    Projects Groups Snippets
    Help