Ghost is not starting: Error alter table `migrations_lock` add primary key

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • What’s your URL? This is the easiest way for others to debug your issue
  • What version of Ghost are you using?
    • can’t check as docker won’t run
  • What configuration?
    • docker with a mariadb docker instance
  • What browser?
    • firefox 86
  • What errors or information do you see in the console?
[2021-04-06 22:20:55] e[31mERRORe[39m alter table `migrations_lock` add primary key `migrations_lock_pkey`(`lock_key`) - ER_WRONG_NAME_FOR_INDEX: Incorrect index name 'migrations_lock_lock_key_unique'
e[31m
e[31malter table `migrations_lock` add primary key `migrations_lock_pkey`(`lock_key`) - ER_WRONG_NAME_FOR_INDEX: Incorrect index name 'migrations_lock_lock_key_unique'e[39m

e[1me[37mError ID:e[39me[22m
e[90m5b0be630-9726-11eb-aa25-696dc9706c3ee[39m

e[1me[37mError Code: e[39me[22m
e[90mER_WRONG_NAME_FOR_INDEXe[39m

e[90m----------------------------------------e[39m

e[90mInternalServerError: alter table `migrations_lock` add primary key `migrations_lock_pkey`(`lock_key`) - ER_WRONG_NAME_FOR_INDEX: Incorrect index name 'migrations_lock_lock_key_unique'
at new GhostError (/var/lib/ghost/versions/4.1.2/node_modules/@tryghost/errors/lib/errors.js:10:26)
at DatabaseStateManager.getState (/var/lib/ghost/versions/4.1.2/core/server/data/db/state-manager.js:63:32)
at processTicksAndRejections (internal/process/task_queues.js:97:5)

Error: ER_WRONG_NAME_FOR_INDEX: Incorrect index name 'migrations_lock_lock_key_unique'
  • What steps could someone else take to reproduce the issue you’re having?
    • I’m not sure exactly. First time dealing with what looks to be a sql issue.

found answer here DB Error after upgrading to v4 - #9 by mrios