Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset files empty after crash #34

Open
MSIH opened this issue Apr 12, 2021 · 0 comments
Open

Dataset files empty after crash #34

MSIH opened this issue Apr 12, 2021 · 0 comments

Comments

@MSIH
Copy link

MSIH commented Apr 12, 2021

OS: ubuntu 20
Apify SDK: 1.1.1

  • getData should have a parameter to skip malformed files. this way you still get your data
  • I am using await ResultsDataset.pushData(info); so each data file should be written to disk before the next file is process?

After my system crashed local the dataset folder contained files with 0 size.

image

This is causing this code to fail:

let ResultsDataset = await Apify.openDataset(datasetTitle);
const { items } = await ResultsDataset.getData();

SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at DatasetClient._readAndParseFile (/home/msihadmin/Documents/repo/apify-pricelocal/node_modules/@apify/storage-local/src/resource_clients/dataset.js:268:21)
at async DatasetClient.listItems (/home/msihadmin/Documents/repo/apify-pricelocal/node_modules/@apify/storage-local/src/resource_clients/dataset.js:130:26)
at async Dataset.getData (/home/msihadmin/Documents/repo/apify-pricelocal/node_modules/apify/build/storages/dataset.js:223:20)
at async /home/msihadmin/Documents/repo/apify-pricelocal/exportDatasetToJSONFile.js:15:23
at async run (/home/msihadmin/Documents/repo/apify-pricelocal/node_modules/apify/build/actor.js:180:13)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant