apify / apify-storage-local-js

Local emulation of the apify-client NPM package, which enables local use of Apify SDK.
3 stars 4 forks source link

Dataset files empty after crash #34

Open MSIH opened 3 years ago

MSIH commented 3 years ago

OS: ubuntu 20 Apify SDK: 1.1.1

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)