Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid ID pattern #332

Open
JBSullivan opened this issue Aug 3, 2023 · 6 comments
Open

Invalid ID pattern #332

JBSullivan opened this issue Aug 3, 2023 · 6 comments
Labels

Comments

@JBSullivan
Copy link

JBSullivan commented Aug 3, 2023

Seit der web Adapter Version 6.1.0 taucht bei mir die folgende Fehlermeldung auf. Das verwendete Skript "baut" mehrere Text Parameter zu einem Grafana Link zusammen und gibt diese Grafana Seite dann in einem inventwo Pop wieder. Das funktioniert seit mehr als 2 Jahren in der gleichen Form mit vielen anderen Links fehlerfrei.

Seit dem Adapter Update kommt es zu der folgenden Fehlermeldung im Admin. Die Grafana Seite wird aber in dem VIS PopUp korrekt angezeigt. Die eigentliche VIS Seite im Hintergrund "stürzt" aber ab (unter dem PopUp wird es Weiß und der drehende Verbindungs Kreis taucht auf)

image

Node 18.15.0
Admin 6.7.0
NPM 9.5.0
js-controller 5.0.9

`

web.0 2288 2023-08-03 10:09:12.831 info terminating
web.0 2288 2023-08-03 10:09:12.646 warn Terminated (UNCAUGHT_EXCEPTION): Without reason
web.0 2288 2023-08-03 10:09:12.645 info terminating
web.0 2288 2023-08-03 10:09:12.644 info terminated http server on port 8082
web.0 2288 2023-08-03 10:09:12.641 info <== Disconnect system.user.admin from ::ffff:10.122.60.92 energiefluss.0
web.0 2288 2023-08-03 10:09:12.632 info <== Disconnect system.user.admin from ::ffff:10.122.60.92 energiefluss.1
web.0 2288 2023-08-03 10:09:12.632 info <== Disconnect system.user.admin from ::ffff:10.122.60.92 vis.0
web.0 2288 2023-08-03 10:09:12.312 error Error The pattern "http://10.122.60.87:3000/d/y-NtFCqVz/luftqualitaet?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern
web.0 2288 2023-08-03 10:09:12.312 error ReplyError: Error The pattern "http://10.122.60.87:3000/d/y-NtFCqVz/luftqualitaet?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern at parseError (C:\ioBroker\GLT\node_modules\redis-parser\lib\parser.js:179:12) at parseType (C:\ioBroker\GLT\node_modules\redis-parser\lib\parser.js:302:14)
web.0 2288 2023-08-03 10:09:12.310 error unhandled promise rejection: Error The pattern "http://10.122.60.87:3000/d/y-NtFCqVz/luftqualitaet?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern
web.0 2288 2023-08-03 10:09:12.309 error 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().
host.GLT-Server   2023-08-03 10:09:12.305 warn States 127.0.0.1:65117 Error from InMemDB: Error: The pattern "http://10.122.60.87:3000/d/y-NtFCqVz/luftqualitaet?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern at Object.pattern2RegEx (C:\ioBroker\GLT\node_modules@iobroker\js-controller-common\src\lib\common\tools.ts:2472:15) at StatesInMemoryServer.handleSubscribe (C:\ioBroker\GLT\node_modules@iobroker\db-base\src\lib\inMemFileDB.ts:324:59) at StatesInMemoryServer._subscribeForClient (C:\ioBroker\GLT\node_modules@iobroker\db-states-file\src\lib\states\statesInMemFileDB.js:258:14) at RedisHandler. (C:\ioBroker\GLT\node_modules@iobroker\db-states-jsonl\src\lib\states\statesInMemServerRedis.js:395:26) at RedisHandler.emit (node:events:513:28) at RedisHandler.emit (node:domain:489:12) at Immediate._onImmediate (C:\ioBroker\GLT\node_modules@iobroker\db-base\src\lib\redisHandler.ts:209:37) at processImmediate (node:internal/timers:476:21)
javascript.0 8184 2023-08-03 10:09:12.111 info script.js.Aktiv.Grafana_Solar: http://10.122.60.87:3000/d/y-NtFCqVz/luftqualitaet?orgId=1&refresh=10s&from=now-24h&to=now&kiosk
`
@Apollon77
Copy link
Contributor

