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

[Bug]: Actor sometimes fails to run locally when being interrupted before #1736

Closed
1 task
JJetmar opened this issue Jan 12, 2023 · 0 comments · Fixed by #1737
Closed
1 task

[Bug]: Actor sometimes fails to run locally when being interrupted before #1736

JJetmar opened this issue Jan 12, 2023 · 0 comments · Fixed by #1737
Labels
bug Something isn't working.

Comments

@JJetmar
Copy link
Contributor

JJetmar commented Jan 12, 2023

Which package is this bug report for? If unsure which one to select, leave blank

@crawlee/memory-storage

Issue description

I am running an actor locally via apify run then I interrupt it with SIGINT and then I try to run it again.
It happens quite a lot, that i cannot run it again due to error:

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at findRequestQueueByPossibleId (/home/JJetmar/node_modules/@crawlee/memory-storage/cache-helpers.js:237:42)
    at async RequestQueueClient.get (/home/JJetmar/node_modules/@crawlee/memory-storage/resource-clients/request-queue.js:89:23)
    at async StorageManager._getOrCreateStorage (/home/JJetmar/node_modules/@crawlee/core/storages/storage_manager.js:97:33)
    at async StorageManager.openStorage (/home/JJetmar/node_modules/@crawlee/core/storages/storage_manager.js:73:35)
    at async file:///home/JJetmar/src/main.js:90:22
Waiting for the debugger to disconnect...
Error: npm exited with code 1

The issue is a in a request_queue item, that is stored on filesystem and the file is empty.

Code sample

No response

Package version

3.0.4

Node.js version

v16.16.0

Operating system

Linux

Apify platform

  • Tick me if you encountered this issue on the Apify platform

I have tested this on the next release

No response

Other context

discussed on https://apifier.slack.com/archives/CD0SF6KD4/p1673522872403149

@JJetmar JJetmar added the bug Something isn't working. label Jan 12, 2023
B4nan pushed a commit that referenced this issue Jan 12, 2023
Fixes #1736

Co-authored-by: JJetmar <josef.jetmar@apify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant