openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.7k forks source link

bundle loading order issue (was: german characters in mail will crash actions) #457

Closed openhab-bot closed 10 years ago

openhab-bot commented 10 years ago

From kleina.i...@gmail.com on September 16, 2013 09:40:37

What steps will reproduce the problem? 1. Rule with Mail action and special characters:

sendMail ("to@domain","Hitze in Wohnung","Arbeitzimmer ist kälter als außen, bitte Fenster schließen")

  1. after first send, the actions (will also effect others like prowl) will not be avaiable any more

The name 'pushNotification(,)' cannot be resolved to an item or type.

  1. Rules with actions will not be excuted anymore below the action (mail / prowl) What is the expected output? What do you see instead? - more robust actions (error should not effect other actions)
  2. rule command below the error should still be executed
  3. send mail with german charaters What version of the product are you using? On what operating system? 1.3.0 Please provide any additional information below.

Original issue: http://code.google.com/p/openhab/issues/detail?id=457

openhab-bot commented 10 years ago

From kleina.i...@gmail.com on October 10, 2013 06:18:27

i see the same issue on 1.4.0 snapshot 505.

Error during the execution of rule 'Anwesend OFF': The name 'pushNotification(,)' cannot be resolved to an item or type.

openhab-bot commented 10 years ago

From kleina.i...@gmail.com on October 12, 2013 08:42:20

Sorry. It seems not related to german characters.

i removed some still unused add ons and now it works again fine.

List of plugins where problem happens:

org.openhab.action.mail-1.3.0.jar org.openhab.binding.ntp-1.3.0.jar org.openhab.persistence.db4o-1.3.0.jar org.openhab.action.prowl-1.3.0.jar org.openhab.binding.snmp-1.3.0.jar org.openhab.persistence.exec-1.3.0.jar org.openhab.binding.configadmin-1.3.0.jar org.openhab.binding.systeminfo-1.3.0.jar org.openhab.persistence.gcal-1.3.0.jar org.openhab.binding.exec-1.3.0.jar org.openhab.binding.tcp-1.3.0.jar org.openhab.persistence.logging-1.3.0.jar org.openhab.binding.fritzbox-1.3.0.jar org.openhab.binding.vdr-1.3.0.jar org.openhab.persistence.mqtt-1.3.0.jar org.openhab.binding.homematic-1.3.0.jar org.openhab.binding.wol-1.3.0.jar org.openhab.persistence.rrd4j-1.3.0.jar org.openhab.binding.http-1.3.0.jar org.openhab.io.multimedia.tts.freetts-1.3.0.jar org.openhab.persistence.sense-1.3.0.jar org.openhab.binding.knx-1.3.0.jar org.openhab.io.multimedia.tts.marytts-1.3.0.jar org.openhab.persistence.sql-1.3.0.jar org.openhab.binding.networkhealth-1.3.0.jar org.openhab.persistence.cosm-1.3.0.jar org.openhab.persistence.sql.mysql-1.3.0.jar

List of Plugins where Mail and Prowl works fine:

org.openhab.action.mail-1.4.0-SNAPSHOT.jar org.openhab.binding.http-1.4.0-SNAPSHOT.jar org.openhab.io.multimedia.tts.marytts-1.4.0-SNAPSHOT.jar org.openhab.action.prowl-1.4.0-SNAPSHOT.jar org.openhab.binding.knx-1.4.0-SNAPSHOT.jar org.openhab.persistence.db4o-1.4.0-SNAPSHOT.jar org.openhab.binding.exec-1.4.0-SNAPSHOT.jar org.openhab.binding.ntp-1.4.0-SNAPSHOT.jar org.openhab.persistence.exec-1.4.0-SNAPSHOT.jar org.openhab.binding.fritzbox-1.4.0-SNAPSHOT.jar org.openhab.binding.tcp-1.4.0-SNAPSHOT.jar org.openhab.persistence.logging-1.4.0-SNAPSHOT.jar org.openhab.binding.homematic-1.4.0-SNAPSHOT.jar org.openhab.io.multimedia.tts.freetts-1.4.0-SNAPSHOT.jar org.openhab.persistence.rrd4j-1.4.0-SNAPSHOT.jar

openhab-bot commented 10 years ago

From kai.openhab on November 06, 2013 00:34:06

Labels: To-Github

manroh commented 10 years ago

