Gitlab upgade from 7.0 to 8.0 fails at "db:migrate"

Hi

I am having an omnibus gitlab 7.1.0 i tried to upgrade it to 8.0. I am facing this issue of “db: migrate failed”
Can some one give me some idea.

Please find

  1. Db schema version
  2. Error Snapshot
  3. Env info and
  4. Migration status below

1. Db schema version

[root@server1131 ~]# gitlab-rails console
Loading production environment (Rails 4.1.12)
irb(main):001:0> ActiveRecord::Migrator.current_version
=> 20140729145339
irb(main):002:0>

3. Error Snapshot

2. Env Info

  • [root@server1131 ~]# sudo gitlab-rake gitlab:env:info SANITIZE=true --trace*
    *** Invoke gitlab:env:info (first_time)*
    *** Invoke environment (first_time)*
    *** Execute environment*
    *** Execute gitlab:env:info*

System information
System: RedHatEnterpriseServer 6.6
Current User: git
Using RVM: no
Ruby Version: 2.1.6p336
Gem Version: 2.2.5
Bundler Version:1.5.3
Rake Version: 10.4.2
Sidekiq Version:3.3.0

GitLab information
Version: 8.0.0
Revision: d70c051
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: http://Server1131.XXXX.com
HTTP Clone URL: http://server1131.XXX.com/some-group/some-project.git
SSH Clone URL: git@server1131.XXXX.com:some-group/some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version: 2.6.5
Repositories: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
[root@server1131 ~]#

**

4. Migration Status

**
[root@server1131 ~]# gitlab-rake db:migrate:status

database: gitlabhq_production

Status Migration ID Migration Name

