grafana / iot-sitewise-datasource

IoT Sitewise
Apache License 2.0
18 stars 10 forks source link

What version of AWS SiteWise Edge requires 1.16.0 of iot-sitewise-datasource #361

Open misiek303 opened 1 month ago

misiek303 commented 1 month ago

I just installed the 1.16.0 ( iot-sitewise-datasource ) because it was the first version where "All " option was aded to get List associated assets.

Pulling associated asset of the parent asset works as expected. Image

This is a view in the SiteWise Console Image

Unfortunately, it does not pull the machine assets data Image

This is the SWE version Image

Any idea why I receive 400 code ?

Thanks

idastambuk commented 1 month ago

Hi @misiek303 is there a specific reason you're not upgrading to the latest version of the plugin, 1.25.0? There's been a few features/bugfixes since then that might have fixed your problem. Let us know if upgrading fixes it!

misiek303 commented 1 month ago

Yes, the very latest version does not pull the asset properties.

Image

idastambuk commented 1 month ago

@misiek303 I see there's an update available for you gateway components, can you do that and check?

misiek303 commented 1 month ago

I did update all components now to the latest, I checked with OpsHUB all good and nicely re-cached. But still don't see properties. Image

misiek303 commented 1 month ago

I also updated Grafana from 10.0 to 11.2.2. Still no properties.

misiek303 commented 1 month ago

Found this, maybe it will help . I am on 1.25.0 version currently.

Image

misiek303 commented 1 month ago

Looks like I have this problem https://github.com/grafana/iot-sitewise-datasource/issues/301

But it is happening on 1.25.0 version and all below untill 1.5.1. Very strange.

misiek303 commented 1 month ago

BTW, I connect to the EDGE, not cloud, maybe this has something todo

Image

idastambuk commented 1 month ago

Hi again @misiek303, can you copy and paste the query that returns the error? You can go to the query editor => QueryInspector => Query. You can remove all sensitive data of course. This should have been fixed in https://github.com/grafana/iot-sitewise-datasource/releases/tag/v1.17.0 so Im wondering if it didn't cover this specific query or something.

misiek303 commented 1 month ago

Hi again @misiek303, can you copy and paste the query that returns the error? You can go to the query editor => QueryInspector => Query. You can remove all sensitive data of course. This should have been fixed in https://github.com/grafana/iot-sitewise-datasource/releases/tag/v1.17.0 so Im wondering if it didn't cover this specific query or something.

I did that, and there is no output. I press the Refresh buttons and nothing happens

Image

When I select {} JSON -> Panel data, I can see that payload

{
  "state": "Done",
  "series": [],
  "annotations": [],
  "request": {
    "app": "explore",
    "timezone": "browser",
    "startTime": 1729295702230,
    "interval": "2s",
    "intervalMs": 2000,
    "panelId": 36291,
    "targets": [],
    "range": {
      "from": "2024-10-18T22:55:02.226Z",
      "to": "2024-10-18T23:55:02.226Z",
      "raw": {
        "from": "now-1h",
        "to": "now"
      }
    },
    "requestId": "explore_s03",
    "scopedVars": {
      "__interval": {
        "text": "2s",
        "value": "2s"
      },
      "__interval_ms": {
        "text": 2000,
        "value": 2000
      }
    },
    "maxDataPoints": 1643,
    "liveStreaming": false,
    "skipQueryCache": true,
    "endTime": 1729295702233
  },
  "timings": {
    "dataProcessingTime": 0
  },
  "graphFrames": [],
  "tableFrames": [],
  "logsFrames": [],
  "traceFrames": [],
  "nodeGraphFrames": [],
  "customFrames": [],
  "flameGraphFrames": [],
  "rawPrometheusFrames": [],
  "graphResult": null,
  "tableResult": null,
  "logsResult": null,
  "rawPrometheusResult": null
}

The DataFrame JSON (from Query) contains no data.

misiek303 commented 1 month ago

Is there anything I can do to help troubleshoot ? We can arrange a call as well.

idastambuk commented 1 month ago

Hi @misiek303 sorry about, that - since it seems that what's failing is a resource call, it won't be available in the query inspector. Can you instead copy the payload from the Network tab for the query call that's failing?

misiek303 commented 1 month ago

This is the payload of respond - not a lot of in there.

