Error 404 - DeviceId not Found on Mesh device -- cannot delete device

Today, I setup a two hub mesh. One my main hub, I have everything defined, and I want to move all my networked devices over to the 2nd hub to try and relieve the issues on my hub. To test, I setup my Roku Connect, and Advanced Hue Hub integrations. After configuring them, I recreated the same devices on the new hub, and then I went to export them. The first set of devices I exported where the TVs. This did not seem to work, so I tried my custom hue devices. This time it did work, but not completely. If I go to the main hub, all my custom hue devices perform well at the devices pages, and state updates seem to be nearly instant.
When I navigate to any of the TV devices that I imported from the mesh settings, I get an invalid device ID error.

Error 404

deviceId was not found. com.github.jknack.handlebars.HandlebarsException: /templates/device/edit.hbs:542:103: java.lang.ArrayIndexOutOfBoundsException: 1 /templates/device/edit.hbs:542:103

The Page requested could not be found

I cannot open the device to get to a point where I can force remove it, and I do not have an option to delete them from the Hub Mesh tool either. I tried stopping the sharing of the device, and now they are removed in the "Link to remove devices" pull-down, but the mesh devices still remain, and still produce the same error.

I have tried a reboot, but that does not remove the devices (which now appear as offline).

I disabled hub mesh, and rebooted, and still the devices appear as linked devices. This however, allow me to now see them, and remove them one by one.

Q: How do I fix/ address this in the future?

Q: Another user reported this error in another thread -- is there anything in my custom code that may have caused the device ID failure issue?


There is an "unsafe" endpoint to deal with devices that just won't go away:


Replace number with device id from the URL that produces the 404, and use the endpoint to delete the device. There is no confirmation, it will happily delete anything, so take a backup first if unsure.

Roku is on of few devices that don't work well with hub mesh. Which hub (C3 or C7) gives the 404? I can check the logs, maybe there's a clue there.

C7 gives the error, and C3 is the host of the device. I am trying to move all network based integration to my old C3. But also, I just noticed other are trying to make my roku driver work the same way, and I really don't want to break things like this. I am happy to remove capabilities, or other things that may be the cause, to make this work.
I am wondering if it is related to the implementation of the new MediaTransport capability I implemented.

I know my source code looks like a mess -- at least by my coding standard that is -- but it should be solid. I started this when I knew nothing about Groovy, and very very little about how to write drivers. :slight_smile:

1 Like

@gopher.ny, how do I go about getting help from staff to resolve this? I have tried replacing the capability.TV with the attributes and commands -- no luck. Replacing the new capability.MediaTransport with the attributes and command -- nope. I don't think I am doing anything in the code that isn't already being done in numerous other drivers.

At this point, I am just disabling sections of code, to see if I can find the source of the issue.

For what it's worth, I am experiencing the same sort of issue. I am using the Unofficial Ring Connect driver on my C4 (where, like you, I am isolating cloud-based devices). The device works fine on the C4. I use Hub Mesh to share the device to my C7 where my Zigbee devices and most rule logic is housed, and on the C7 I get precisely the same java.lang.ArrayIndexOutOfBoundsException error message you do.

I was able to force delete the device from my C7, and then recreate it from Hub Mesh, but again get the java.lang.ArrayIndexOutOfBoundsException error message.

For my purposes, as a workaround, I created a virtual switch on the C4 that I share via Hub Mesh to the C7, and then have virtual switch sync with the lights on the Ring device. Kind of a kludge, and I am not handling race conditions properly, but it's working for me.

You're asking the right person - I'm the developer responsible for Hub Mesh.

It's going to come down to priorities, but I have a Roku and got your driver off GitHub to play with it. I know there is a handful of devices/drivers that Hub Mesh doesn't work well with. Hopefully, running this setup will uncover something actionable/fixable.

1 Like

ok. Last night I removed all references to Fields, and removed the imports and could not bypass the issue.

Download the Hubitat app