Howdy, We are getting this recently. We are not pe...
# ask-community
b
Howdy, We are getting this recently. We are not persisting. Any suggestions on troubleshooting this?
Copy code
prefect.exceptions.MissingResult: State data is missing. Typically, this occurs when result persistence is disabled and the state has been retrieved from the API.
Finished in state Failed('Flow run encountered an exception. MissingResult: State data is missing. Typically, this occurs when result persistence is disabled and the state has been retrieved from the API.')
j
hey! could you share some more information about when you started to see this occur? Is it reproducible? Additionally could you share your workspace id and an example flow run id where this occurs?
v
Hello! Also faced this problem. In my case, the cure was:
Copy code
@task(
    # cache_key_fn=task_input_hash
)
But it is still not clear what updates on the night of May 2 to 3 caused this
b
+1 Also seeing this, here’s a MRE:
Copy code
def test_missing_result():
    # Arrange
    from prefect import task
    from prefect.tasks import task_input_hash

    @task(
        persist_result=True,
        cache_key_fn=task_input_hash,
    )
    def fail_task():
        return {"hello": "world"} # Force a PersistedResult

    @flow()
    def fail_flow(refresh: bool):
        f = fail_task.with_options(refresh_cache=refresh).submit()
        return f.result(raise_on_failure=False)

    # Act
    first_result = fail_flow(refresh=True)
    second_result = fail_flow(refresh=False) # < --- fails here trying to read from cache

    # Assert
    assert first_result == {"hello": "world"}
    assert first_result == second_result
👀 1
j
Hi, thanks for the repro will take a look