openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
930 stars 429 forks source link

[OH3] ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier #1823

Closed morph166955 closed 3 years ago

morph166955 commented 4 years ago

Every couple of restarts I get the following error show up. I get one error for every rule in every rules file (so yes I get about 150 of these). Example below is of my roku rules file. I have 5 rules defined, and 5 errors.

2020-11-14 20:28:23.789 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'roku.rules'
2020-11-14 20:28:23.862 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 62f8e117-5217-4e30-ad47-754360b75caa
2020-11-14 20:28:24.105 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 3b53ba8b-09bf-4898-a97f-0b08b726f348
2020-11-14 20:28:24.281 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 34634ee4-001d-42e0-9a4f-f000d45318e6
2020-11-14 20:28:24.566 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: d1b25dd8-649b-4154-83c5-c0755964d745
2020-11-14 20:28:24.862 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 62f8e117-5217-4e30-ad47-754360b75caa
lolodomo commented 4 years ago

As @kaikreuzer made few changes in DSL rule management, could you confirm you still have this problem with a recent OH3 version ? What vcersion were you using ? Do you have this issue if you use only one rule file (my case and no such error) ? Just to understand if it occurs when having more than one rule file.

grzegorz914 commented 4 years ago

OH 3.0-2030

the problem still exist:

2020-11-28 13:06:37.396 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'rolety.rules'
2020-11-28 13:06:44.248 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 3ce56fff-d75e-46d7-8bf0-12986d5dce0f
2020-11-28 13:06:44.249 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: cdb5bb64-5977-4079-b132-d1d5293186b3
2020-11-28 13:06:44.251 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 93c99d19-6314-450f-b5a0-1441d6d69e15
2020-11-28 13:06:44.255 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 2a770cff-b77c-4b97-b8d9-485070bdeb4a
2020-11-28 13:06:58.987 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'powtvkamila.rules'
2020-11-28 13:06:44.248 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 3ce56fff-d75e-46d7-8bf0-12986d5dce0f
2020-11-28 13:06:44.249 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: cdb5bb64-5977-4079-b132-d1d5293186b3
2020-11-28 13:06:44.251 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 93c99d19-6314-450f-b5a0-1441d6d69e15
2020-11-28 13:06:44.255 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 2a770cff-b77c-4b97-b8d9-485070bdeb4a
lolodomo commented 4 years ago

It looks like your rule file is loaded before the "script engine factory" is set as a reference. https://github.com/openhab/openhab-core/blob/60edebc111d4f19abe5858a4d23d996e13041634/bundles/org.openhab.core.automation.module.script/src/main/java/org/openhab/core/automation/module/script/internal/ScriptEngineManagerImpl.java#L63 That looks to me like a timing (order of start) issue. But @kaikreuzer could have clearly a better analysis (as I am not very aware of all this part of the code).

lolodomo commented 4 years ago

If you touch one of these files while OH is started since a certain time, I assume you have not these errors ?

grzegorz914 commented 4 years ago

Yes, if run the rule manually the errors are gone.

morph166955 commented 3 years ago

Updated to S2041 and this is still present. Errors are generated for every rule in every rules file.

Example:

2020-12-03 16:13:31.719 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'neeo.rules'
2020-12-03 16:13:31.790 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 95a269d7-2269-45f7-9513-5f9e48b631f9
2020-12-03 16:13:31.867 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 51f6117d-ef43-4f26-bf51-b420b96b62d1
2020-12-03 16:13:31.869 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: d66ad289-03a0-4093-b967-bb86770a2dc0
2020-12-03 16:13:31.940 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: cb0951ca-455c-4820-baed-ccc8be60023d
2020-12-03 16:13:32.109 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: b5f06f07-1d5f-4909-81fd-dc1992cbcaa5
2020-12-03 16:13:32.143 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 929b4ee4-5403-4472-ae12-aa3ee932fe2c
2020-12-03 16:13:32.149 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 567d463f-ffbc-4e10-b22e-865779a544b9
2020-12-03 16:13:32.323 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: a1bc861d-c48f-411b-9660-eac589a6fd96
2020-12-03 16:13:32.564 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: bd90d258-15a9-404c-ba35-6aa7ea7f26b4
2020-12-03 16:13:32.790 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 95a269d7-2269-45f7-9513-5f9e48b631f9
2020-12-03 16:13:32.867 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 51f6117d-ef43-4f26-bf51-b420b96b62d1
2020-12-03 16:13:32.869 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: d66ad289-03a0-4093-b967-bb86770a2dc0
2020-12-03 16:13:32.941 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: cb0951ca-455c-4820-baed-ccc8be60023d
2020-12-03 16:13:33.109 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: b5f06f07-1d5f-4909-81fd-dc1992cbcaa5
2020-12-03 16:13:33.144 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 929b4ee4-5403-4472-ae12-aa3ee932fe2c
2020-12-03 16:13:33.149 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: 567d463f-ffbc-4e10-b22e-865779a544b9
2020-12-03 16:13:33.323 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: a1bc861d-c48f-411b-9660-eac589a6fd96
2020-12-03 16:13:33.564 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: bd90d258-15a9-404c-ba35-6aa7ea7f26b4
kaikreuzer commented 3 years ago

That's likely related to a too long startup and rules being loaded before all services are up. I'll look into rule startup behavior next - the last really urgent thing to tackle before the release, I guess...

morph166955 commented 3 years ago

I get those errors really fast after starting OH.
First log message from start: 2020-12-03 16:22:44.014 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'America/Chicago'.

My items, persist, sitemap, and things load all in about 2 seconds.

Rules start to load 2020-12-03 16:22:48.119 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'ring.rules'

Then...

2020-12-03 16:22:54.810 [ERROR] [ipt.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/vnd.openhab.dsl.rule' could not be found for identifier: a4a511d8-48d4-4884-8094-e322184f616b