question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fresh install - no tables are created except migrations and migrations_lock

See original GitHub issue

Issue Summary

After doing a fresh install of Ghost on Ubuntu 18.04 - no tables are created except migrations and migrations_lock. Ghost fails to start with an error about the migration lock.

To Reproduce

  1. Follow the official manual to install Ghost on Ubuntu
  2. Ghost fails to start with a message:
Migration lock was never released or currently, a migration is running.
If you are sure no migration is running, check your data and if your database is in a broken state, you could run `knex-migrator rollback`.
  1. Try executing knex-migrator rollback. It fails with the message:
NAME: InternalServerError
MESSAGE: Please provide a file named MigratorConfig.js in your project root.
  1. Connect to MySQL and check the database. Ensure that your ghost database (ghost_prod in my case) is in place. Check the tables in the DB:
mysql> use ghost_prod; show tables;
+----------------------+
| Tables_in_ghost_prod |
+----------------------+
| migrations           |
| migrations_lock      |
+----------------------+
  1. Remove all items from migrations_lock
mysql> delete from migrations_lock;
  1. Try running ghost setup migrate. There is no output or errors.
  2. Try running ghost start. See the same error from step 2

Technical details:

  • Ghost Version: 2.23.0
  • Ghost CLI Version: 1.10.0
  • Node Version: 8.10.0
  • Browser/OS: Ubuntu 18.04
  • Database: MySQL 5.7.22

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
acburdinecommented, May 30, 2019

@sintezcs @joshuajbouw thanks for the log outputs! I think I know where the issue is now, though not why it’s occurring necessarily. Need to debug this a bit more, but will work on getting this fixed as quick as I can 😄

1reaction
sintezcscommented, May 30, 2019

I’ve just figured out the issue. I created a new Ubuntu user named “ghost” in the first step… 🤦‍♂ After I removed it and used “ghostuser” instead, everything worked smoothly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Database: Migrations - The PHP Framework For Web Artisans
The migrate:fresh command will drop all database tables regardless of their prefix. This command should be used with caution when developing on a...
Read more >
Migrations - Django documentation
Migrations ¶. Migrations are Django's way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your...
Read more >
Avoiding downtime in migrations - GitLab Documentation
You can consider enabling lock retries when you run a migration on big tables, because it might take some time to acquire a...
Read more >
Documentation: 15: pg_dumpall - PostgreSQL
Description. pg_dumpall is a utility for writing out (“dumping”) all PostgreSQL databases of a cluster into one script file. The script file contains...
Read more >
EF core not creating tables on migrate method - Stack Overflow
Alright - In SQL Server Management Studio (or whichever tool you're using), drop your database thats been created. Clear out your Migrations ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found