[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

PATH:
https://0.0.0.0:8888/restconf/data/network-topology:network-topology/topology=topology-netconf/node=Node2/yang-ext:mount/toaster:toaster

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:
https://git.opendaylight.org/gerrit/#/c/71989/

master fix:
https://git.opendaylight.org/gerrit/#/c/72446/

Generated at Wed Feb 07 20:15:17 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.