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

Closed
Open
Created Apr 09, 2013 by Administrator@rootOwner

Postgresql: Wiki to Gollum migration fails

Created by: Philzen

Just wanted move from 4.2 to 5.0, but migrating wikis (most wanted feature since all my wikis were mostly broken since 4.0) fails as seen below.

[philzen@hisserver /home/git/gitlab]$ sudo -u git -H bundle exec rake gitlab:wiki:migrate RAILS_ENV=production

Migrating Wiki for 'worldweather'
Initialized empty Git repository in /usr/home/git/repositories/worldweather.wiki.git/
rake aborted!
PG::Error: ERROR:  column "wikis.id" must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: SELECT "wikis".* FROM "wikis"  WHERE "wikis"."project_id" = ...
               ^
: SELECT "wikis".* FROM "wikis"  WHERE "wikis"."project_id" = 1 GROUP BY slug
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `async_exec'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `exec_no_cache'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:660:in `block in exec_query'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:659:in `exec_query'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1256:in `select'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/database_statements.rb:18:in `select_all'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/querying.rb:38:in `block in find_by_sql'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/explain.rb:41:in `logging_query_plan'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/querying.rb:37:in `find_by_sql'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation.rb:171:in `exec_queries'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation.rb:160:in `block in to_a'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/explain.rb:41:in `logging_query_plan'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation.rb:159:in `to_a'
/usr/home/git/gitlab/vendor/bundle/ruby/1.9/gems/activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:159:in `all'
/usr/home/git/gitlab/lib/wiki_to_gollum_migrator.rb:47:in `create_pages'
/usr/home/git/gitlab/lib/wiki_to_gollum_migrator.rb:17:in `block in migrate!'
/usr/home/git/gitlab/lib/wiki_to_gollum_migrator.rb:14:in `each'
/usr/home/git/gitlab/lib/wiki_to_gollum_migrator.rb:14:in `migrate!'
/usr/home/git/gitlab/lib/tasks/gitlab/migrate_wiki.rake:17:in `block (3 levels) in <top (required)>'
Tasks: TOP => gitlab:wiki:migrate

AFAIR, that particular repository's wiki is empty.

I believe this fails by design because that SQL relies on the MySQL-flavoured Group-By implementation.

Assignee
Assign to
Time tracking