FHEM Forum

FHEM - Hausautomations-Systeme => Unterstützende Dienste => Thema gestartet von: justcallmeal am 18 November 2019, 11:27:37

Titel: TelegramBot: FHEM crasht nach Update
Beitrag von: justcallmeal am 18 November 2019, 11:27:37
Hallo zusammen,

gestern habe ich mein Fhem mal wieder geupdatet und habe nun das Problem, dass mein fhem crasht und ich es nur wieder zum Laufen bringe, indem ich den Raspi via ssh neu boote.

Im Log stehen dann eine Menge Meldungen die augenscheinlich mit dem Telebot zu tun haben:

2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2218.
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2227.
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2183.
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2175.
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2169.
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2242.
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2359.
2019.11.18 08:57:12 1: ERROR: empty name in readingsBeginUpdate
2019.11.18 08:57:12 1: stacktrace:
2019.11.18 08:57:12 1:     main::readingsBeginUpdate           called by ./FHEM/50_TelegramBot.pm (2397)
2019.11.18 08:57:12 1:     main::TelegramBot_Callback          called by FHEM/HttpUtils.pm (634)
2019.11.18 08:57:12 1:     main::__ANON__                      called by fhem.pl (751)
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at fhem.pl line 4772.
2019.11.18 08:57:12 1: readingsUpdate(,sentMsgResult,SUCCESS) missed to call readingsBeginUpdate first.
2019.11.18 08:57:12 1: stacktrace:
2019.11.18 08:57:12 1:     main::readingsBulkUpdate            called by ./FHEM/50_TelegramBot.pm (2398)
2019.11.18 08:57:12 1:     main::TelegramBot_Callback          called by FHEM/HttpUtils.pm (634)
2019.11.18 08:57:12 1:     main::__ANON__                      called by fhem.pl (751)
2019.11.18 08:57:12 1: readingsUpdate(,sentMsgId,15881) missed to call readingsBeginUpdate first.
2019.11.18 08:57:12 1: stacktrace:
2019.11.18 08:57:12 1:     main::readingsBulkUpdate            called by ./FHEM/50_TelegramBot.pm (2399)
2019.11.18 08:57:12 1:     main::TelegramBot_Callback          called by FHEM/HttpUtils.pm (634)
2019.11.18 08:57:12 1:     main::__ANON__                      called by fhem.pl (751)
2019.11.18 08:57:12 1: readingsUpdate(,sentMsgPeerId,) missed to call readingsBeginUpdate first.
2019.11.18 08:57:12 1: stacktrace:
2019.11.18 08:57:12 1:     main::readingsBulkUpdate            called by ./FHEM/50_TelegramBot.pm (2400)
2019.11.18 08:57:12 1:     main::TelegramBot_Callback          called by FHEM/HttpUtils.pm (634)
2019.11.18 08:57:12 1:     main::__ANON__                      called by fhem.pl (751)
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $d in hash element at fhem.pl line 4525.
2019.11.18 08:57:12 1: PERL WARNING: Use of uninitialized value $dev in hash element at fhem.pl line 3626.
Can't use an undefined value as an ARRAY reference at ./FHEM/50_TelegramBot.pm line 2403.
2019.11.18 10:32:24 1: reload: Error:Modul 99_myUtilsTemplate deactivated:


Kann der Maintainer von TelegramBot mal bitte schauen, was da los ist?

Vielen Dank vorab!

LG,
al
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: dt2510 am 18 November 2019, 13:43:50
Ich hab' das gleiche Problem, bei mir geht allerdings noch ein

2019.11.16 23:56:35 1: PERL WARNING: Use of uninitialized value $ret in numeric le (<=) at FHEM/HttpUtils.pm line 646.

voraus
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: justcallmeal am 18 November 2019, 13:58:06
...da ich ab heute Abend reisebedingt die nächsten 14 Tage unterwegs bin und mich nicht um fhem kümmern kann, hab ich das automatisierte fhem-Backup von gestern wieder reingefahren; - Otto's Blog und toller Beschreibung auf http://heinz-otto.blogspot.com/2015/12/backup-und-restore-von-fhem.html (http://heinz-otto.blogspot.com/2015/12/backup-und-restore-von-fhem.html) sei Dank!

