HTTP 500 when getting devices status

Hello,

We are developing project which is currently using about 500 devices. The status of devices is being refreshed in some periodic jobs, so during 24h there are a lot of requests. Unfortunately we noticed that sometimes (4-7 occurences during 24hours) there appeares
HTTP 500 {“code”:“UnexpectedError”,“message”:“A non-recoverable error condition
occurred.”,“details”:} when getting status of devices.

What I noticed, all problems concerns only devices that are connected via some hub. Anybody know what could be the reason that sometimes Smartthings is returning this error ? I will be very appreciate for any help.

Hi, @PeterK. Welcome to the SmartThings Community!
Can you provide more details about your integration, please?

  1. I’m guessing you’re working with an OAuth integration to make requests to the API, is that right?
  2. Do the 500 devices you mention belong to a single user? Because that’s above the limit allowed
  3. Are you querying the device’s status every specific amount of time as you mentioned every 24 hours there are a lot of requests. Is there a reason for you to pull the device status periodically instead of using Subscriptions to get status updates?
  4. When the issue happens, the request or the environment hasn’t changed, I mean it’s the same account, the same devices, etc.

Yes

No, it belongs to different users.

We are partly using subscriptions, but most of info about devices status we are still getting by periodic requests using standard API (https://api.smartthings.com/v1/devices/{deviceId}/status). It is big project that was started a long time ago, before subscriptions were possible and currently when we tried to implement subscriptions in full scope, our devops were worried about big amount of events comming from SmartThings. Apart from it, there were problems with some devices (don’t know why, but changing status of some devices was not generating events)… so finally we are still using simple getting statuses by REST API.

Yes, it was not changed. It was the same envoronment, same devices. It was not deterministic. For example we had device X for which we were getting status without any problem for 24hours but there were 2-3 moments when we got mentioned response 500 from SmartThings.

What I noticed last time, that all devices for which appears this problem are some sensors that are connected via Hub

ok, then, we need the following info to create a report for the engineering team’s investigation, please:

  1. App ID of your OAuth access app (the one you can see in the Dev Workspace or the API)
  2. If it happens with specific devices, we would need their Device IDs
  3. Timestamp of when the error happened including your timezone like GMT-6 to find the related logs.