Importer fails with sqlite unable to insert default values
See original GitHub issueIssue Summary
Tried importing a json from a GhostPro export, and got an error from the sqlite connector:
Import failed
sqlite
does not support inserting default values. Specify values explicitly or use theuseNullAsDefault
config flag. (see docs http://knexjs.org/#Builder-insert).
MacOS High Sierra (10.13.3) Chrome 65.0.3325.181 Export from GhostPro 1.22.1 Import to local install Ghost 1.22.3
NOTE: I have not yet tried downgrading local install to 1.22.1 and retrying import. (I haven’t had enough time, but it’s something I considered when gathering info for the bug report. I had assumed that GhostPro was running latest)
Steps to Reproduce
- Exported content from hosted ghost blog as json
- Install ghost locally
- Add user/blog, and try to import the json from step 1
- Import fails
Aside from trying to find the sqlite connector call and changing the code locally, I don’t know if there’s a way to set useNullAsDefault
somewhere to try and re-import. Additionally, I think the error might be able to get caught and reworded for a friendlier user experience.
Technical details:
- Ghost CLI Ver: 1.7.1
- Ghost Version: 1.22.3
- Node Version: 8.11.1
- Browser/OS: Chrome 65.0.3325.181
- Database: sqlite (bundled with ghost cli)
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top GitHub Comments
I’m able to reproduce this at the moment with 1.22.5 installed locally via
ghost install local
and an export from a Ghost(Pro) blog.Edit: I’ve got around this by adding
"useNullAsDefault": true
to myconfig.development.json
and I’m able to import content. I do get a whole lot of errors like this though:The database portion in my
config.development.json
file ends up looking like this:@docrinehart see SQlite3 config example https://docs.ghost.org/docs/config#section-sqlite3.
Leaving this open. I need to understand if we have to set a default for this value. I thought it’s only required for our test env and our test fixtures. I don’t remember. Will check when i have time.