I have the same issue with openhab 1.3.1 for the pushNotification and for the sendMail Action. I don't use german umlauts, so it might be indeed an issue with the combination of other addons. I hope this is gets being fixed soon.

sacatak commented 10 years ago

I have this issue with version 1.4.0 snapshot #540 on certain rule. With this simple rule, it works:

rule "push notification 1 min" when Time cron "0 * * * * ?" then pushNotification("Notification", "Notification toutes les minutes") end

With this rule, it doesn't work:

rule "Extinction prise" when Item Fibaro_plug_Switch changed from ON to OFF then pushNotification("Prise", "Extinction") end In this case, I have the following error:

ERROR o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'Extinction prise': The name 'pushNotification(,)' cannot be resolved to an item or type

If I change the demo.rules file without restarting openhab, the first rule stop working. The error is :

ERROR o.o.m.r.i.e.ExecuteRuleJob[:57]- Error during the execution of rule push notification 1 min

It seems that the first simple rule use a different class that the second one. I'm not a programmer but maybe the problem is due to missing import statements at the beginning of the rule file. But I've no idea of the import statement that I should use to fix the problem on the second rule. For the moment, I have the default statements : import org.openhab.core.library.types. import org.openhab.core.persistence. import org.openhab.model.script.actions.*

I hope it will help.

eschava commented 10 years ago

It seems I found how to reproduce the issue If sendMail(or any other action) is executed at first when appropriate jar is not still loaded then it will fail with every next call of an action

tdeckers commented 10 years ago

Seems like this is related to other load order issues: See https://groups.google.com/forum/#!topic/openhab/E_wSEyzKVis

Think load order needs to be examined, defined.

kaikreuzer commented 10 years ago

Looks like a high prio thing to fix for the 1.4 release.

cdjackson commented 10 years ago

Does anyone with this problem see the following error in the logs? I don't have the sendMail problem, but am sometimes seeing failures in other DS services and I'm wondering if it's related.

!ENTRY org.eclipse.equinox.ds 2 0 2014-01-19 15:26:35.051 !MESSAGE Getting a lock required more than 10000 ms. There might be a synchronization problem in this callstack or just the build/dispose process of some components took too long! !STACK 0

fldc commented 10 years ago

I am obviously hitting this bug also, I wrote an action and everything worked great running it from IDE, but as soon as I try to load it on my raspberry pi i get the error about this not being resolved. Also checked with some other actions, none that I tried would work. I guess I'll need to investigate further. :D

teichsta commented 10 years ago

have this issue on my prio list! will probably need your help to resolve this issue … 

GertKonemann commented 10 years ago

I have also sendMail problems. Probably there goes someting wrong during system startup. Not only sendMail has problems when many processes are running at the same time at startup, I have also seen COM ports logged as busy which were free in the ZWave binding and the RFXCOM binding. But sendMail shows this error more often.

I have made a simple rule to show it. M4 is a pushbutton.

rule On_M4 when Item M4 received update then sendMail("openhab@konemann.nl","M4 update","M4 received update") end

1.When everything is OK, pressing the M4 button writes on the console:

12:12:06.992 INFO runtime.busevents[:26] - M4 state updated to ON

Sending data EHLO Homeserver11<<<<<< Sending data MAIL FROM: openhab@konemann.nl<<<<<< Sending data RCPT TO: openhab@konemann.nl<<<<<< Sending data DATA<<<<<< Sending data <<<<<< Sending data .<<<<<< Sending data QUIT<<<<<<

  1. When openHAB was too busy at startup, this happens:

12:30:16.928 INFO runtime.busevents[:26] - M4 state updated to ON 12:30:16.994 ERROR o.o.c.s.ScriptExecutionThread[:50] - Error during the execution of rule 'On_M4': The name 'sendMail(, ,)' cannot be resolved to an item or type.

After startup you get always the same behaviour, until a new startup of openHAB. Until today I could choose for 1 by removing HABmin, but today I had both 1 and 2 when running HABmin. Can it be a broader problem with the initialisation of global variables at startup. I think so, because I had problems with a rule that starts at system started. I had many times uninitialised variables, until i delayed the execution of the rule 15 seconds. After these 15 seconds, the startup is done and my rule is now alway executed as expected.

Gert

devTechi commented 10 years ago

So if this could be of any help: I had this issue too. First with a snapshot of 1.4.0 a few weeks ago when I updated the zwave binding which came with the habmin interface. To use sendMail I had to delete the habmin zwave binding and stopp using it. So I used the "old" zwave binding again. Yesterday I updated the complete runtime to the latest snapshot build of 1.4.0 and I had the issue too. So again I went back to the version of a few weeks ago.

