vespa
vespa copied to clipboard
Improve document API responses when modifying document type which is not assigned to any clusters
The document type system
is not assigned to any cluster. This gives the following responses:
➜ app git:(master) ✗ fcurl /document/v1/db/system/docid/7.230.4 -X PUT -d '{ "fields": { "name": {"assign": "main"} } }' | jq .
{
"errors": [
{
"description": "DOCUMENT_EXCEPTION Received unknown response: com.yahoo.documentapi.messagebus.protocol.DocumentIgnoredReply@40136140",
"id": -11
}
],
"id": "id:db:system::7.230.4",
"pathId": "/document/v1/db/system/docid/7.230.4"
}
➜ app git:(master) ✗ fcurl /document/v1/db/system/docid/7.230.4 -d '{ "fields":{ "name": "main" } }'| jq .
{
"id": "id:db:system::7.230.4",
"pathId": "/document/v1/db/system/docid/7.230.4"
}
➜ app git:(master) ✗ fcurl /document/v1/db/system/docid/7.230.4 | jq .
{
"errors": [
{
"description": "UNSPECIFIED com.yahoo.documentapi.DocumentAccessException: [UNKNOWN(251012) @ tcp/h22822a.prod.aws-us-east-1a.vespa.aws.oath.cloud:19109/default]: Unknown bucket space mapping for document type 'system' in id: 'id:db:system::7.230.4' \n\tat com.yahoo.documentapi.messagebus.MessageBusSyncSession.get(MessageBusSyncSession.java:148)\n\tat com.yahoo.documentapi.messagebus.MessageBusSyncSession.get(MessageBusSyncSession.java:133)\n\tat com.yahoo.document.restapi.OperationHandlerImpl.get(OperationHandlerImpl.java:292)\n\tat com.yahoo.document.restapi.resource.RestApi.handleGet(RestApi.java:266)\n\tat com.yahoo.document.restapi.resource.RestApi.handleInternal(RestApi.java:215)\n\tat com.yahoo.document.restapi.resource.RestApi.handle(RestApi.java:175)\n\tat com.yahoo.container.jdisc.ThreadedHttpRequestHandler.handle(ThreadedHttpRequestHandler.java:67)\n\tat com.yahoo.container.jdisc.ThreadedHttpRequestHandler.handleRequest(ThreadedHttpRequestHandler.java:80)\n\tat com.yahoo.container.jdisc.ThreadedRequestHandler$RequestTask.processRequest(ThreadedRequestHandler.java:189)\n\tat com.yahoo.container.jdisc.ThreadedRequestHandler$RequestTask.run(ThreadedRequestHandler.java:183)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)\n\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)\n\tat java.base/java.lang.Thread.run(Thread.java:834)\n",
"id": -15
}
],
"id": "id:db:system::7.230.4",
"pathId": "/document/v1/db/system/docid/7.230.4"
}
Most annoyingly the POST
operation (and the DocumentPut
) silently ignores the problem. The PUT
(DocumentUpdate
) could also provide a more comprehensive error message.