grafana / iot-sitewise-datasource

IoT Sitewise
Apache License 2.0
19 stars 9 forks source link

Error 500 for "Get property value" using an alias on a disassociated stream, where the stream is of integer type #270

Closed gregbreen closed 6 months ago

gregbreen commented 6 months ago

What happened:

If I create a Get property value query type for a property/stream that is an integer (and the stream is disassociated), I suffer the following error:

Object
status:500
statusText:"Internal Server Error"
data:Object
message:"An error occurred within the plugin"
messageId:"plugin.downstreamError"
statusCode:500
traceID:""
config:Object
url:"api/ds/query"
method:"POST"
data:Object
requestId:"Q1326"
hideFromInspector:false
headers:Object
retry:0
message:"An error occurred within the plugin"

Pertinent points:

1) A Get property value by asset and property works. Query by alias works if the stream is associated, but not if disassociated. 2) Get property value history works just fine (for an integer data stream, and querying by alias on a disassociated stream). 3) If the data stream is of type double, Get property value works fine. 4) If I use the AWS CLI command aws iotsitewise get-asset-property-value --property-alias I can retrieve an integer value without issue. 5) The problem is also present on plugin versions 1.15.0 and 1.12.1. Possibly this issue is some special case of #228.

How to reproduce it (as minimally and precisely as possible):

Create a Stat panel and try to add a Get property value query for a disassociated integer data stream, and query by alias.

Environment:

gregbreen commented 6 months ago

Updated the description now that I test querying by asset and propoerty. That works. It only fails if I query by alias.

kevinwcyu commented 6 months ago

Hi @gregbreen, Unfortunately I've been unsuccessful in reproducing this.

Some additional questions I had:

gregbreen commented 6 months ago

Hi @kevinwcyu . Further experimentation shows that it's the intersection of these 4 things:

  1. Integer data stream
  2. Query by alias
  3. Get property by value
  4. Data stream is not associated (when I associate it to an asset, query by alias starts working).

Example alias/stream: ecowitt/raspberrypi4-ggv2/livedata/Indoor Humidity

Error message screenshot:

image

kevinwcyu commented 6 months ago

Hi @gregbreen, this should be available in 1.16.1 once https://github.com/grafana/iot-sitewise-datasource/pull/276 is approved for release.