up 20121220064453 Init schema
up 20130102143055 Rename owner to creator for project
up 20130110172407 Add public to project
up 20130123114545 Add issues tracker to project
up 20130125090214 Add user permissions
up 20130131070232 Remove private flag from project
up 20130206084024 Add description to namsespace
up 20130207104426 Add description to teams
up 20130211085435 Add issues tracker id to project
up 20130214154045 Rename state to merge status in milestone
up 20130218140952 Add state to issue
up 20130218141038 Add state to merge request
up 20130218141117 Add state to milestone
up 20130218141258 Convert closed to state in issue
up 20130218141327 Convert closed to state in merge request
up 20130218141344 Convert closed to state in milestone
up 20130218141444 Remove merged from merge request
up 20130218141507 Remove closed from issue
up 20130218141536 Remove closed from merge request
up 20130218141554 Remove closed from milestone
up 20130220124204 Add new merge status to merge request
up 20130220125544 Convert merge status in merge request
up 20130220125545 Remove merge status from merge request
up 20130220133245 Rename new merge status to merge status in milestone
up 20130304104623 Add state to user
up 20130304104740 Convert blocked to state
up 20130304105317 Remove blocked from user
up 20130315124931 User color scheme
up 20130318212250 Add snippets to features
up 20130319214458 Create forked project links
up 20130323174317 Add private to snippets
up 20130324151736 Add type to snippets
up 20130324172327 Change project id to null in snipepts
up 20130324203535 Add type value for snippets
up 20130325173941 Add notification level to user
up 20130326142630 Add index to users authentication token
up 20130403003950 Add last activity column into project
up 20130404164628 Add notification level to user project
up 20130410175022 Remove wiki table
up 20130419190306 Allow merges for forks
up 20130506085413 Add type to key
up 20130506090604 Create deploy keys projects
up 20130506095501 Remove project id from key
up 20130522141856 Add more fields to service
up 20130528184641 Add system to notes
up 20130611210815 Increase snippet text column size
up 20130613165816 Add password expires at to users
up 20130613173246 Add created by id to user
up 20130614132337 Add improted to project
up 20130617095603 Create users groups
up 20130621195223 Add notification level to user group
up 20130622115340 Add more db index
up 20130624162710 Add fingerprint to key
up 20130804151314 Add st diff to note
up 20130809124851 Add permission check to user
up 20130812143708 Add import url to project
up 20130819182730 Add internal ids to issues and mr
up 20130821090530 Remove deprecated tables
up 20130821090531 Add internal ids to milestones
up 20130909132950 Add description to merge request
up 20130926081215 Change owner id for group
up 20131005191208 Add avatar to users
up 20131009115346 Add confirmable to users
up 20131106151520 Remove default branch
up 20131112114325 Create broadcast messages
up 20131112220935 Add visibility level to projects
up 20131129154016 Add archived to projects
up 20131130165425 Add color and font to broadcast messages
up 20131202192556 Add event fields for web hook
up 20131214224427 Add hide no ssh key to users
up 20131217102743 Add recipients to service
up 20140116231608 Add website url to users
up 20140122112253 Create merge request diffs
up 20140122114406 Migrate mr diffs
up 20140122122549 Remove m rdiff fields
up 20140125162722 Add avatar to projects
up 20140127170938 Add group avatars
up 20140209025651 Create emails
up 20140214102325 Add api key to services
up 20140304005354 Add index merge request diffs on merge request
up 20140305193308 Add tag push hooks to project hook
up 20140312145357 Add import status to project
up 20140313092127 Migrate already imported projects
up 20140407135544 Fix namespaces
up 20140414131055 Change state to allow empty merge request diffs
up 20140415124820 Limits to mysql
up 20140416074002 Add index on iid
up 20140416185734 Index on current sign in at
up 20140428105831 Add notes index updated at
up 20140502115131 Add repo size to db
up 20140502125220 Migrate repo size
up 20140611135229 Add position to merge request
up 20140625115202 Create users star projects
up 20140729134820 Create labels
up 20140729140420 Create label links
up 20140729145339 Migrate project tags
down 20140729152420 Migrate taggable labels
down 20140730111702 Add index to labels
down 20140903115954 Migrate to new shell
down 20140907220153 Serialize service properties
down 20140914113604 Add members table
down 20140914145549 Migrate to new members model
down 20140914173417 Remove old member tables
down 20141006143943 Move slack service to webhook
down 20141007100818 Add visibility level to snippet
down 20141118150935 Add audit event
down 20141121133009 Add timestamps to members
down 20141121161704 Add identity table
down 20141205134006 Add locked at to merge request
down 20141216155758 Create doorkeeper tables
down 20141217125223 Add owner to application
down 20141223135007 Add import data to project table
down 20141226080412 Add developers can push to protected branches
down 20150108073740 Create application settings
down 20150116234544 Add home page url for application settings
down 20150116234545 Add gitlab access token to user
down 20150125163100 Add default branch protection setting
down 20150205211843 Add timestamps to identities
down 20150206181414 Add index to created at
down 20150206222854 Add notification email to user
down 20150209222013 Add missing index
down 20150211172122 Add template to service
down 20150211174341 Allow null in services project
down 20150213104043 Add twitter sharing enabled to application settings
down 20150213114800 Add hide no password to user
down 20150213121042 Add password automatically set to user
down 20150217123345 Add bitbucket access token and secret to user
down 20150219004514 Add events to services
down 20150223022001 Set missing last activity at
down 20150225065047 Add note events to services
down 20150301014758 Add restricted visibility levels to application settings
down 20150306023106 Fix namespace duplication
down 20150306023112 Add unique index to namespace
down 20150310194358 Add version check to application settings
down 20150313012111 Create subscriptions table
down 20150320234437 Add location to user
down 20150324155957 Set incorrect assignee id to null
down 20150327122227 Add public to key
down 20150327150017 Add import data to project
down 20150327223628 Add devise two factor to users
down 20150328132231 Add max attachment size to application settings
down 20150331183602 Add devise two factor backupable to users
down 20150406133311 Add invite data to member
down 20150411000035 Fix identities
down 20150411180045 Rename buildbox service
down 20150413192223 Add public email to users
down 20150417121913 Create project import data
down 20150417122318 Remove import data from project
down 20150421120000 Remove periods at ends of usernames
down 20150423033240 Add default project visibililty to application settings
down 20150425164646 Gitlab change collation for tag names.acts as taggable on engine
down 20150425164647 Remove duplicate tags
down 20150425164648 Add missing unique indices.acts as taggable on engine
down 20150425164649 Add taggings counter cache to tags.acts as taggable on engine
down 20150425164650 Add missing taggable index.acts as taggable on engine
down 20150425164651 Change collation for tag names.acts as taggable on engine
down 20150425173433 Add default snippet visibility to app settings
down 20150429002313 Remove abandoned group members records
down 20150502064022 Add restricted signup domains to application settings
down 20150509180749 Convert legacy reference notes
down 20150516060434 Add note events to web hooks
down 20150529111607 Add user oauth applications to application settings
down 20150529150354 Add after sign out path for application settings
down 20150609141121 Add session expire delay for application settings
down 20150610065936 Add dashboard to users
down 20150620233230 Add default otp required for login value
down 20150713160110 Add project view to users
down 20150717130904 Add commits count to project
down 20150730122406 Add updated by to issuables and notes
down 20150806104937 Create abuse reports
down 20150812080800 Add settings import sources
down 20150814065925 Remove oauth tokens from users
down 20150817163600 Deduplicate user identities
down 20150818213832 Add sent notifications
down 20150824002011 Add enable ssl verification
down 20150826001931 Add ci tables
down 20150902001023 Add template to label
down 20150914215247 Add ci tags
down 20150915001905 Enable ssl verification by default
down 20150916000405 Enable ssl verification for web hooks
down 20150916114643 Add help page text to application settings
down 20150916145038 Add index for committed at and
down 20150918084513 Add ci enabled to application settings
down 20150918161719 Remove invalid milestones from merge requests
down 20150920010715 Add consumed timestep to users
down 20150920161119 Add line code to sent notification

Please let me know how to solve this. Thanks in Advance.

Do you get any errors running:
sudo gitlab-ctl reconfigure

You can manually run the migrate task using sudo gitlab-rake db:migrate but reconfigure should be taking care of it as long as it isn’t failing somewhere else.

1 Like

Hi

I have tried these steps “sudo gitlab-ctl reconfigure” and “sudo gitlab-rake db:migrate” they were throwing errors and application was not recovering. Since upgrading from 7.1 to 8.0 is big leap we decided to take two more steps.
Our actual requirement was upgrading Gitlab from 6.9.2 to 8.2.3 (latest)

we have done this like this
6.9.2 to 7.1.0
7.1.0 to 7.4.0
7.4.0 to 7.6.0
7.6.0 to 8.0.0
8.0.0 to 8.2.3
Due to multiple changes in between 7.0 to 8.0 due to incompatibilities db:migrate might have been failing. The issue has be solved now.
Thank you !