Errors on importing a previously exported space

I exported a fairly large space using the management SDK, and I’m getting a lot of errors on import when it tries to process assets. When I look at the source space for the assets in question I can see the asset there.

How can I debug what the actual problem is? I performed this import last night and I believe it worked.

The errors in the screenshot are continuing on. Since a few worked at the start and then none of them after that did, I wonder if I’m hitting some kind of limit.

Hey @dustin.aleksiuk!

I suspect you meant this error Space clone: assets issue ?
It should be fixed, but please let me now if you still see it.

Hey @dustin.aleksiuk,
We released a new version of the import/export tools. they now provide an error log file that details these errors.

Best,
Khaled

1 Like

Thanks. I just upgraded and tried it. It failed halfway through an import with an error. I exported using the newest version of contentful-export and I did the import with the newest version of contentful-import. I’ll take a look and submit an issue on github. This stuff is making me tired.

This is the error:

14:14:57 - TypeError: Cannot read property ‘sys’ of undefined
(node:14729) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 578): SyntaxError: Unexpected token u in JSON at position 0

I am also getting this TypeError with @next branches of import and export modules installed today. I’m doing a space to space clone, and have over 1000 assets, so this is a bit of a pain. Some of the draft assets have validation issues that raise separate errors, but the whole process bails the moment it hits this error (after about 40 minutes of asset processing):
{
“ts”: “2018-01-02T12:24:43.299Z”,
“level”: “error”,
“error”: {
“stacktrace”: [
“TypeError: Cannot read property ‘sys’ of undefined”,
"/usr/lib/node_modules/contentful-import/node_modules/contentful-batch-libs/dist/push/push-to-space.js:344:46",
“Array.filter (native)”,
“publishEntities (/usr/lib/node_modules/contentful-import/node_modules/contentful-batch-libs/dist/push/push-to-space.js:343:36)”,
“Task.task (/usr/lib/node_modules/contentful-import/node_modules/contentful-batch-libs/dist/push/push-to-space.js:230:14)”,
“Promise.resolve.then.then.skipped (/usr/lib/node_modules/contentful-import/node_modules/contentful-batch-libs/node_modules/listr/lib/task.js:169:30)”
]
}
}

@webteam_admin - This is the link to the github issue: https://github.com/contentful/contentful-import/issues/74

I followed @christine’s instructions in that thread and it got it working by temporarily hacking her fix right into the code in node_modules.

Here’s another link to more discussion. It looks like it’s been merged so I would assume it would work now: https://github.com/contentful/contentful-batch-libs/pull/138

Thanks @dustin.aleksiuk.
A reinstall of contentful-import to it’s stable current version seems to have done the trick.