HI :prefect: Team, I have some issues with cachi...
# ask-community
d
HI P Team, I have some issues with caching. I was told that "Failed tasks are not cached" . I think that a cache record is still made on the database even when the task run fails. My Case: Caching all responses from the API but the API isnt 100% reliable hence sometimes causes
requests.exceptions.ReadTimeout
Prefect attempts to cache this exception but Exceptions arent JSON serializable. So
Object of type \'ReadTimeout\' is not JSON serializable\n')
is raised. But Upon trying to retrigger the flow, this exception is raised
prefect.exceptions.MissingResult: The result was not persisted and is no longer available.
I guess there is a cache record on the database but the cache key is not available in the storage location because it failed while dumping to the storage.
Cant replicate the issue on a local server. Maybe this PR fixed it. https://github.com/PrefectHQ/prefect/pull/8922 How do i check the version of prefect on prefect cloud?
b
Hey @Deceivious, I'm not 100% sure how/if you can check the version on Prefect cloud, but you can run
prefect version
in your terminal to check what you're using in your environment
d
@Bianca Hoch but the caching is done on server side and the issue is dependent on the server side version
🤔 1
b
I believe cloud will always be using the latest version of server, so this PR should be applicable there. I'd recommend creating an issue and outlining the steps you're using to replicate against your local server and cloud.