Thenn it seems to me that this binding is invalid because it requests the "http URL" as object id in the background whoch is anninvalid id. Yes it was working long time because js.controller did not hardly check such completely invalid Object IDs.

Please adjust the binding.

and/or make sure (I assume you use js.contrtoller 5? to also update all adapters to latest beta, because this crash should be fixed already

@JBSullivan
Copy link
Author

So, eben alles auf den aktuellsten Stand gebracht:

Node: 18.17.0
Npm: 9.6.7
Admin: 6.7.0
js-controller: 5.0.11
Web Adapter: 6.1.0

Die Frage ist, wo im Binding liegt der Fehler? Sind das die Sonderzeichen "_ -"? Das könnte schwierig werden, weil ein Teil der URL wird von Grafana selbstständig generiert ohne das ich da einen Einfluss drauf habe ( z.B. /y-NtFCqVz/.... ).

`

host.GLT   2023-08-03 12:40:53.379 error instance system.adapter.web.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
host.GLT   2023-08-03 12:40:53.378 error Caught by controller[0]: at parseType (C:\ioBroker\GLT\node_modules\redis-parser\lib\parser.js:302:14)
host.GLT   2023-08-03 12:40:53.378 error Caught by controller[0]: at parseError (C:\ioBroker\GLT\node_modules\redis-parser\lib\parser.js:179:12)
host.GLT   2023-08-03 12:40:53.378 error Caught by controller[0]: ?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern
host.GLT   2023-08-03 12:40:53.378 error Caught by controller[0]: ReplyError: Error The pattern "http://10.122.60.87:3000/d/_YPf3jtHz/frequenz-vergleich
host.GLT   2023-08-03 12:40:53.378 error Caught by controller[0]: 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(). The promise rejected with the reason:
web.0 9152 2023-08-03 12:40:52.359 error Error The pattern "http://10.122.60.87:3000/d/_YPf3jtHz/frequenz-vergleich ?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern
web.0 9152 2023-08-03 12:40:52.359 error ReplyError: Error The pattern "http://10.122.60.87:3000/d/_YPf3jtHz/frequenz-vergleich ?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern at parseError (C:\ioBroker\GLT\node_modules\redis-parser\lib\parser.js:179:12) at parseType (C:\ioBroker\GLT\node_modules\redis-parser\lib\parser.js:302:14)
web.0 9152 2023-08-03 12:40:52.353 error unhandled promise rejection: Error The pattern "http://10.122.60.87:3000/d/_YPf3jtHz/frequenz-vergleich ?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern
web.0 9152 2023-08-03 12:40:52.353 error 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().
web.0 9152 2023-08-03 12:38:33.438 error Invalid pattern on subscribe: The pattern "http://10.122.60.87:3000/d/86YdIsuVz/shelly-sumpfpumpe?orgId=1&refresh=10s&from=now-24h&to=now&kiosk" is not a valid ID pattern
 


`

@Apollon77
Copy link
Contributor

Apollon77 commented Aug 3, 2023

Wie lautet denn die objektID die da in dem Feld steht? Und man mus genau schauen eas das Widget tut... am ENd elandet wihl irgendwie die URL als Objekt ID und wird abgefragt

@JBSullivan
Copy link
Author

JBSullivan commented Aug 3, 2023

Was meinst du mit Objekt ID? Da kann ich jetzt nichts mit anfangen.

Das hier?

image

{ "common": { "name": "Grafana View URL", "role": "info.url", "type": "string", "read": true, "write": true, "def": "" }, "native": {}, "type": "state", "from": "system.adapter.javascript.0", "user": "system.user.admin", "ts": 1609532111027, "_id": "0_userdata.0.grafanaSolar.grafanaViewURL", "acl": { "object": 1636, "state": 1636, "owner": "system.user.admin", "ownerGroup": "system.group.administrator" } }

Und das ist das Blockly was aus den unterschiedlichen Pull Down Listeneinträgen eine URL zusammenbaut.

image

@Apollon77
Copy link
Contributor

Ok, dann wird scheinbar der WERT von dem "grafanaViewURL" state nochmal angefragt ... frage ist jetzt warum. Da muss jemand rander die bundungs besser versteht ... vllt @foxriver76 eine Idee?

@ahnungsbefreit
Copy link

Siehe auch meinen Comment hier: Scheint das selbe Problem zu sein, oder?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants