contentstack / contentstack-import

Node.js utility to import content into Contentstack
MIT License
6 stars 7 forks source link

Import fails with useless error message #31

Open emersonthis opened 4 years ago

emersonthis commented 4 years ago
$ node --version
v14.4.0

$ npm run import

> contentstack-import@1.7.0 import /Users/emerson/Code/contentstack-import
> node app.js

Logging into Contentstack
Contentstack account authenticated successfully!
info: Languages have been imported successfully!
info: Environments have been imported successfully!
info: No Extensions Found
info: No Webhooks Found
info: No globalfields Found
info: No folders were found at: /Users/emerson/Code/contentstack-import/_backup_131/assets/folders.json
info: Asset import completed successfully!
error: Import utility failed while executing
error: {}

Here's what I find in logs/error.log

{"level":"error","message":"Import utility failed while executing","timestamp":"2020-08-12T19:43:59.923Z"}
{"level":"error","message":"{}","timestamp":"2020-08-12T19:43:59.923Z"}

I used this utility roughly one month ago and it worked. It's unclear to me what changed since then. And I'm having trouble finding any useful output to debug.

emersonthis commented 4 years ago

It appears that the script was choking on .DS_Store files that MacOS creates silently.

I was able to get it working by adding .DS_Store to the skipFiles list on lib/import/entries.js:40 and lib/import/content_types.js:31

For whatever it's worth, I was able to find this bug by adding console.error(error); inside the catch statement in app.js. Currently, there are some log statements but they don't appear to log anything helpful when these kinds of errors occur.

rohitmishra209 commented 4 years ago

Thank you @emersonthis for bringing this to our notice Will look into this error log and update you soon