Es wäre schön, wenn es bei meiner Rückkehr in 14 Tagen eine Lösung für das Problem gibt  :)

LG,
al
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 18 November 2019, 14:06:27
Hi al,

dann noch schnell die Frage was du genau mit Telegram versendest ?
Konnte das Problem auf einem System bei mir beim Versand von Aufnahmen nachstellen. Allerdings sind die Versionen von Telegram und (sscam bei mir) auf allen Systemen identisch. Doch nur ein System hat das Problem. Telegram ist auch schon recht alt und wurde nicht upgedated. Es muss also irgendwo "dazwischen".
Auf meiner Seite (sscam) schaue ich heute Abend.

Grüße,
Heiko
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: dt2510 am 18 November 2019, 14:08:32
Könnte es nicht an HttpUtils liegen ? Der Fehler geht bei mir immer voran ...

2019.11.16 23:56:35 3: D200 - Telegram message transaction "2202" successfully sent to "xxxxxxxxx" by "Telegram"
2019.11.16 23:56:35 1: PERL WARNING: Use of uninitialized value $ret in numeric le (<=) at FHEM/HttpUtils.pm line 646.
2019.11.16 23:56:35 3: D200 - Snapshot of Camera Eingang created. ID: 17
2019.11.16 23:56:35 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2218.


D200 ist ein SSCam Device
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: justcallmeal am 18 November 2019, 14:11:38
Zitat von: DS_Starter am 18 November 2019, 14:06:27
...dann noch schnell die Frage was du genau mit Telegram versendest ?

Hallo Heiko,

ich versende Fotos von meiner IP-Cam mit Deinem SSCAM-Modul :-)

LG,
al
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 18 November 2019, 14:20:05
Eher nicht, ist nur eine Warnung. Allerdings wahrscheinlich schon ein Hinweis auf einen fehlenden Wert. Der Absturz wird erst durch das Can't use an undefined value as an ARRAY reference at ./FHEM/50_TelegramBot.pm line 2403.
ausgelöst.

Danke al. Dann ist der Zusammenhang hergestellt, aber für mich noch nicht transparent. Ich schaue heute Abend.
Hat bisher ja auch einwandfrei funktioniert.

Lg,
Heiko
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: CoolTux am 18 November 2019, 14:29:56
Eine zusätzliche Abfrage sollte hier Abhilfe schaffen

