[NETCONF-646] Impossible to subscribe to RESTCONF notification stream due to error Created: 24/Oct/19 Updated: 08/Feb/21 Resolved: 08/Feb/21 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | Sodium, Sodium SR1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | High |
| Reporter: | Valentin Mayamsin | Assignee: | Sanjana Babu |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Description |
|
{"ietf-restconf-monitoring:access":[ ]}
curl -X GET http://localhost:8181/rests/data/ietf-restconf-monitoring:restconf-state/streams/stream=new-numbers/access=JSON/location
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 |
| Comments |
| Comment by Valentin Mayamsin [ 22/Jan/20 ] |
|
Confirmed bug with Sodium SR1
javax.servlet.ServletException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1 |
| Comment by Valentin Mayamsin [ 22/Jan/20 ] |
|
Also accessing 'location' without accessing 'streams' first causes NPE:
javax.servlet.ServletException: java.lang.NullPointerException |
| Comment by Jamo Luhrsen [ 06/Mar/20 ] |
|
Can you add the POST used to create this to start with? |
| Comment by Valentin Mayamsin [ 29/Apr/20 ] |
|
jluhrsen there is no POST, only GET. You can try with any stream you can find on curl -X GET http://localhost:8181/rests/data/ietf-restconf-monitoring:restconf-state/streams |
| Comment by Jamo Luhrsen [ 30/Apr/20 ] |
|
I can't reproduce this, can you help me. Since this was filed for Sodium, I took that main release and installed odl-restconf-all then doing a GET on http://controller-ip:8181/rests/data/ietf-restconf-monitoring:restconf-state/streams I get the below output <streams xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"> <stream> <name>replayComplete</name> <description>This notification is sent to signal the end of a replay portion of a subscription.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/nc-notifications:replayComplete/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/nc-notifications:replayComplete</location> </access> </stream> <stream> <name>netconf-config-change</name> <description>Generated when the NETCONF server detects that the <running> or <startup> configuration datastore has been changed by a management session. The notification summarizes the edits that have been detected. The server MAY choose to also generate this notification while loading a datastore during the boot process for the device.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-config-change/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-config-change</location> </access> </stream> <stream> <name>yang-library-change</name> <description>Generated when the set of modules and submodules supported by the server has changed.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-yang-library:yang-library-change/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-yang-library:yang-library-change</location> </access> </stream> <stream> <name>netconf-session-start</name> <description>Generated when a NETCONF server detects that a NETCONF session has started. A server MAY generate this event for non-NETCONF management sessions. Indicates the identity of the user that started the session.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-session-start/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-session-start</location> </access> </stream> <stream> <name>netconf-session-end</name> <description>Generated when a NETCONF server detects that a NETCONF session has terminated. A server MAY optionally generate this event for non-NETCONF management sessions. Indicates the identity of the user that owned the session, and why the session was terminated.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-session-end/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-session-end</location> </access> </stream> <stream> <name>netconf-confirmed-commit</name> <description>Generated when a NETCONF server detects that a confirmed-commit event has occurred. Indicates the event and the current state of the confirmed-commit procedure in progress.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-confirmed-commit/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-confirmed-commit</location> </access> </stream> <stream> <name>notificationComplete</name> <description>This notification is sent to signal the end of a notification subscription. It is sent in the case that stopTime was specified during the creation of the subscription..</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/nc-notifications:notificationComplete/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/nc-notifications:notificationComplete</location> </access> </stream> <stream> <name>netconf-capability-change</name> <description>Generated when the NETCONF server detects that the server capabilities have changed. Indicates which capabilities have been added, deleted, and/or modified. The manner in which a server capability is changed is outside the scope of this document.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-capability-change/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/ietf-netconf-notifications:netconf-capability-change</location> </access> </stream> <stream> <name>data-changed-notification</name> <description>Data change notification.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/sal-remote:data-changed-notification/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/sal-remote:data-changed-notification</location> </access> </stream> </streams> I just picked the first one listed 'replayComplete' and issued a GET to http://controller-ip:8181/rests/data/ietf-restconf-monitoring:restconf-state/streams/stream=replayComplete the output was fine: <stream xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"> <name>replayComplete</name> <description>This notification is sent to signal the end of a replay portion of a subscription.</description> <replay-support>true</replay-support> <access> <encoding>JSON</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/nc-notifications:replayComplete/JSON</location> </access> <access> <encoding>XML</encoding> <location>ws://127.0.0.1:8181/rests/notification-stream/nc-notifications:replayComplete</location> </access> </stream> I don't see the stream 'new-numbers', but guessing is that is from some test app you are working with. |
| Comment by Jamo Luhrsen [ 30/Apr/20 ] |
|
OH! the trick is adding /access=JSON/location ok, I can reproduce with that. |
| Comment by Jamo Luhrsen [ 01/May/20 ] |
|
This is a duplicate of master: https://git.opendaylight.org/gerrit/c/netconf/+/88873 |
| Comment by Tomas Cere [ 08/Feb/21 ] |
|
As jamo said, duplicate of https://jira.opendaylight.org/browse/NETCONF-663 |