[SOLVED] OH3 Issue - "Model" Page endless loading - Maximum call stack size exceeded in app.js

Right after migration it worked for 2 days. The issue came up after I started editing some objects in the model page.
So I’m not sure if it is directly related to the migration.

The issue is solved for me. In my case the browser was the problem.

I had the described problems with Safari 11 on my old MacBook. Once I tried a modern browser everything worked fine.

Unfortunately this does not solve the issue in my case.

I tried

  • Vivaldi (my default)
  • Google Chrome
  • Microsoft Edge

I cleared cache an Browserdata in any case.
But the page is still not loading - with none of them.

Geetings
Christoph

The same just happened to my installation. After having done a lot of editing in the model, all of a sudden the “loading” started and so far has not come to an end …

No hint in the logs.

I tried multiple restarts, cleaning the cache, changing the web browser, moving to the latest OH snapshot release - all without any success.

Is there any file specific to the model that may be corrupt?

I really think that we are dealing with a serious bug, since it already affects several people, and the story of how it happens is always the same. Also with me it was broken after many changes. But that’s what the overview is for.

Can someone submit an official bug report?

Especially since I can’t find a solution.

Do you have a fresh installation or a migrated one?

After a lot of “trial & error” I found a fix for my problem:

In my case it was the file

org.openhab.core.items.Item.json

in directory jsondb that caused the issue. I replaced it with one of the most recent backups and after cleaning the cache and restarting OH I could again access the model page. Not clear what the root cause was but I’m happy to have an operating model again.

Hope that helps anyone.

1 Like

Too bad I don’t have a backup from before the condition. I would have done that when I was done.
I would consider this a workaround because you lose the last item configuration. And if it happens again…

Strange that there are no errors in the log when the file is broken.

I had a similar problem with the .json file for the rules.

See here:
[SOLVED] OH3 Issue: unable to create rules, scripts, schedules

But the solution there is no option for > 350 items.

By the way, the problem also makes Blockly more or less unusable because I can’t add items to the scripts.

Developer Tool in Chrome says the following opening the Model page:

Uncaught (in promise) RangeError: Maximum call stack size exceeded
    at Ee.walk (app.js:7)
    at new Ee (app.js:7)
    at Te (app.js:7)
    at Ee.observeArray (app.js:7)
    at new Ee (app.js:7)
    at Te (app.js:7)
    at Object.set [as equipment] (app.js:7)
    at o.getChildren (app.js:27)
    at Array.forEach (<anonymous>)
    at o.getChildren (app.js:27)

Just to be sure if the issue is not caused by the

org.openhab.core.items.Item.json

I put it’s content into ja Json Validator.

At least the syntax seems to be error free.

This looks like you have a cycle in your hierarchy of groups/members i.e. maybe you added a group as a member of one of its own parent groups, or something even more complex that makes your tree “infinite”. This is not detected/supported at the moment.

1 Like

I don’t want to exclude that I made a mistake with the item configuration. On the other hand, I would have hoped that the GUI would not allow me to configure something that would lead to its “self-destruction” afterwards…
Any idea how I could find this? Especially the model view would help to structure the items but it doesn’t work anymore…

According to your hint I did the following:

  • I deleted 30 percent of my items - the ones which are easy to recreate. The idea was that I probably get the one causing the problem.

  • Since this didd not help I “flattened” my model removing most of the parent groups.

This looked like:

This solved the probklem. The model page is loading again and I was able to rerarrange the model. But in fact I was unable to detect exactly which Item / Group nesting caused the issue. Anyway, I worked.

But for some future realeases I hope that the GUI gets some logic to prevent this kind of misconfiguration.

Greetz
Christoph

Hi,
Your solution of removing items, got me thinking.
I removed one by one the group items by clicking on change and removing the direct group members and then remove the group item. Every time i removed one group item, i checked the model and suddenly when i removed the my Home group item (highest in hierarchy) I got my model back. Do not ask me why Home group items was “corrupt”, but I am glad i got my model back and can configure my OH3 again.
Thanks for your tip. Maybe we should have a model consistency check to find errors in the model file.
Patrick

1 Like

I’m glad that it helped even if the solution works on the principle of trial and error.
And yes I think it really needs a check routine for the model. I am sure it will happen to others.

Greetz
Christoph

Same here. I had this issue twice already.
The first time, I got some log errors that one of my groups cannot be loaded. I removed the group using REST API. Then it worked again. Seemed to me like a circular dependency which broke the view.

Second time I did lots of changes in the items section and when heading back to the model page, I saw it broke again. Unfortunately this time, I edited about 50 items, so I can hardly tell which item broke the model view.

Any troubleshooting insights would be highly appreciated so that I dont have to wipe items one after the other until it works, and then re-create all again without the error.

Some circular dependency checking would be really helpful. Especially when setting up more complex models with 2 or more equipment memberships.

1 Like

This is exactly the same that happened to me and therefore I was unable to determine which change was the cause.
It really seems that the “risk” of running into this problem is really high… Since it is nearly impossible to figure it out afterwards it should be prevented at all.

Hey,
in order to get my model page loading again, I had to delete about 30 item configurations until the page was loading again. Then I had do add my items again.
Unfortunately I havent been able to know what exactly was wrong. Since reverting config, fixing it, and re-creating them, is more a workaround than a solution, I filed an issue at github (#797). Just a matter of view if this is a bug or a feature enhancement :slight_smile:
In case anyone knows how to easily reproduce the issue, feel free to add a comment to the issue.
Thanks

Very new to OH and this forum so please forgive any protocol and etiquette faux pas.

I’m running 3.0.1 on a Mac with Big Sur 11.2.3.

Everything was working fine until I decided to install the scripting libraries and that is when the Pages page got stuck in a loading state. Other things, including the sitemap that allows me to perform actions like turning lights on/off are still working.

There was some output in Terminal but I logged out, cleared the cache, and restarted and there is no output now.

The browser console is showing this:

app.js:7 TypeError: (t.config.label || t.uid).substring is not a function
    at app.js:32
    at Array.reduce (<anonymous>)
    at indexedPages (app.js:32)
    at fn.get (app.js:7)
    at fn.evaluate (app.js:7)
    at i.indexedPages (app.js:7)
    at i.<anonymous> (app.js:32)
    at i.e._render (app.js:7)
    at i.a (app.js:7)
    at fn.get (app.js:7)
Ge @ app.js:7
app.js:32 Uncaught TypeError: Cannot read property 'update' of undefined
    at app.js:32
app.js:7 TypeError: (t.config.label || t.uid).substring is not a function
    at app.js:32
    at Array.reduce (<anonymous>)
    at indexedPages (app.js:32)
    at fn.get (app.js:7)
    at fn.evaluate (app.js:7)
    at i.indexedPages (app.js:7)
    at i.<anonymous> (app.js:32)
    at i.e._render (app.js:7)
    at i.a (app.js:7)
    at fn.get (app.js:7)

In my case, navigate to the path: /var/lib/openhab/jsondb and edit the file: org.openhab.core.items.Item.json. In it, I knew which equipment had moved and where, from what I found quickly what the solution is, I found that my equipment that was giving problems had like groupNames: itself, a superior equipment and a superior group (with superior I mean ladder).
For me it only had to be inside the group so I modified the file.

Note: I think it must be done with the openhab service turned off to modify the file.

I hope it helps.