[NETCONF-542] PUT request return 500 if operational data are used Created: 04/May/18 Updated: 15/Mar/19 Resolved: 06/Aug/18 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | netconf, restconf-nb |
| Affects Version/s: | Oxygen |
| Fix Version/s: | Oxygen SR2, Fluorine |
| Type: | Bug | Priority: | Medium |
| Reporter: | Jakub Toth | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
If we are sending operational data using PUT request on device via mountpoint we expect 400 bad-request but we receive 500 instead. Example request BODY:
{
"toaster": {
"darknessFactor": 200,
"toasterModelNumber" : "asdfe"
}
}
toasterModelNumber is nonConfig data so I expect 400 bad request answer but instead I receive
{
"ietf-restconf:errors": {
"error": [
{
"error-message": "Transaction(PUT) not committed correctly",
"error-tag": "operation-failed",
"error-type": "application"
}
]
}
}
This is caused by netconf sb AbstractWriteTx class resultsToTxStatus method always changes data to same exception new NetconfDocumentedException(id + ":RPC during tx failed", DocumentedException.ErrorType.APPLICATION, DocumentedException.ErrorTag.OPERATION_FAILED, DocumentedException.ErrorSeverity.ERROR); and restconf FutureCallbackTx in method addCallback it always changes to new RestconfDocumentedException("Transaction(" + txType + ") not committed correctly", e); or
RpcResultBuilder.newError(RpcError.ErrorType.RPC, "operation-failed", e.getMessage())
but we alway loose error type and error tag. |
| Comments |
| Comment by Jakub Morvay [ 06/Aug/18 ] |
|
stable/oxygen fix: master fix: |