erquhart
erquhartā€¢11mo ago

Import fails on storage invalid id

This is occurring with convex@1.11.2 - I have dev and prod deployments running the same convex code - dev deployment has all tables cleared and no files in storage - I create a prod export that includes files via cli:
npx convex export --prod --include-file-storage --path convex-prod.zip
npx convex export --prod --include-file-storage --path convex-prod.zip
- I import the resulting file:
npx convex import --replace -y convex-prod.zip
npx convex import --replace -y convex-prod.zip
- CLI output:
Interrupting `npx convex import` will not cancel it.
āœ– Importing data from "convex-prod.zip" failed
Hit an error while importing:
_storage entry has invalid ID 3g1btk77mppw2sq1z71rppc99ne3mmg (TableNumber(28) != TableNumber(540))
Interrupting `npx convex import` will not cancel it.
āœ– Importing data from "convex-prod.zip" failed
Hit an error while importing:
_storage entry has invalid ID 3g1btk77mppw2sq1z71rppc99ne3mmg (TableNumber(28) != TableNumber(540))
If I do all of the above, but leave off --include-file-storage in the export command, everything works fine.
3 Replies
erquhart
erquhartOPā€¢11mo ago
There are 13 files in storage, all images with a cumulative weight of less than 300kb. I tried deleting the specific image called out in the error, which was not related to any record in the db, and it began giving the same error for a different image, which is referenced by a record in the db.
lee
leeā€¢11mo ago
this is because the prod deployment was created before convex 1.7 while the dev deployment was created after (or vice versa). So the _storage ids are incompatible. There's currently no way to change the id format of _storage tables (because they are system tables). Sorry, it's unfortunate. You can upload the files with new ids but there's no way to preserve old _storage ids in a newer deployment
erquhart
erquhartOPā€¢11mo ago
Got it šŸ‘

Did you find this page helpful?