JsonList Problem - nach Aufruf eines Logfile Plots mit logtype FS20

Begonnen von tpm88, 15 Oktober 2013, 22:22:17

Vorheriges Thema - Nächstes Thema

tpm88

Hallo zusammen,

leider ist das Problem mit dem Modul JsonList, welches vitr gestern in Post http://forum.fhem.de/index.php/topic,15381.msg99916.html#msg99916 beschrieben hat, doch nicht mit den neuesten FHEM Updates gelöst.

Vielmehr funktioniert das Modul zunächst nach einem Server Restart. Nach einiger Laufzeit und einigen Abfragen der JsonList kommt es dann aber - leider nicht direkt reproduzierbar - zu folgendem Verhalten.

Die mittels http://fritz.box:8083/fhem?cmd=jsonlist&XHR=1 abgefragte JsonList ist syntaktisch nicht korrekt.

Beispiel (siehe Zeile 4:)


{
  "ResultSet": "full",
  "Results": [
        },
        {
          "ATTR": {},


In der Konsole, in der ich den Server gestartet habe, finden sich zeitgleich folgende Meldungen:

2013.10.15 21:18:41 0: Server started with 30 defined entities (version $Id: fhem.pl 3872 2013-09-07 11:58:33Z rudolfkoenig $, os linux, user boxusr99, pid 6627)
Use of uninitialized value in hash element at ./FHEM/98_SVG.pm line 494.
2013.10.15 21:28:27 2: CUL_HM set wz_Markise getConfig
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in hash element at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value in string comparison (cmp) at ./FHEM/98_JsonList.pm line 146.
Use of uninitialized value $t in string eq at ./FHEM/98_JsonList.pm line 160.
Use of uninitialized value $t in string ne at ./FHEM/98_JsonList.pm line 162.
Use of uninitialized value in hash element at fhem.pl line 1840.
Use of uninitialized value $t in string eq at ./FHEM/98_JsonList.pm line 160.
Use of uninitialized value $lt in string eq at ./FHEM/98_JsonList.pm line 160.
Use of uninitialized value $t in string ne at ./FHEM/98_JsonList.pm line 162.
Use of uninitialized value $lt in string ne at ./FHEM/98_JsonList.pm line 162.
Use of uninitialized value in hash element at fhem.pl line 1840.
Use of uninitialized value $lt in string eq at ./FHEM/98_JsonList.pm line 160.
Use of uninitialized value $lt in string ne at ./FHEM/98_JsonList.pm line 162.
...


Der Server derzeit auf aktuellen Stand (v5.5) mit allen Updates:

Geladene Module:
version
# $Id: fhem.pl 3872 2013-09-07 11:58:33Z rudolfkoenig $
# $Id: 00_CUL.pm 3853 2013-09-04 06:54:57Z rudolfkoenig $
# $Id: 10_CUL_HM.pm 4042 2013-10-14 17:46:05Z martinp876 $
# $Id: 72_FB_CALLMONITOR.pm 3748 2013-08-19 17:04:38Z markusbloch $
# $Id: 01_FHEMWEB.pm 3963 2013-09-26 08:55:32Z martinp876 $
# $Id: 92_FileLog.pm 3759 2013-08-21 08:13:08Z rudolfkoenig $
# $Id: 98_JsonList.pm 3271 2013-06-10 15:07:43Z rudolfkoenig $
# $Id: 99_SUNRISE_EL.pm 3738 2013-08-18 14:13:59Z rudolfkoenig $
# $Id: 99_Utils.pm 3595 2013-08-05 05:38:48Z tobiasfaust $
# $Id: 98_autocreate.pm 3999 2013-10-04 05:15:46Z rudolfkoenig $
# $Id: 98_dummy.pm 3738 2013-08-18 14:13:59Z rudolfkoenig $
# $Id: 91_notify.pm 3738 2013-08-18 14:13:59Z rudolfkoenig $
# $Id: 98_telnet.pm 3738 2013-08-18 14:13:59Z rudolfkoenig $
# $Id: 98_update.pm 3741 2013-08-18 15:23:42Z rudolfkoenig $


Meine fhem.cfg ist im Anhang. Für jeden Tip dankbar,

Gruss
Tobias
Test FHEM Server on RPi, CUL_HM
Prod FHEM Server on Odroid HC1, HM-USB, JeeLink
Devices: diverse HM, IT1500, 1wire, LaCrosse, MQTT

rudolfkoenig

Irgendeiner der verwendeten Module oder einer der notify/at/etc Einzeiler erzeugt ein FHEM Geraet ohne TYPE Eintrag, sowas kann man leicht mit einem $defs{NAME}{Irgendetwas} Lesezugriff erzeugen, wenn NAME geloescht ist.

Trage bitte in Zeile 145 folgendes ein:
map { Log 1, "Without TYPE: $_" if(!defined($defs{$_}{TYPE})) } @dc;
um auf die Spur des kaputten Geraetes zu kommen.
Von hier ist etwas Detektivarbeit notwendig, um die Ursache zu finden.

tpm88

Besten Dank, mit Hilfe der DebugZeile konnte ich das Problem eingrenzen und jetzt auch reproduzieren.

Sobald ich im WebFrontend den Plot eines Logfiles mit logtype FS20 aufrufe, tritt zunächst folgender Fehler/Meldung auf:

Use of uninitialized value in hash element at ./FHEM/98_SVG.pm line 494.

Das Log wird aber korrekt dargestellt.

Das anschliessende Abfragen der JsonList führt dann reproduzierbar zu den oben bereits aufgeführten Fehlermeldungen und zur "korrupten" Liste.

Die DebugZeile erzeugt dabei folgende Meldungen:


...
Use of uninitialized value $t in string ne at ./FHEM/98_JsonList.pm line 163.
Use of uninitialized value $lt in string ne at ./FHEM/98_JsonList.pm line 163.
Use of uninitialized value in hash element at fhem.pl line 1840.
Use of uninitialized value $lt in string eq at ./FHEM/98_JsonList.pm line 161.
Use of uninitialized value $lt in string ne at ./FHEM/98_JsonList.pm line 163.
...
2013.10.16 13:16:25 1: Without TYPE:
2013.10.16 13:16:25 1: Without TYPE: FileLog


Leider kann ich hieraus aber noch nicht ableiten, wo das Problem steckt. Das Filelog hat doch gerade den TYPE FileLog??

Hier noch ein relevanter Auszug aus der fhem.cfg:

define ke_Switch4_03 CUL_HM 20F52603
attr ke_Switch4_03 expert 1
attr ke_Switch4_03 model HM-LC-SW4-WM
attr ke_Switch4_03 peerIDs 00000000,
attr ke_Switch4_03 room Keller
attr ke_Switch4_03 webCmd toggle:on:off:statusRequest
define FileLog_ke_Switch4_03 FileLog ./log/ke_Switch4_03-%Y.log ke_Switch4_03
attr FileLog_ke_Switch4_03 logtype fs20
attr FileLog_ke_Switch4_03 room Logs


Fehlt da noch etwas in der Definition, die von autocreate erzeugt wurde? Ich habe lediglich den logtype auf FS20 abgeändert und das Attribut room definiert. Danke vorab für weitere Hinweise.

Tobias
Test FHEM Server on RPi, CUL_HM
Prod FHEM Server on Odroid HC1, HM-USB, JeeLink
Devices: diverse HM, IT1500, 1wire, LaCrosse, MQTT

tpm88

Noch ein Nachtrag zu meinem letzten Post.

Beim Shutdown des Servers sehe ich folgende Meldungen - vielleicht sind die auch relevant??

2013.10.16 13:48:02 0: Server shutdown
2013.10.16 13:48:02 0: Strange call for nonexistent : ShutdownFn
2013.10.16 13:48:02 0: Strange call for typeless FileLog: ShutdownFn


Test FHEM Server on RPi, CUL_HM
Prod FHEM Server on Odroid HC1, HM-USB, JeeLink
Devices: diverse HM, IT1500, 1wire, LaCrosse, MQTT

tpm88

Das aufgezeigte Verhalten kann auch mit der bei einer Neuinstallation ausgelieferten fhem.cfg schnell reproduziert werden:

1. Start FHEM Server mit initialer fhem.cfg
2. Anlegen eines Dummy Device und zugehörigen Filelog Log mit Logtype FS20:


define ke_QNASTM01_HD1 dummy
createlog ke_QNASTM01_HD1
set ke_QNASTM01_HD1 on
attr FileLog_ke_QNASTM01_HD1 logtype fs20


3. Click im WebFrontend auf "fs20" - Plot wird automatisch erzeugt.
4. Abfrage der JsonList:  http://fritz.box:8083/fhem?cmd=jsonlist&XHR=1

=> Liste kaputt - bis zum Neustart des FHEM Servers.

In meinem Fall konnte ich das Problem umgehen, indem ich stattdessen den Default Logtype "text" beibehalten habe und in der Detailansicht des Logs mittels "Create SVG plot" einen permanten Plot mit gleichen Parametern wie beim "FS20 Plot" angelegt habe. Dadurch bleibt die JsonList heile.
Test FHEM Server on RPi, CUL_HM
Prod FHEM Server on Odroid HC1, HM-USB, JeeLink
Devices: diverse HM, IT1500, 1wire, LaCrosse, MQTT

rudolfkoenig