Ghost CMS CPU stuck at 100% from a bad SQLite record
Ghost CMS suddenly used 100% CPU even though there was no traffic jump and no update running. Restarting the only helped for a few minutes before the problem returned. The cause was one bad record in the table `welcome_email__runs`.
Its `next_welcome_email__email_id` value pointed to an email that did not exist, so Ghost CMS kept retrying the welcome email job in a loop. Running `sqlite3 /path/to/ghost.db "UPDATE welcome_email__runs SET next_welcome_email__email_id=NULL;"` cleared the bad value and fixed the CPU usage right away. No restart was needed.
It is still unclear whether this happens more often with SQLite than with MySQL setups.
Key points
- Ghost CMS used 100% CPU without extra traffic or updates.
- Restarting the only gave a short temporary fix.
- A SQLite record in `welcome_email__runs` pointed to a missing email.
- Setting `next_welcome_email__email_id` to `NULL` stopped the loop immediately.
- Back up the database before making this kind of direct change.