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
  • #3965

Closed
Open
Created May 16, 2013 by Administrator@rootOwner

Couldn't add user comments in 5.1 (SQL-Error users_projects.notification_level)

Created by: tuempeltaucher

I'm trying to add a comment in a diff, but an attribute doesn't exist in user_projects and gitlab throws an error.

Started POST "/martin/$project/notes" for  at 2013-05-16 11:23:15 +0200
Processing by NotesController#create as JS
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"foobar", "target_type"=>"commit", "target_id"=>"cea3559819e061a9772a
97c838424baae10f887c", "note"=>{"commit_id"=>"cea3559819e061a9772a97c838424baae10f887c", "line_code"=>"f24770f5570a0f25de0f36c1c7e5575fbea82569_7_5", "noteab
le_id"=>"", "noteable_type"=>"Commit", "note"=>"d"}, "commit"=>"Add Comment", "project_id"=>"martin/$project"}
Completed 500 Internal Server Error in 163ms

ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'users_projects.notification_level' in 'where clause': SELECT `users_projects`.`user_id` FROM `
users_projects`  WHERE `users_projects`.`project_id` = 3 AND `users_projects`.`notification_level` = 2):
  config/initializers/connection_fix.rb:22:in `execute'
  app/services/notification_service.rb:152:in `project_watchers'
  app/services/notification_service.rb:122:in `new_note'
  app/observers/note_observer.rb:3:in `after_create'
  app/contexts/notes/create_context.rb:6:in `execute'
  app/controllers/notes_controller.rb:21:in `create'

user_projects:

CREATE TABLE `users_projects` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL,
  `created_at` datetime NOT NULL,
  `updated_at` datetime NOT NULL,
  `project_access` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `index_users_projects_on_project_access` (`project_access`),
  KEY `index_users_projects_on_project_id` (`project_id`),
  KEY `index_users_projects_on_user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

I run following commands:

bundle install --without development test postgres --deployment
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake migrate_merge_requests RAILS_ENV=production

Doesn't change anything.

Assignee
Assign to
Time tracking