Description
When running apify run (without flags), the CLI exits with an error even though the Actor completes successfully:
[apify] INFO Exiting Actor ({"exit_code": 0})
Error: ENOENT: no such file or directory, stat '/path/to/project/storage/key_value_stores/default/INPUT.json'
Steps to Reproduce
- Create a new Python Actor:
apify create my-actor (select Python + Playwright template)
- Create
storage/key_value_stores/default/INPUT.json with valid input
- Run
apify run
- Actor runs successfully (exit_code: 0)
- CLI crashes with ENOENT error trying to read INPUT.json
Expected Behavior
The CLI should either:
- Not delete
INPUT.json during the default purge operation, OR
- Not attempt to read
INPUT.json after the Actor exits if it was purged
Actual Behavior
The --purge behavior (which is default) deletes the entire key-value store including INPUT.json. After the Actor successfully exits, the CLI attempts to read INPUT.json and fails with ENOENT.
Workarounds
- Use
apify run --no-purge
- Use
apify run --input '{"key": "value"}' to pass input via CLI flag
Environment
- apify-cli version: 1.1.1
- OS: macOS (darwin-arm64)
- Node.js: v25.2.1
Additional Context
The Actor code handles missing input gracefully (await Actor.get_input() or {}), so the Actor itself runs fine. The error is purely in the CLI layer after the Actor completes.
Description
When running
apify run(without flags), the CLI exits with an error even though the Actor completes successfully:Steps to Reproduce
apify create my-actor(select Python + Playwright template)storage/key_value_stores/default/INPUT.jsonwith valid inputapify runExpected Behavior
The CLI should either:
INPUT.jsonduring the default purge operation, ORINPUT.jsonafter the Actor exits if it was purgedActual Behavior
The
--purgebehavior (which is default) deletes the entire key-value store includingINPUT.json. After the Actor successfully exits, the CLI attempts to readINPUT.jsonand fails with ENOENT.Workarounds
apify run --no-purgeapify run --input '{"key": "value"}'to pass input via CLI flagEnvironment
Additional Context
The Actor code handles missing input gracefully (
await Actor.get_input() or {}), so the Actor itself runs fine. The error is purely in the CLI layer after the Actor completes.