Skip to content

INPUT.json Automatically Deleted on Each Run (Python SDK Local Storage Issue) #686

@salimuddin07

Description

@salimuddin07

Hi Apify Team,

I’m encountering a persistent problem with my local Python Apify scraper project — the INPUT.json file under:

C:\MyPersonelProjects\youtube-scraper\storage\key_value_stores\default\

gets automatically deleted every time I run the scraper.

Error
Error: ENOENT: no such file or directory, stat 'C:\MyPersonelProjects\youtube-scraper\storage\key_value_stores\default\INPUT.json'

Even if I manually restore the file, it disappears after the next run, preventing successive executions without manual restoration.

Setup

Language: Python

Framework: Playwright + Apify SDK

Commands used:

.\run-actor.ps1

apify run

apify run -p

apify run --input-file=./input.json

apify run -i ./input.json

apify run -i @'
{
  "start_urls": [{ "url": "https://www.youtube.com/" }],
  "max_depth": 1
}
'@

All result in the same deletion or ENOENT error.

Steps Tried

Restored INPUT.json manually each time.

Added a restore script: python .\scripts\restore_input.py.

Set environment variable:

$env:APIFY_DISABLE_STORAGE_LOCAL_CLEANUP=1

Also set globally:

setx APIFY_DISABLE_STORAGE_LOCAL_CLEANUP "1"

Tried running via PowerShell and CMD.

Request

Please investigate whether there’s a regression or configuration conflict in the local storage cleanup process for the Python SDK.
Even with cleanup disabled, the process still removes INPUT.json after each run.

If I’m doing anything wrong in my setup or workflow, please let me know and share any suggestions or documentation links that could guide me to fix this issue.

Any workaround or official fix to persist this file between runs would be very helpful.

Thank you for your time and support.

Best regards,
Salimuddin07

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working.t-toolingIssues with this label are in the ownership of the tooling team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions