[NETCONF-341] Return status code 503 instead of 404 when a mountpoint is not mounted Created: 24/Jan/17 Updated: 21/Feb/21 Resolved: 21/Feb/21 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | None |
| Fix Version/s: | 1.13.0 |
| Type: | Bug | ||
| Reporter: | Vratko Polak | Assignee: | Iaroslav Kholiavko |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 7668 |
| Description |
|
Currently the returned status code is 404, which callers might understand as a confirmation that the resource is not present in the mounted datastore. But the resource might be in fact present in the datastore, just ODL cannot access the datastore this time. This distinction is important for CSIT to distinguish transient instability (for example in cluster High Availability testing) from really missing data. |
| Comments |
| Comment by Tomas Cere [ 12/Oct/17 ] |
|
I don't think there's any way to distinguish between these 2 cases. From restconf POV the mountpoint either is in the MountPointService or it's not. There's no way to tell whether some southbound plugin is configured to connect to a device and the mountpoint is temporarily unavailable. |
| Comment by Robert Varga [ 27/Aug/18 ] |
|
503 reflect the status of the resource: it is not available. |
| Comment by Vratko Polak [ 28/Aug/18 ] |
|
> 503 reflect the status of the resource: Do you mean "404"? > it is not available. Do you mean "not found"? I would understand if ODL removed the mountpoint when there is a problem accessing it (so 404 will be correct as the device is no longer mounted), but that was not what was happening in cluster tests, if I recall correctly. |
| Comment by Robert Varga [ 28/Aug/18 ] |
|
Sorry, my mistage, I misunderstood the headline. |
| Comment by Vratko Polak [ 18/Sep/20 ] |
|
Iaroslav notified me the current behavior is status code 409 Conflict, with: Here is my response, which I started to writes as a personal message, but then decided to put is here so it is tracked properly: Hmm, 4xx codes look better than 5xx codes, as it is (presumably) not ODL's fault the device is not connected yet. |
| Comment by Iaroslav Kholiavko [ 21/Sep/20 ] |
|
As I see in code: org/opendaylight/restconf/common/errors/RestconfError.java:115 This status code 409 was decided to use instead of 404 during discussions here: Also it is deprecated API. So I would prefer to leave as it.
Any way, according to existing code you can switch 409 to 404 by setting this property: org.opendaylight.restconf.eid5565
|
| Comment by Vratko Polak [ 21/Sep/20 ] |
|
> org/opendaylight/restconf/common/errors/RestconfError.java:115 Thanks for the pointer. Based on that, I can restate my intent: |
| Comment by Robert Varga [ 11/Nov/20 ] |
|
Ah, but RESTCONF obviously has no knowledge of how mountpoints come into existence, nor should it have – it can be SNMP, NETCONF, all sorts of implementations. It is just not feasible to understand that difference, as it implies a monolithic system. In request terms this maps most closely towards 502/504: we are acting as a proxy, but we did not even attempt to contact the upstream server. Hence I think RESOURCE_DENIED_TRANSPORT is correct in the specific case of the mount point not being found. |