Repository navigation
UN-1412 [FIX] Mirror API deployment execute errors into message.error - #2334
Merged
Merged
Conversation
Every 4xx/5xx raised on the deployment execute and status endpoints now
also carries {"message": {"execution_status": "ERROR", "error": ...}},
the key successful and failed executions already use. The existing
type/errors keys and status codes are unchanged, so clients parsing them
keep working.
…nt error text On GET, message is the result payload and the published Python client copies it out as extraction_result, so an error block there would read as a result. Limit the message block to the execute endpoint and its spec, and join details without attr, as the client already renders a refused request.
|
Contributor
|
Contributor
Unstract test resultsPer-group results
Critical paths
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
POST /deployment/api/<org>/<api>/) now also carriesmessage: {"execution_status": "ERROR", "error": "<text>"}, the slot successful and failed executions already report in.type/errorskeys and every status code stay exactly as they are. This is additive only.GET ...?execution_id=) is deliberately left untouched (see Why).DeploymentErrorResponse.Why
message.erroron an execution failure buttype/errorson a rejected request (bad key, validation, 404, 429...), so it can't handle errors generically. QA re-opened the ticket on v0.173.1 with theUnauthorizedbody.{"error": "... is not a valid UUID."}body from the ticket no longer happens: a malformed key already returns the same 401 body as an unknown key.messageis the result.unstract-python-clientcopies it intoextraction_resultwithout checking (client.py,body.get("message", "")). An error block there would be reported to callers as an extraction result.How
DeploymentExecution.handle_exceptionadds the block to the exception handler's body on POST only (api_v2/error_message.py).message.errorjoins thedetails with;and leaves outattr. That is exactly how the published client already renders a refused request, so the error text callers see doesn't change.messagekey is never overwritten.DeploymentAutoSchemarewrites the injected handler examples on execute so they match the new schema. The status operation keepsErrorResponse.Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
type,errors, status codes, the 200 body and the 422/500 execution bodies are byte-for-byte unchanged. Tests compare the response with what the project-wide handler alone produces.execution_statusfield is now"ERROR"(it was""). Theerrortext is the same. The client'spendinglogic only runs for 2xx, so polling behaviour doesn't change.DeploymentErrorResponseschema for execute errors. The downstream client/CLI regeneration should pick it up.list_deployments, whoami, highlight, MCP, pipeline API).Database Migrations
Env Config
Relevant Docs
specs/docstudio-oss.jsonregenerated (generate_docstudio_spec --checkpasses)Related Issues or PRs
Dependencies Versions
Notes on Testing
api_v2/tests/test_deployment_error_message.py), all throughDeploymentExecution.as_view():messagerequiredfields match what the view sendstest_deployment_auth.py(integration) now also assertsmessageon each real rejection: unknown key, non-UUID key, inactive key, wrong API, wrong org.deepak-unstract-dev) with real requests:type/errorsunchanged +message.error = "Unauthorized"{"error": "... not a valid UUID"})Authorizationmessage.error = "Missing api key"message.error = "You must provide at least one file or presigned URL."timeout=9999message.error = "Ensure this value is less than or equal to 300."message.error = "API not found"message.error = "Invalid deployment api path"execution_id, unlisted pathmessage{"message": {execution_id, execution_status: "PENDING", status_api, ...}}{"status": "PENDING", "message": null}Screenshots
Checklist
I have read and understood the Contribution Guidelines.