cdjackson commented 10 years ago

While this points the finger in the direction of the zwave binding, or HABmin, I (personally) think that this is a timing issue (although I don’t know what timing!). This problem exists with a number of configurations, and was raised by people not using these bundles. By adding bindings etc, you change the startup timing of the system, and I have seen some error messages regarding DS service registration delays at times (I posted about this a few days back). I’m just guessing that this might be why the actions aren’t being found - i.e. because their DS registration has failed the action system won’t know of them. Again, that’s just a guess and I don’t have the sendMail problem so I can’t debug it :( I’m also not sure how to debug DS initialisation, but an online search talked about thread lockout during the registration process, although to me it looked like most of the registration methods (e.g. in the action system) only stored the link and didn’t do any processing so I wouldn’t expect this to cause a thread lock…

(just my thoughts - I could be totally on the wrong track)

devTechi commented 10 years ago

As I posted in the other issue in your repo I think so too. That can't be an issue just related to the zwave binding.

The same problem existed in my update from yesterday with the complete new 1.4.0 snapshot (and the same config).

And with the original binding of that new downloaded addon-snapshot with my version of openhab-runtime before it didn't work either. Now I am running the version of before again with the zwave binding from then.

tdeckers commented 10 years ago

I don't have ZWave in my install and experience this issue with sendXMPP as report earlier in this thread. I also believe in the scenario where things don't get loaded in order.

FYI, this is what I see in the log when the specific rule is triggered: 20:41:44.537 ERROR o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'Alarm notification': The name 'sendXMPP(<XStringLiteralImpl>,<XFeatureCallImplCustom>)' cannot be resolved to an item or type.

ftricard commented 10 years ago

Hello,

I think that I have a similar issue in a rule with a sendMail, but I'm not sure (Openhab 1.5) :

Error :

o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'Suspension de l'alarme': The name 'sendMail(,,)' cannot be resolved to an item or type.

Rule :

import org.openhab.core.library.types. import org.openhab.core.persistence. import org.openhab.model.script.actions.*

rule "Suspension de l'alarme"

when Item kfob_2 received update ON then postUpdate(etat_alarme, 0) sendMail("xxxxxxxxxxxxx@gmail.com","Trigger Occur Alarme OFF","L'alarme est desarmée.") end

FYI, yesterday, when I have worked on this rule I think it was OK (no error). But this morning I have updated the z-wave binding from cloudbees and the problem had occurs.

tdeckers commented 10 years ago

I think it happens with all addon actions. I have this with squeezeboxSpeak today as well. It worked once, and then it started failing. Restarted instance, without any luck.

13:37:17.846 ERROR o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'Test rule': The name 'squeezeboxSpeak(<XFeatureCallImplCustom>,<XFeatureCallImplCustom>)' cannot be resolved to an item or type.

openhab-bot commented 10 years ago

Hi,

yes, you're right, this issue is most likely caused by the (wrong) startup order of bundles. I've worked on this issue for a couple of hours now but didn't manage to fix it - yet. Will keep you posted …

Best,

Thomas E.-E.

On 05 Mar 2014, at 18:07, Tom Deckers notifications@github.com wrote:

I think it happens with all addon actions. I have this with squeezeboxSpeak today as well. It worked once, and then it started failing. Restarted instance, without any luck.

13:37:17.846 ERROR o.o.c.s.ScriptExecutionThread[:50]- Error during the execution of rule 'Test rule': The name 'squeezeboxSpeak(,)' cannot be resolved to an item or type.

— Reply to this email directly or view it on GitHub.

gd35 commented 10 years ago

Hi,

I started to use OpenHAB (I like it very much !) but I am facing the bundle order issue. OpenHAB runs without any problem on my MacBook (I have several zwave sensors) but when I use the same OpenHAB configuration on my Cubieboard 3, I have several issues:

1) the query able persistence service does not seem to load correctly at the right time:

Welcome at openHab! 21:03:43.541 WARN o.o.c.p.e.PersistenceExtensions[:404] - There is no queryable persistence service registered with the name 'rrd4j' 21:03:43.718 ERROR o.o.m.r.i.engine.RuleEngine[:267] - Error during the execution of startup rule 'Update max and min temperatures': cannot invoke method public abstract org.openhab.core.types.State org.openhab.core.persistence.HistoricItem.getState() on null

