timmeade
timmeade12mo ago

ImportFailed: Not valid JSON.

I have imported data before but smaller sets. I'm trying to import about an 8000 row json file. It fails at a different point every time. If i only import 1 or 2 records it works fine, but I need to import about 300. Any ideas? ❯ npx convex import --table inmate_customers ~/src/data/customers_stripeid_20240302-1.json --prod ✖ Importing data from "/Users/tim/src/data/customers_stripeid_20240302-1.json" to table "inmate_customers" in your prod deployment failed 400 Bad Request: ImportFailed: Not valid JSON: EOF while parsing a value at line 264 column 1 ❯ npx convex import --table inmate_customers ~/src/data/customers_stripeid_20240302-1.json --prod ✖ Importing data from "/Users/tim/src/data/customers_stripeid_20240302-1.json" to table "inmate_customers" in your prod deployment failed 400 Bad Request: ImportFailed: Not valid JSON: EOF while parsing a string at line 13 column 36 ❯ npx convex import --table inmate_customers ~/src/data/customers_stripeid_20240302-1.json --prod ✖ Importing data from "/Users/tim/src/data/customers_stripeid_20240302-1.json" to table "inmate_customers" in your prod deployment failed 400 Bad Request: ImportFailed: Not valid JSON: EOF while parsing a value at line 46 column 3
5 Replies
lee
lee12mo ago
Make sure your convex version is at least 1.9, which is when larger files started being supported. If it's still failing, convert the json into a jsonl format (one json object per line, with newlines separating them). Convex has no size limit for jsonl imports because the file can be parsed as a stream
timmeade
timmeadeOP12mo ago
Thanks I bet that is what it is. I forgot when i did another larger one a few weeks ago it was jsonl. i'll try that Working much better. Thanks
Gorka Cesium
Gorka Cesium12mo ago
did you use a tool to convert to jsonl?
timmeade
timmeadeOP12mo ago
@Gorka Cesium I did. just did a quick google search and picked the first one. Worked great
Gorka Cesium
Gorka Cesium12mo ago
i used jq, works great

Did you find this page helpful?