Zeile 2403
Aus
if ( scalar( @{ $hash->{sentQueue} } ) ) {
nach
if ( ref(@{ $hash->{sentQueue} }) eq 'ARRAY' and scalar( @{ $hash->{sentQueue} } ) ) {


Grüße
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 18 November 2019, 14:34:53
Hast du sicherlich nicht unrecht. Frage ist nur wieso es jetzt plötzlich auftritt und bei mir zum Beispiel nur auf einem System wobei alle den gleichen Stand bezüglich telegram und sscam haben. Mysterium ...  ::)
Wie gesagt, ich schaue heute Abend. Telegram pflegt aber Viegener. Ich muss es in Sscam abfabgen wenn ich dahinter gestiegen bin.
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 18 November 2019, 14:47:24
Achso .... das kuriose ist ja auch, dass die Snaps bzw. Aufnahmen trotzdem erfolgreich versendet werden (bei mir).
Bei euch ebenfalls ?
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: justcallmeal am 18 November 2019, 15:03:09
Zitat von: DS_Starter am 18 November 2019, 14:47:24
Achso .... das kuriose ist ja auch, dass die Snaps bzw. Aufnahmen trotzdem erfolgreich versendet werden (bei mir).
Bei euch ebenfalls ?

...ja, bei mir auch!
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: Happy Fhem User am 18 November 2019, 15:23:00
Zitat von: CoolTux am 18 November 2019, 14:29:56
Eine zusätzliche Abfrage sollte hier Abhilfe schaffen

Zeile 2403
Aus
if ( scalar( @{ $hash->{sentQueue} } ) ) {
nach
if ( ref(@{ $hash->{sentQueue} }) eq 'ARRAY' and scalar( @{ $hash->{sentQueue} } ) ) {


Grüße
nenene, da wird ja wieder versucht ein Array zu machen. Da sollte wohl lieber heißen:
if ( ref( $hash->{sentQueue}) eq 'ARRAY' and scalar( @{ $hash->{sentQueue} } ) ) {
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: CoolTux am 18 November 2019, 15:47:19
Hast Recht. Ich danke Dir.
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 18 November 2019, 18:59:08
Hallo zusammen,

habe den Fehler gefunden und beseitigt.
Es war ein trivialer Kommentar, der eine Codezeile auskommentiert hatte zum Test.
Warum das allerdings auf meinem Prodsystem zu keinem Problem führte (auch dort war sie auskommentiert), hat sich mir bis jetzt nicht erschlossen.
Bis jetzt war es mir ja auf dem Testsystem auch nicht ausgefallen und auch dort war diese Version seit 04.11. im Einsatz.
Ich vermute ein Reihenfolgeproblem der Definition SSCam vs. TelegramBot.

Die Korrektur ist eingecheckt und morgen früh im Update.
Wer den Fehler sofort beseitigen möchte, kann die Korrektur aus meinem contrib laden. Bitte so komplett mit den Ausführungszeichen am Anfang und Ende eingeben:

"wget -qO ./FHEM/49_SSCam.pm https://svn.fhem.de/fhem/trunk/fhem/contrib/DS_Starter/49_SSCam.pm"

Grüße,
Heiko
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: dt2510 am 19 November 2019, 11:19:53
super ... probier' ich nachher gleich aus
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: dt2510 am 19 November 2019, 11:27:55
2019.11.19 11:26:16 3: D200 - Snapshot of Camera Eingang created. ID: 29
2019.11.19 11:26:17 3: D200 - Telegram message transaction "1258" successfully sent to "xxxxxxxxx" by "Telegram"
2019.11.19 11:26:17 1: PERL WARNING: Use of uninitialized value $ret in numeric le (<=) at FHEM/HttpUtils.pm line 646.


Sieht soweit gut aus - bis auf den HttpUtils Fehler, der immer noch mitkommt - FHEM läuft aber normal weiter.
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 19 November 2019, 11:43:24
Ist kein Fehler, nur eine Warnung, aber auch kommt bei mir nicht.
Ich schaue nachher nochmal, aber bin mir unsicher ob das überhaupt aus diesem Kontext kommt.
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: dt2510 am 19 November 2019, 11:58:42
Zitat von: DS_Starter am 19 November 2019, 11:43:24
Ist kein Fehler, nur eine Warnung, aber auch kommt bei mir nicht.
Ich schaue nachher nochmal, aber bin mir unsicher ob das überhaupt aus diesem Kontext kommt.

War wohl nur Zufall, kommt nicht bei jedem Versand
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 19 November 2019, 12:03:23
Diese Warnung kommt aus den Tiefen von HttpUtils:


my $ret = syswrite $hash->{conn}, $data;
      if($ret <= 0) {
.....


Vermutlich war die Verbindung bereits abgebaut, aber wenn man es genau wissen will , müsste sich Rudi das mal anschauen.

LG,
Heiko
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 19 November 2019, 12:07:47
Nutzt du https ? Wenn ja, stell mal pribeweise um auf http und schau ob die warnung weiterhin erscheint.
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: shootingstar am 19 November 2019, 12:13:39
Hallo in die Runde,
ich habe das Update heute eingespielt und erneut versucht einen Snapshot der Synology Cam mit dem Telegrambot zu versenden.
Bei mir crashed fhem weiterhin.
Gruß Andreas
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 19 November 2019, 12:39:05
Hallo Andreas,

mehr Infos bitte. Logauszug der Absturzstelle, List vom Cam-Device.
Das übliche ...  :)

Grüße,
Heiko
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: shootingstar am 19 November 2019, 12:49:42
Kein Problem.
Hier das fhem log nach dem Crash:


2019.11.19 12:03:14 3: SSCam.Tuer - Snapshot of Camera Tuer created. ID: 16
2019.11.19 12:03:15 3: SSCam.Tuer - Telegram message transaction "2902" successfully sent to "@andreasburkart" by "teleBot"
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2218.
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2227.
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2183.
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2169.
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2175.
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2242.
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at ./FHEM/50_TelegramBot.pm line 2359.
2019.11.19 12:03:17 1: ERROR: empty name in readingsBeginUpdate
2019.11.19 12:03:17 1: stacktrace:
2019.11.19 12:03:17 1:     main::readingsBeginUpdate           called by ./FHEM/50_TelegramBot.pm (2397)
2019.11.19 12:03:17 1:     main::TelegramBot_Callback          called by FHEM/HttpUtils.pm (634)
2019.11.19 12:03:17 1:     main::__ANON__                      called by fhem.pl (751)
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $name in concatenation (.) or string at fhem.pl line 4772.
2019.11.19 12:03:17 1: readingsUpdate(,sentMsgResult,SUCCESS) missed to call readingsBeginUpdate first.
2019.11.19 12:03:17 1: stacktrace:
2019.11.19 12:03:17 1:     main::readingsBulkUpdate            called by ./FHEM/50_TelegramBot.pm (2398)
2019.11.19 12:03:17 1:     main::TelegramBot_Callback          called by FHEM/HttpUtils.pm (634)
2019.11.19 12:03:17 1:     main::__ANON__                      called by fhem.pl (751)
2019.11.19 12:03:17 1: readingsUpdate(,sentMsgId,6398) missed to call readingsBeginUpdate first.
2019.11.19 12:03:17 1: stacktrace:
2019.11.19 12:03:17 1:     main::readingsBulkUpdate            called by ./FHEM/50_TelegramBot.pm (2399)
2019.11.19 12:03:17 1:     main::TelegramBot_Callback          called by FHEM/HttpUtils.pm (634)
2019.11.19 12:03:17 1:     main::__ANON__                      called by fhem.pl (751)
2019.11.19 12:03:17 1: readingsUpdate(,sentMsgPeerId,) missed to call readingsBeginUpdate first.
2019.11.19 12:03:17 1: stacktrace:
2019.11.19 12:03:17 1:     main::readingsBulkUpdate            called by ./FHEM/50_TelegramBot.pm (2400)
2019.11.19 12:03:17 1:     main::TelegramBot_Callback          called by FHEM/HttpUtils.pm (634)
2019.11.19 12:03:17 1:     main::__ANON__                      called by fhem.pl (751)
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $d in hash element at fhem.pl line 4525.
2019.11.19 12:03:17 1: PERL WARNING: Use of uninitialized value $dev in hash element at fhem.pl line 3626.
Can't use an undefined value as an ARRAY reference at ./FHEM/50_TelegramBot.pm line 2403.


Hier das List der Cam:


Internals:
   CAMID      3
   CAMNAME    Tuer
   COMPATIBILITY 8.2.6
   CREDENTIALS Set
   DEF        Tuer 192.168.180.230 5000
   FUUID      5dbad3f5-f33f-89ec-6764-e88d109ffdcab8fa
   FVERSION   49_SSCam.pm:v9.0.4-s20534/2019-11-18
   MODEL      ONVIF - Generic_ONVIF_StreamingOnly
   NAME       SSCam.Tuer
   NR         373
   OPMODE     getStmUrlPath
   PROTOCOL   http
   SERVERADDR 192.168.180.230
   SERVERPORT 5000
   STATE      on
   TYPE       SSCam


Der Snapshot wird auch noch erfolgreich versendet, bevor fhem crashed.

Gruß Andreas
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 19 November 2019, 13:12:58
Jetzt wird es echt schwierig, kann es bei mir nicht mehr nachvollziehen.
Welche SSCam Version hattest du zuvor im Einsatz, mit er es bei dir funktioniert hat ?
Hast du Telegram erst später, also nach der Kameradefinition in dein FHEM integriert ?
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: shootingstar am 19 November 2019, 14:14:19
Gute Nachrichten :)
Nach dem Reboot des Servers funktioniert es jetzt wieder
Titel: Antw:TelegramBot: FHEM crasht nach Update
Beitrag von: DS_Starter am 19 November 2019, 14:24:15
 8) ... ich wollte schon (ver)zweifeln  :D

LG