Skip to content

[bug]: JS-Controller crash on Alias conversion #3031

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

Open
1 task done
KlausStoertebeker opened this issue Mar 13, 2025 · 5 comments
Open
1 task done

[bug]: JS-Controller crash on Alias conversion #3031

KlausStoertebeker opened this issue Mar 13, 2025 · 5 comments
Labels

Comments

@KlausStoertebeker
Copy link

KlausStoertebeker commented Mar 13, 2025

No existing issues.

  • There is no existing issue for my problem.

Description

As requested by apollon77 in this post, here the error messages in my ioBroker-log for further investigation:

2025-03-13 03:00:36.418 - error: host.Nordmanns-Raspberry-Pi5 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:
2025-03-13 03:00:36.419 - error: host.Nordmanns-Raspberry-Pi5 Caught by controller[1]: TypeError: Cannot read properties of undefined (reading 'toString')
2025-03-13 03:00:36.419 - error: host.Nordmanns-Raspberry-Pi5 Caught by controller[1]: at applyAliasConvenienceConversion (/opt/iobroker/node_modules/@iobroker/js-controller-common-db/src/lib/common/aliasProcessing.ts:78:30)
2025-03-13 03:00:36.419 - error: host.Nordmanns-Raspberry-Pi5 Caught by controller[1]: at Object.formatAliasValue (/opt/iobroker/node_modules/@iobroker/js-controller-common-db/src/lib/common/tools.ts:2753:17)
2025-03-13 03:00:36.419 - error: host.Nordmanns-Raspberry-Pi5 Caught by controller[1]: at change (/opt/iobroker/node_modules/@iobroker/js-controller-adapter/src/lib/adapter/adapter.ts:11007:37)
2025-03-13 03:00:36.419 - error: host.Nordmanns-Raspberry-Pi5 Caught by controller[1]: at Immediate. (file:///opt/iobroker/node_modules/@iobroker/db-states-redis/src/lib/states/statesInRedisClient.ts:370:37)
2025-03-13 03:00:36.419 - error: host.Nordmanns-Raspberry-Pi5 Caught by controller[1]: at processImmediate (node:internal/timers:483:21)
{1}

Reproduction instruction

The source of this error is unknown, so this is not reproduceable

JS-controller version

7.0.6

Node version

20.18.3

@Apollon77 Apollon77 changed the title [bug]: Error in ioBroker-Forum context "No further triggers" for further investigation [bug]: JS-Controller crash on Alias conversion Mar 13, 2025
@Apollon77
Copy link
Collaborator

@KlausStoertebeker Any idea which alias it could have been? Do you use any logics on the Aliases?

@KlausStoertebeker
Copy link
Author

Hi Apollon77,
in the moment I'm a little bit desprate because during last week I did a complete new setup of ioBroker on a clean operating system (Ubuntu 24.04 Server on a Raspberry Pi4B with 8GByte of RAM) from scratch.
I didn't restored a backup to ensure that there are no errors caused by errornous backup data.
Although I only installed those adapters I really need (no instances in "cold standby").
Then I started all but the javascript adapter to ensure that all objects has valid data before starting the javascript adapter.
I then created all the aliases manually - also those ones which will contain datapoints of new shelly devices (connected via MQTT) that are not included yet.
Furthermore I controlled EVERY alias datapoint if it has a target. And if it doesn't have one, I assigned a dummy object containing dummy data in the mandatory format (e.g. MQTT JSON-data for those empty aliases).
After that I created TWO blockly scripts which are time triggered (sun raise and sun set) and which should open and close my blinds.
And you won't believe it: THEY WORKED - once :-(
Because after creating all those other blockly scripts and starting them one by one in the script editor (I put every script I started into the blockly editor to see if there were errors when starting it) the trigger mechanism was dead as on my old ioBroker installation :-(
When I started the blockly scripts, I noticed that they all did subscriptions but doesn't throw any errors - only time triggered scripts produced errors during start up...
I have to add that I can set every data point directly via the admin UI...
When I'm at home I'll set the logging of the admin and javascript adapter to debug mode and then will post them here...

@KlausStoertebeker
Copy link
Author

And YES, in my aliases I use the Java script functions "parse" and "stringify" to covert from and to JSON formatted MQTT messages.

@Apollon77
Copy link
Collaborator

@KlausStoertebeker But please lets not mix topics now. This issue is a iut the one alias issue and not about the issues in your javascript instance.

@KlausStoertebeker
Copy link
Author

Hi Apollon77,
unfortunately I can't tell you which alias caused the exception. As I told you before I did a complete new ioBroker installation from scratch and assigned dummy data to all alias data points which do not have a "real" target.
So I can't reproduce the error. And there haven't been a crash since then - sorry

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

2 participants