2) The mail service does not seem to load at all:

21:04:27.515 INFO runtime.busevents[:22] - Alarme received command ON 21:04:28.086 ERROR o.o.c.s.ScriptExecutionThread[:50] - Error during the execution of rule 'Activation Alarme': The name 'sendMail(,,)' cannot be resolved to an item or type.

3) One of my 6 wave sensors (the last one) does not work although it works perfectly when I use my MacBook

Are there any solutions to solve these problems ?

Best,

Thierry P.

huh123 commented 10 years ago

Hi,

Seems that I have faced this issue too. Using openhab 1.4. My squeezebox rules worked fine all day, but after server restart it gives me errors like "The name 'squeezeboxPlayUrl(,)' cannot be resolved to an item or type." Is there any workaround or advice how to deal with this? Any possibility to restart specific bundle?

regards

openhab-bot commented 10 years ago

Hi,

Is there any workaround or advice how to deal with this?

no, except restarting the platform.

Any possibility to restart specific bundle?

yes! openHAB ships with the OSGi console (finally based on Felix GoGo). Depending on how you’ve started the platform you can simply hit and a command line starting with "osgi>” appears. Now you can simply enter “ss” (short status) and see the status of all bundles. To see only openHAB related bundles type “ss openhab”. Each bundle entry starts with a number (like a pid). With it you can simply hit “start xxx” or “stop xxx” to start and stop specific bundles.

Best,

Thomas E.-E.

huh123 commented 10 years ago

Thomas,

Thank you very much. I have openhab started using linux initscript. Managed connect to OSGi console using telnet to localhost on defined port (5555). Done stop/start of this bundles: osgi> ss openhab |grep sque 228 ACTIVE org.openhab.action.squeezebox_1.4.0 232 ACTIVE org.openhab.io.squeezeserver_1.4.0 237 ACTIVE org.openhab.binding.squeezebox_1.4.0 After that procedure action squeezeboxPlayUrl is working back again.

teichsta commented 10 years ago

great, thanks for the update!

On 08 Apr 2014, at 09:35, huh123 notifications@github.com wrote:

Thomas,

Thank you very much. I have openhab started using linux initscript. Managed connect to OSGi console using telnet to localhost on defined port (5555). Done stop/start of this bundles:

osgi> ss openhab |grep sque 228 ACTIVE org.openhab.action.squeezebox_1.4.0 232 ACTIVE org.openhab.io.squeezeserver_1.4.0 237 ACTIVE org.openhab.binding.squeezebox_1.4.0

After that procedure action squeezeboxPlayUrl is working back again.

— Reply to this email directly or view it on GitHub.

huh123 commented 10 years ago

Done some more testing. After my previous actions it turned that one rule worked as expected, sencond rule still was giving ('squeezeboxPlayUrl(,)' cannot be resolved to an item or type) despite that on other one action squeezeboxPlayUrl was working fine. Strange behavior.

Restarted openhab again, situation similar, now both rules produces error about resolving squeezeboxPlayUrl. Restarting squeezebox bundles does not help anymore, so it seems that in previous attempt it was luck or coincidence.

Trying another workaround: migrated rules with squeezeboxPlayUrl action to scripts. Now calling this scripts from rules - at the moment no errors. Checking further.

kaikreuzer commented 10 years ago

I consider this now fixed with https://github.com/openhab/openhab/commit/e192e0f70f129628ecb74206e51e588a2db57aaa, see https://groups.google.com/d/msg/openhab/5VA2iWGuQ5Y/zcECp9X1cu4J

GertKonemann commented 10 years ago

Congratulations,

I could not force these errors today. Very good !

Gert

Van: kaikreuzer [mailto:notifications@github.com] Verzonden: vrijdag 30 mei 2014 21:43 Aan: openhab/openhab CC: GertKonemann Onderwerp: Re: [openhab] bundle loading order issue (was: german characters in mail will crash actions) (#457)

I consider this now fixed with https://github.com/openhab/openhab/commit/e192e0f70f129628ecb74206e51e588a2db57aaa e192e0f, see https://groups.google.com/d/msg/openhab/5VA2iWGuQ5Y/zcECp9X1cu4J

— Reply to this email directly or view it on GitHub https://github.com/openhab/openhab/issues/457#issuecomment-44691605 .Beschrijving: Afbeelding verwijderd door afzender.