Flask-Shell2HTTP
Flask-Shell2HTTP copied to clipboard
Seeing intermittent future_key errors
2023-04-25 23:12:39 ERROR:flask_shell2http:future_key ebbb407f already exists 2023-04-25 23:12:39 ERROR:flask_shell2http:No report exists for key: 'ebbb407f'.
These are interspersed with working calls.
I turned off wait=true
and switched to polling. This reduced the problem but didn't eliminate it.
Are there any docs on how to endure the key doesn't already exist? I don't believe I'm managing the keys externally to shell2http.
Thanks so much.
Hi. Can you tell the version of python and flask-shell2http being used and with what server is your flask code deployed?
Can you also tell if your client tries to execute same command with the same args
multiple times? If that is the case, you might want to set the force_unique_key
parameter to true
(see example).
Hint By default, the key is the SHA1 sum of the command + args POSTed to the API. This is done as a rate limiting measure so as to prevent multiple jobs with same parameters, if one such job is already running. If force_unique_key is set to true, the API will bypass this default behaviour and a psuedorandom key will be returned instead.
-- docs (see 2nd hint)
Ah this explains it. Yes, several calls with the same parameters are possible. I'll have a look at how to force_unique_key
. Thanks for the followup.