Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-9590

RESTv2 API fails with 500 error due to mangled timestamps

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 21.0.0
    • Fix Version/s: 21.0.0
    • Component/s: REST
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon - August 23rd

      Description

      Using Helm, I have a dashboard setup with 5 panels showing alarm data.
      When the dashboard is refreshed some of the panel show no data, or have a 500 error. Refreshing the dashboard again solves the problem.

      If I retry one of the same requests that failed using curl, the request works properly. It appears that the problem is only triggered when executing multiple requests simultaneously.

      Example failed request/response taken from packet capture:

      GET /opennms/api/v2/alarms?_s=alarmAckTime%3D%3D1970-01-01T00:00:00.000-0000;alarm.severity%3Dge%3DNORMAL;(node.label%3D%3D*sp01*;node.label%3D%3D*sp02*);(node.label%3D%3D*.asp*,node.label%3D%3D*sbx*);(lastEventTime%3Dge%3D2017-08-15T15:33:53.610-0000;lastEventTime%3Dle%3D2017-08-22T15:33:53.610-0000)&limit=0 HTTP/1.1
      Host: 127.0.0.1:8980
      User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063
      Accept: application/json
      Accept-Encoding: gzip, deflate
      Accept-Language: en-US
      Authorization: Basic YWRtaW46YWRtaW4=
      Referer: http://nms:3000/dashboard/db/dash?refresh=30s&orgId=1
      X-Forwarded-For: 192.168.1.100
      X-Grafana-Org-Id: 1
      
      HTTP/1.1 500 Server Error
      Date: Tue, 22 Aug 2017 15:33:53 GMT
      Content-Type: application/json
      Content-Length: 20
      Server: Jetty(9.4.0.v20161208)
      
      For input string: ""
      

      Replaying this the following command works successfully:

      curl -v -u admin:admin 'http://localhost:8980/opennms/api/v2/alarms?_s=alarmAckTime%3D%3D1970-01-01T00:00:00.000-0000;alarm.severity%3Dge%3DNORMAL;(node.label%3D%3D*sp01*;node.label%3D%3D*sp02*);(node.label%3D%3D*.asp*,node.label%3D%3D*sbx*);(lastEventTime%3Dge%3D2017-08-15T15:33:53.610-0000;lastEventTime%3Dle%3D2017-08-22T15:33:53.610-0000)&limit=0'
      

        Attachments

          Activity

            People

            • Assignee:
              seth Seth Leger
              Reporter:
              j-white Jesse White
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: