apify-sdk-python icon indicating copy to clipboard operation
apify-sdk-python copied to clipboard

Actor input via CLI is not reloaded on the second run

Open vdusek opened this issue 2 months ago • 2 comments

Description

  • When running an Apify Actor twice in a row using apify run -i 'some input', the first execution works as expected, but the second one fails to load the input - it returns None.
  • It appears that metadata files from the previous run remain in local storage, preventing the new input from being correctly loaded.

Reproduction

import asyncio
from apify import Actor

async def main() -> None:
    async with Actor:
        actor_input = await Actor.get_input()
        Actor.log.info(f'Input: {actor_input}')

if __name__ == '__main__':
    asyncio.run(main())
uv run apify run -i '{ "days_reminder_long": 2000, "days_reminder_short": 2000, "days_urgent": 2000 }'
uv run apify run -i '{ "days_reminder_long": 2000, "days_reminder_short": 2000, "days_urgent": 2000 }'

Expected behavior

  • Each run should receive the provided input, regardless of previous executions.

Actual behavior

  • First run works correctly and logs the input.
  • Second run logs Input: None.
  • It seems that leftover metadata files from the first run are not cleared and interfere with input loading.

vdusek avatar Oct 08 '25 12:10 vdusek

Investigated - the issue originates in the CLI. Closing in favor of apify/apify-cli#933.

vdusek avatar Oct 09 '25 14:10 vdusek

This issue is caused by a misaligned CLI and the storage client. Re-opening with a potential fix prepared

Pijukatel avatar Nov 11 '25 15:11 Pijukatel

Should be solved by https://github.com/apify/apify-sdk-python/pull/677

Pijukatel avatar Dec 01 '25 10:12 Pijukatel