Skip to content

GitLab

  • Menu
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
  • #514

Closed
Open
Created Mar 05, 2012 by Administrator@rootOwner

Error 500 when viewing a newly created merge request

Created by: diebels727

We have recently installed Gitlab v2.2 (stable). Instead of installing with sqlite, we elected to use Postgres.

Started GET "/project/merge_requests/2" for 192.168.1.10 at 2012-03-05 07:04:15 -0800
Processing by MergeRequestsController#show as HTML
  Parameters: {"project_id"=>"project", "id"=>"2"}
  Rendered merge_requests/_how_to_merge.html.haml (0.2ms)
  Rendered commits/_commit.html.haml (3.4ms)
  Rendered merge_requests/_commits.html.haml (3.8ms)
  Rendered notes/_form.html.haml (2.9ms)
  Rendered notes/_notes_list.html.haml (2.7ms)
  Rendered notes/_notes.html.haml (8.6ms)
  Rendered merge_requests/show.html.haml within layouts/project (24.7ms)
Completed 500 Internal Server Error in 61ms

ActionView::Template::Error (PG::Error: ERROR:  operator does not exist: character varying = integer
LINE 1: ...otes".* FROM "notes"  WHERE "notes"."noteable_id" = 2 AND "n...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
: SELECT  "notes".* FROM "notes"  WHERE "notes"."noteable_id" = 2 AND "notes"."noteable_type" = 'MergeRequest' ORDER BY created_at DESC LIMIT 20):
    1: - @notes.each do |note|
    2:   - next unless note.author
    3:   = render :partial => "notes/show", :locals => {:note => note}
  app/views/notes/_notes_list.html.haml:1:in `_app_views_notes__notes_list_html_haml__479690494_109822250'
  app/views/notes/_notes.html.haml:5:in `_app_views_notes__notes_html_haml___373220228_105422760'
  app/views/merge_requests/show.html.haml:66:in `_app_views_merge_requests_show_html_haml___225493959_109944550'
  app/controllers/merge_requests_controller.rb:53:in `show'

It looks like the error is caused by the fact that noteable_id is a varchar, and PG doesn't like this for the has_many association? This makes sense to me, but I'm curious how to go about resolving the issue.

Assignee
Assign to
Time tracking