Special Characters in Player names make the plugin crash
Hi, I use the UPNP-bridge plugin on the LMS and every new UPNP device on the network will automatically appear as player in the Logitech Media Server. The names are automatically created by the UPNP device. Some device manufacturers have certain naming conventions. For example LG TVS are named like [TV][LG]LG_xxxxx . The special characters let the iobroker squeezeboxrpc plugin crash as long as the device is present. It would be great if the plugin would be more tolerant in regard to the naming of players in LMS. Thanks Ingo
Is the Adapter on iobroker crashing? Or the use of A Widget in the Browser? Can you please provide a log in silly Mode. This Mode you have to enable additionaly in the Adapter Settings. If a Widget crash a Browser tab please provide a log from the Browsers Developer Tools console
Adapter throws a lot of invalid id exceptions and stops . It's easy to recreate, just change a name of a player in LMS to something like [Test]Test and see the adapter stop working. Here an extract of the logfile.
The main log message is: instance system.adapter.squeezeboxrpc.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
and the details are:
2023-02-21 18:33:44.027 - error: squeezeboxrpc.0 (409498) unhandled promise rejection: Invalid ID: squeezeboxrpc.0.Players.[Hier]Marshallradio.Playername
2023-02-21 18:33:44.030 - error: squeezeboxrpc.0 (409498) Error: Invalid ID: squeezeboxrpc.0.Players.[Hier]Marshallradio.Playername at Object.maybeCallbackWithError (/opt/iobroker/node_modules/@iobroker/js-controller-common/lib/common/tools.js:2973:17) at ObjectsInRedisClient._setObject (/opt/iobroker/node_modules/@iobroker/db-objects-redis/lib/objects/objectsInRedisClient.js:2980:26) at Immediate. (/opt/iobroker/node_modules/@iobroker/db-objects-redis/lib/objects/objectsInRedisClient.js:3211:29) at processImmediate (node:internal/timers:468:21) 2023-02-21 18:33:44.032 - error: squeezeboxrpc.0 (409498) Invalid ID: squeezeboxrpc.0.Players.[Hier]Marshallradio.Playername 2023-02-21 18:33:44.035 - error: squeezeboxrpc.0 (409498) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). 2023-02-21 18:33:44.036 - error: squeezeboxrpc.0 (409498) unhandled promise rejection: Invalid ID: squeezeboxrpc.0.Players.[Hier]Marshallradio.PlayerID 2023-02-21 18:33:44.037 - error: squeezeboxrpc.0 (409498) Error: Invalid ID: squeezeboxrpc.0.Players.[Hier]Marshallradio.PlayerID at Object.maybeCallbackWithError (/opt/iobroker/node_modules/@iobroker/js-controller-common/lib/common/tools.js:2973:17) at ObjectsInRedisClient._setObject (/opt/iobroker/node_modules/@iobroker/db-objects-redis/lib/objects/objectsInRedisClient.js:2980:26) at Immediate. (/opt/iobroker/node_modules/@iobroker/db-objects-redis/lib/objects/objectsInRedisClient.js:3211:29) at processImmediate (node:internal/timers:468:21)
Ah ok. There ist the Problem https://forum.iobroker.net/topic/32605/erlaubte-zeichen-in-id-s
I Must sanitize the Name for invalid characters
Or use the MAC address (without the :) as top player element and put the name in the name field and as additional sub element. That is how most other adapter do it now… Thank you for looking…
fixed with v1.3.11