{"results":{"listAssetProperties":{"error":"failed to fetch query data: : Unknown Operation\n\tstatus code: 404, request id: ","errorSource":"","status":500,"frames":[]}}}

I think this contains everything

{
  "log": {
    "version": "1.2",
    "creator": {
      "name": "Firefox",
      "version": "130.0.1"
    },
    "browser": {
      "name": "Firefox",
      "version": "130.0.1"
    },
    "pages": [
      {
        "id": "page_2",
        "pageTimings": {
          "onContentLoad": -1,
          "onLoad": -1
        },
        "startedDateTime": "2024-10-21T13:11:24.743-05:00",
        "title": "http://localhost:3000/explore?schemaVersion=1&panes=%7B%22f2h%22%3A%7B%22datasource%22%3A%22dede5978-d7b3-4e10-8748-bf0de135c680%22%2C%22queries%22%3A%5B%7B%22refId%22%3A%22A%22%2C%22datasource%22%3A%7B%22type%22%3A%22grafana-iot-sitewise-datasource%22%2C%22uid%22%3A%22dede5978-d7b3-4e10-8748-bf0de135c680%22%7D%2C%22maxPageAggregations%22%3A1%2C%22flattenL4e%22%3Atrue%2C%22clientCache%22%3Atrue%7D%5D%2C%22range%22%3A%7B%22from%22%3A%22now-1h%22%2C%22to%22%3A%22now%22%7D%7D%7D&orgId=1"
      }
    ],
    "entries": [
      {
        "startedDateTime": "2024-10-21T13:11:24.743-05:00",
        "request": {
          "bodySize": 311,
          "method": "POST",
          "url": "http://localhost:3000/api/ds/query?ds_type=grafana-iot-sitewise-datasource&requestId=iot.1034",
          "httpVersion": "HTTP/1.1",
          "headers": [
            {
              "name": "Host",
              "value": "localhost:3000"
            },
            {
              "name": "User-Agent",
              "value": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0"
            },
            {
              "name": "Accept",
              "value": "application/json, text/plain, */*"
            },
            {
              "name": "Accept-Language",
              "value": "en-US,en;q=0.5"
            },
            {
              "name": "Accept-Encoding",
              "value": "gzip, deflate, br, zstd"
            },
            {
              "name": "Referer",
              "value": "http://localhost:3000/explore?schemaVersion=1&panes=%7B%22f2h%22%3A%7B%22datasource%22%3A%22dede5978-d7b3-4e10-8748-bf0de135c680%22%2C%22queries%22%3A%5B%7B%22refId%22%3A%22A%22%2C%22datasource%22%3A%7B%22type%22%3A%22grafana-iot-sitewise-datasource%22%2C%22uid%22%3A%22dede5978-d7b3-4e10-8748-bf0de135c680%22%7D%2C%22maxPageAggregations%22%3A1%2C%22flattenL4e%22%3Atrue%2C%22clientCache%22%3Atrue%7D%5D%2C%22range%22%3A%7B%22from%22%3A%22now-1h%22%2C%22to%22%3A%22now%22%7D%7D%7D&orgId=1"
            },
            {
              "name": "content-type",
              "value": "application/json"
            },
            {
              "name": "x-datasource-uid",
              "value": "dede5978-d7b3-4e10-8748-bf0de135c680"
            },
            {
              "name": "x-grafana-device-id",
              "value": "67fa8e25219e315343d2296485ee3c93"
            },
            {
              "name": "x-grafana-org-id",
              "value": "1"
            },
            {
              "name": "x-plugin-id",
              "value": "grafana-iot-sitewise-datasource"
            },
            {
              "name": "Content-Length",
              "value": "311"
            },
            {
              "name": "Origin",
              "value": "http://localhost:3000"
            },
            {
              "name": "Connection",
              "value": "keep-alive"
            },
            {
              "name": "Cookie",
              "value": "grafana_session=a7469e41ac6d11cb20ba3136f7b7a785; grafana_session_expiry=1729534757"
            },
            {
              "name": "Sec-Fetch-Dest",
              "value": "empty"
            },
            {
              "name": "Sec-Fetch-Mode",
              "value": "cors"
            },
            {
              "name": "Sec-Fetch-Site",
              "value": "same-origin"
            },
            {
              "name": "Priority",
              "value": "u=0"
            },
            {
              "name": "Pragma",
              "value": "no-cache"
            },
            {
              "name": "Cache-Control",
              "value": "no-cache"
            }
          ],
          "cookies": [
            {
              "name": "grafana_session",
              "value": "a7469e41ac6d11cb20ba3136f7b7a785"
            },
            {
              "name": "grafana_session_expiry",
              "value": "1729534757"
            }
          ],
          "queryString": [
            {
              "name": "ds_type",
              "value": "grafana-iot-sitewise-datasource"
            },
            {
              "name": "requestId",
              "value": "iot.1034"
            }
          ],
          "headersSize": 1332,
          "postData": {
            "mimeType": "application/json",
            "params": [],
            "text": "{\"queries\":[{\"refId\":\"listAssetProperties\",\"queryType\":\"ListAssetProperties\",\"assetId\":\"cd594023-fa12-4256-aa1e-d3f526993f9f\",\"region\":\"Edge\",\"propertyAlias\":\"\",\"propertyId\":\"\",\"assetIds\":[],\"datasource\":{\"type\":\"grafana-iot-sitewise-datasource\",\"uid\":\"dede5978-d7b3-4e10-8748-bf0de135c680\"},\"datasourceId\":1}]}"
          }
        },
        "response": {
          "status": 400,
          "statusText": "Bad Request",
          "httpVersion": "HTTP/1.1",
          "headers": [
            {
              "name": "Cache-Control",
              "value": "no-store"
            },
            {
              "name": "Content-Type",
              "value": "application/json"
            },
            {
              "name": "X-Content-Type-Options",
              "value": "nosniff"
            },
            {
              "name": "X-Frame-Options",
              "value": "deny"
            },
            {
              "name": "X-Xss-Protection",
              "value": "1; mode=block"
            },
            {
              "name": "Date",
              "value": "Mon, 21 Oct 2024 18:11:24 GMT"
            },
            {
              "name": "Content-Length",
              "value": "172"
            }
          ],
          "cookies": [],
          "content": {
            "mimeType": "application/json",
            "size": 172,
            "text": "{\"results\":{\"listAssetProperties\":{\"error\":\"failed to fetch query data: : Unknown Operation\\n\\tstatus code: 404, request id: \",\"errorSource\":\"\",\"status\":500,\"frames\":[]}}}\n"
          },
          "redirectURL": "",
          "headersSize": 232,
          "bodySize": 404
        },
        "cache": {},
        "timings": {
          "blocked": -1,
          "dns": 0,
          "connect": 0,
          "ssl": 0,
          "send": 0,
          "wait": 6,
          "receive": 0
        },
        "time": 6,
        "_securityState": "insecure",
        "serverIPAddress": "127.0.0.1",
        "connection": "3000",
        "pageref": "page_2"
      }
    ]
  }
}

