New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration failed in latest version #288
Comments
I couldn't find out which version was I running previously, but I rolled back to 4.34.3 and it seems to work just fine... I looked at the commit in GitHub, and the next version is 4.35, which is the latest one right one, and I tried manually switching back to 4.35 and it still gave migration error... I am using MySQL 8 as database... |
I imagine it would probably help to narrow down a little more exactly which version to which version gave the migration error, but I'll have to defer to @acburdine for more as I'm not very familiar with Ghost's migrations. 🙈 |
yes, it was migrating from 4.34.3 to the next release 4.35 which gave migration error on my server... although they have released 4.36 right now, but it's not up on docker hub...I'll try migrating when its up and report if it works... |
still an issue in version 4.36... |
Possibly related to this issue? |
Another user using our Docker image reporting this in the official Ghost forums as well: |
nope...mine gives a different MySQL error...i posted above.. |
I'm aware that the error messages are different, what's curious is that they both happen to involve the same table. Regardless, thanks for reporting the issue. I was about to update this weekend (from 4.34.3) and now I'm thinking I'm going to hold back! |
I run into this as well: https://forum.ghost.org/t/error-after-update-to-4-35-0/28349/2 I tried to replicate the error locally with docker compose. However, on my production blog, I can not update |
I'm getting same issue in docker environment moving from 4.32.3 to 4.36.0 and latest mysql:8 docker image.
|
Upgraded from 4.34.3 to 4.36.1 without a problem. I did not have the post_products table prior to this and I see that it was created with a database migration in the Docker log. I recently just moved to a Docker Ghost container from a local install, so I suspect everyone's problem here either occurred in a previous version or my table is blank (I don't use Ghost memberships). |
Solution ProposalLogin to your mysql database with an admin user, may be SET PERSIST default_collation_for_utf8mb4 = utf8mb4_general_ci; Afterwards upgrade (or restart) your ghost server. Validate ConfigSELECT * FROM performance_schema.persisted_variables; SELECT @@default_collation_for_utf8mb4; BackgroundThe default collation for charset For instance, if created with MySQL 5.7, table CREATE TABLE `posts` (
`id` varchar(24) COLLATE utf8mb4_general_ci NOT NULL,
... And now, with the the new default of MySQL 8.0, table CREATE TABLE `posts_products` (
...
`post_id` varchar(24) COLLATE utf8mb4_0900_ai_ci NOT NULL,
...
CONSTRAINT `posts_products_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `posts` (`id`) ON DELETE CASCADE,
... This results in the reported error:
RemarkThe issue does not occur, if you start with a new Ghost installation on MySQL 8.0. If you started with your Ghost database on MySQL 5.7 and want to go on with the new default collation of MySQL 8.0, you may have two options: Option 1 (Not verified myself)Create a new Ghost installation on MySQL 8.0. Option 2 (Not verified myself)Manually migrate your tables. This is possible, but tricky: If you try to change the collation of columns, like
you get a similar error with respect to already existing foreign key constraints. Possible solution:
(Caution: If done manually, this is very error prone!) |
The config change worked for me, but if it's an option, dumping your database, performing a search/replace on |
I have replicated the bug on Linux Mint, with the error on the following upgrade path: Running on Linux Mint 19.3 Cinnamon, Ubuntu Bionic Upgraded today to MYSQL8 from v5.7 prior to upgrading Ghost. Ran standard Ghost update and got error above. Tried various solutions:
After each attempt to fix, tried restarting, updating, force updating etc. The only thing which worked was setting the persistent parameter and then restarting the MYSQL daemon. Recommended solution on Ubuntu flavoured OS:
Hope this helps for others. @Niels-75 thanks for your solution. |
Got the same problem during the update (from 4.x to 4.36.3) on DO droplet (Ubuntu 20.04.4 LTS, MySQL 8+).
I found that migration
I tried to create table manually and that was ok, so the Ghost CMS ran well
|
I can confirm this method and it worked just fine on my blog My steps:
Your site should be available again and the update did work flawlessly afterward. |
Is this still an issue? (Also relevant: is this an issue that's specific to this Docker image, or one that's general to the Ghost upgrade/migration process?) 👀 |
As far as I understand:
This only happens when you have used started using ghost with MySQL 5.7 and then migrated to MySQL 8.0. Because these both versions have different defaults you will run into this migration problem. Why? |
Thanks for confirming! I'm going to close this (as there's not something we're going to be able to do to fix it in the image), but feel free to continue the conversation to determine the appropriate place to move the discussion. 👍 |
Has this issue been raised with MySQL. It had probably wasted 1 million years of developer time so far. |
None of the solutions seem to work for me. I'm using Google's Cloud SQL. I asked a question with details on the forum https://forum.ghost.org/t/database-migration-lock-after-updating-ghost/34667 but i haven't gotten any feedback on there. Does anyone know of a fix? |
I have been running ghost latest version in docker on Ubuntu 20.04 for quite a while...and it's been running fine...
Now yesterday, after watchtower update, it failed with error
The text was updated successfully, but these errors were encountered: