{"record":{"id":"af810ab2f902b0dc","repo":"invoke-ai/InvokeAI","slug":"error-setting-recall-parameter-param-key","errorCode":null,"errorMessage":"Error setting recall parameter {param_key}","messagePattern":"Error setting recall parameter (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"invokeai/app/api/routers/recall_parameters.py","lineNumber":493,"sourceCode":"        else:\n            provided_params = {k: v for k, v in parameters.model_dump().items() if v is not None}\n\n        if not provided_params:\n            return {\"status\": \"no_parameters_provided\", \"updated_count\": 0}\n\n        # Store each parameter in client state scoped to the current user\n        updated_count = 0\n        for param_key, param_value in provided_params.items():\n            # Convert parameter values to JSON strings for storage\n            value_str = json.dumps(param_value)\n            try:\n                ApiDependencies.invoker.services.client_state_persistence.set_by_key(\n                    current_user.user_id, f\"recall_{param_key}\", value_str\n                )\n                updated_count += 1\n            except Exception as e:\n                logger.error(f\"Error setting recall parameter {param_key}: {e}\")\n                raise HTTPException(\n                    status_code=500,\n                    detail=f\"Error setting recall parameter {param_key}\",\n                )\n\n        logger.info(f\"Updated {updated_count} recall parameters for queue {queue_id}\")\n\n        # Resolve model name to key if a model was provided\n        if \"model\" in provided_params and isinstance(provided_params[\"model\"], str):\n            model_name = provided_params[\"model\"]\n            model_key = resolve_model_name_to_key(model_name, ModelType.Main)\n\n            if model_key:\n                logger.info(f\"Resolved model name '{model_name}' to key '{model_key}'\")\n                provided_params[\"model\"] = model_key\n            else:\n                logger.warning(f\"Could not resolve model name '{model_name}' to a model key\")\n                # Remove model from parameters if we couldn't resolve it\n                del provided_params[\"model\"]","sourceCodeStart":475,"sourceCodeEnd":511,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/app/api/routers/recall_parameters.py#L475-L511","documentation":"HTTP 500 raised when persisting an individual recall parameter via client_state_persistence.set_by_key throws (storage backend failure, serialization problem, etc.). The failure is logged with the underlying exception and the endpoint aborts with a generic detail naming the offending parameter key.","triggerScenarios":"POST /api/v1/recall_parameters/{queue_id} where client state storage (persistence service/database) fails for a given recall_{param_key}: storage down, DB locked/misconfigured, oversized or unserializable value_str, or a state-store schema issue.","commonSituations":"SQLite file locked by another process; disk full or permissions issue on the state store; very large recall values exceeding storage limits; degraded database after an upgrade.","solutions":["Check the server log — the underlying exception is logged as 'Error setting recall parameter {param_key}: {e}'","Verify the client-state persistence backend (e.g. SQLite file) is writable and not locked","Retry the request — the error is per-parameter and may be transient","Reduce/sanitize the value being recalled if it is unusually large or malformed","Confirm no recent schema migration left the state store incompatible"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-flight: ensure the state store backend is reachable/writable\n// (server-side check example)\nif not os.access(state_db_path, os.W_OK):\n    raise RuntimeError('client state store not writable')","typeGuard":null,"tryCatchPattern":"try {\n  await api.recallParameters(queueId, params);\n} catch (e) {\n  if (e.status === 500 && /Error setting recall parameter/.test(e.body?.detail ?? '')) {\n    await sleep(1000);\n    await api.recallParameters(queueId, params); // retry transient storage failure\n  } else throw e;\n}","preventionTips":["Monitor disk space and file locks on the client-state persistence store","Keep recall values small and serializable","Add a brief retry with backoff for transient storage errors","Check state-store health after upgrades/migrations"],"tags":["http-500","persistence","client-state"],"backgroundTag":"state-store-write-failed","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}