Message

XHRPOST
http://localhost:3000/api/ds/query?ds_type=grafana-iot-sitewise-datasource&requestId=iot.1037
[HTTP/1.1 400 Bad Request 8ms]

POST
    http://localhost:3000/api/ds/query?ds_type=grafana-iot-sitewise-datasource&requestId=iot.1037
Status
400
Bad Request
VersionHTTP/1.1
Transferred404 B (172 B size)
Referrer Policystrict-origin-when-cross-origin
Request PriorityHighest
DNS ResolutionSystem

error reading asset info asset properties not found PropertyQueryEditor.tsx:74:16
misiek303 commented 1 month ago

Is there anything I can do to speed up the troubleshooting. I really need to get this going, my plant is down with that reason.

idastambuk commented 1 month ago

Hi @misiek303 we're checking whether this change might have broken the Edge functionality. In the meantime, if you manually input the property ID and run the query, do you get data back? I understand this is inconvenient, but we appreciate the patience until we get confirmation.

misiek303 commented 1 month ago

Manually specifying the property ID does not work either.

Image

misiek303 commented 1 month ago

Just following up. Have you had a chance to troubleshoot ? - Can you please tell me the potential ETA. It is a blocker for my company to finish the dashboards. Thank you

misiek303 commented 1 week ago

Hi. Could you please give me an update on the following issue ?

hwandersman commented 6 days ago

The AWS IoT SiteWise team will assign someone to help you with this task soon, and provide an ETA by Dec 5 2024.