-gelöst- Json Probleme nach upgrade von Ubuntu 16LTS auf 18LTS

Begonnen von TecCheck, 27 November 2020, 19:07:15

Vorheriges Thema - Nächstes Thema

TecCheck

'Nabend zusammen,

Es wurde mal Zeit und ich habe meinen fhem Server neu installiert. (von Ubuntu 16 auf 18 LTS)

Ubuntu 18 LTS ist aktuell
fhem ist aktuell

libjson-perl ist installiert

Seitdem startet fhem öfter neu,
und fhem-seitig funktioniert weder der Fritzbox-zugriff, noch netatmo oder mein Harmony Hub.

So sieht mein fhem-Log aus. . .

2020.11.27 18:23:10 1: FHEMWEB SSL/HTTPS error:  SSL accept attempt failed error:1408F09C:SSL routines:ssl3_get_record:http request (peer: 192.168.178.85)
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/72_FRITZBOX.pm line 4681.
2020.11.27 18:23:27 1: PERL WARNING: Perl exited with active threads:
1 running and unjoined
0 finished and unjoined
0 running and detached
2020.11.27 18:23:27 1: stacktrace:
2020.11.27 18:23:27 1:     main::__ANON__                      called by fhem.pl (0)
2020.11.27 18:23:49 1: FRITZBOX FritzBox: Readout_Aborted.1931 Error: Timeout when reading Fritz!Box data.
2020.11.27 18:24:37 2: netatmo_M06_XX_00_02_ec_8a: invalid json evaluation on dispatch type getmeasure
JSON text must be an object or array (but found number, string, true, false or null, use allow_nonref to allow this) at ./FHEM/38_netatmo.pm line 2752.



2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)
2020.11.27 18:37:00 1: PERL WARNING: Argument "3600*12" isn't numeric in numeric lt (<) at fhem.pl line 4906.
2020.11.27 18:37:00 1: stacktrace:
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (4906)
2020.11.27 18:37:00 1:     main::readingsBulkUpdate            called by ./FHEM/98_JsonMod.pm (497)
2020.11.27 18:37:00 1:     main::JsonMod_DoReadings            called by ./FHEM/98_JsonMod.pm (682)
2020.11.27 18:37:00 1:     main::JsonMod_ApiResponse           called by FHEM/HttpUtils.pm (639)
2020.11.27 18:37:00 1:     main::__ANON__                      called by fhem.pl (752)



Das sieht für mich nach einem Json Problem aus

Kann mir jemand helfen?


Liebe Grüße aus der Eifel

Wolfgang
Intel NUC mit Ubuntu als FHEM-Server,
CUL  868, RFXTRX 433, Jeelink-PCA,ZWDongle, HMLan
Aktivlautsprecher über LineIn und Display per HDMI am NUC,
diverse FS20 und Intertechno - Komponenten, Oregon Temp-Hum-Sensoren, HomeMatic, PCA301, KS300,Sonos, ZWave, Alexa,Echo's

Beta-User

a) Ubuntu LTS ist aktuell 20.04, oder?

b) Das Problem scheint aus JsonMod zu kommen, du solltest den Thread in den dafür passenden Bereich verschieben.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

TecCheck

Hallo Beta-User,

Zitata) Ubuntu LTS ist aktuell 20.04, oder?   

Das soll nur heißen, das ich gerade nochmal update und upgrade gemacht habe.
Ja, das ist korrekt, aber 20 war mir noch zu neu. . .

Zitatb) Das Problem scheint aus JsonMod zu kommen, du solltest den Thread in den dafür passenden Bereich verschieben.

hiermit verschoben. . .

Lg
Intel NUC mit Ubuntu als FHEM-Server,
CUL  868, RFXTRX 433, Jeelink-PCA,ZWDongle, HMLan
Aktivlautsprecher über LineIn und Display per HDMI am NUC,
diverse FS20 und Intertechno - Komponenten, Oregon Temp-Hum-Sensoren, HomeMatic, PCA301, KS300,Sonos, ZWave, Alexa,Echo's

Beta-User

... Und den Titel so anpassen, dass man weiß, um was es geht?
Dann noch "Version" -Angaben (v.a. Perl allg., fhem.pl und JsonMod), dann kann vielleicht jemand was dazu sagen, der sich damit auskennt...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

herrmannj

Das scheinen mir unterschiedliche Sachen zu sein. Zum JsonMod:

bitte ein komplettes List von jedem der JsonMod defs.

TecCheck

#5
Hallo,

ich habe bei einer definition des  JsonMod Moduls einen Fehler gefunden,
der von mir  verursacht wurde,:

attr  event-min-interval war, fälschlicher Weise, so definiert:  .*:3600*12 
nach dem ich das berichtigt habe, läuft das JsonMod Modul einwandfrei.   :D

Es bleibt aber bei den Fehlern im Log,  (siehe oben) die Netatmo, und  Fritzbox betreffen.   :(
  -  fritzbox:  Error: Timeout when reading Fritz!Box data.
  -  netatmo ist connected,  liefert aber keine Daten

Im Log zu den beiden Modulen immer diese Fehler:
-  invalid json evaluation
-  JSON text must be an object or array

Beide Module liefen bei mir unter ubuntu 16 einwandfrei.

Hat das vielleicht etwas mit   libjson-perl   oder libjson-xs-perl zu tun?? 

? was bedeutet  -  use allow_nonref to allow this  -

Hier noch ein paar Versionsinfos:

Ubuntu 18.04.5 LTS läuft bei mir auf einem Intel NUC

$ perl -v
This is perl 5, version 26, subversion 1 (v5.26.1)

$ dpkg -l | grep libjson
libjson-perl                               2.97001-1
libjson-xs-perl                            3.040-1 


fhem version :
fhem.pl  23032 2020-10-26 18:46:24Z rudolfkoenig

72_FRITZBOX.pm             22125 2020-06-06 11:11:54Z tupol
38_netatmo.pm              21996 2020-05-22 08:17:25Z moises


Ein ratloser Wolfgang
Intel NUC mit Ubuntu als FHEM-Server,
CUL  868, RFXTRX 433, Jeelink-PCA,ZWDongle, HMLan
Aktivlautsprecher über LineIn und Display per HDMI am NUC,
diverse FS20 und Intertechno - Komponenten, Oregon Temp-Hum-Sensoren, HomeMatic, PCA301, KS300,Sonos, ZWave, Alexa,Echo's

amenomade

Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

TecCheck

Hey amenomade,

wenn du mir jetzt noch schreiben kannst, wie ich  das mache,
                    wäre das eine Supersache. Sorry, ich blicke da nicht durch.  :o

Vielen Dank
Intel NUC mit Ubuntu als FHEM-Server,
CUL  868, RFXTRX 433, Jeelink-PCA,ZWDongle, HMLan
Aktivlautsprecher über LineIn und Display per HDMI am NUC,
diverse FS20 und Intertechno - Komponenten, Oregon Temp-Hum-Sensoren, HomeMatic, PCA301, KS300,Sonos, ZWave, Alexa,Echo's

amenomade

Mach bitte zuerst
{use Data::Dumper;; Dumper(%ENV);;} und zeig das Ergebnis.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

TecCheck

{use Data::Dumper;; Dumper(%ENV);;}ergibt:



'PERL_LWP_SSL_VERIFY_HOSTNAME'
'0'
'JOURNAL_STREAM'
'9:1093733'
'HOME'
'/opt/fhem'
'USER'
'fhem'
'LANG'
'de_DE.UTF-8'
'PATH'
'/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin'
'INVOCATION_ID'
'cc85113a8e6c437d98d2c08443204659'
'LOGNAME'
'fhem'
'SHELL'
'/bin/false'
Intel NUC mit Ubuntu als FHEM-Server,
CUL  868, RFXTRX 433, Jeelink-PCA,ZWDongle, HMLan
Aktivlautsprecher über LineIn und Display per HDMI am NUC,
diverse FS20 und Intertechno - Komponenten, Oregon Temp-Hum-Sensoren, HomeMatic, PCA301, KS300,Sonos, ZWave, Alexa,Echo's

amenomade

#10
Dann probiere mal:
{ $ENV{PERL_JSON_PP_USE_B} = 1}
reload 72_FRITZBOX


Und gucke, ob die Fehlermeldung bei FritzBox verschwindet.

Wenn nicht, dann zurück mit:
{ delete $ENV{PERL_JSON_PP_USE_B} } und das Problem irgendwo anders suchen ;)

Wenn ja, muss man es noch persistent machen (export in der service Datei)
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

TecCheck

Hallo amenomade,

das funzt leider nicht, aber war einen Versuch wert. :(
Danke dir trotzdem.

Bin nahe dran alles nochmal neu aufzusetzen, diesmal mit Ubuntu 20 LTS.

Schönen guten Morgen

Wolfgang
Intel NUC mit Ubuntu als FHEM-Server,
CUL  868, RFXTRX 433, Jeelink-PCA,ZWDongle, HMLan
Aktivlautsprecher über LineIn und Display per HDMI am NUC,
diverse FS20 und Intertechno - Komponenten, Oregon Temp-Hum-Sensoren, HomeMatic, PCA301, KS300,Sonos, ZWave, Alexa,Echo's

amenomade

Das kann noch andere Gründe haben. Vermutlich antwortet die Fritzbox mit einem leeren (oder komischen) String. Um das zu begrenzen, braucht man aber eine Log mit verbose 5 auf dem FritzBox Device.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus

TecCheck

Das mag sein, aber das selbe Problem habe ich ja mit dem
Netatmo Modul auch.
Intel NUC mit Ubuntu als FHEM-Server,
CUL  868, RFXTRX 433, Jeelink-PCA,ZWDongle, HMLan
Aktivlautsprecher über LineIn und Display per HDMI am NUC,
diverse FS20 und Intertechno - Komponenten, Oregon Temp-Hum-Sensoren, HomeMatic, PCA301, KS300,Sonos, ZWave, Alexa,Echo's

amenomade

#14
Ja stimmt, deswegen habe ich zuerst in Richtung json/perl gesucht.
Er scheitert an einer ähnlichen Stelle:

Fritzbox
$jsonResult = JSON->new->latin1->decode( $jsonText );

Netatmo
my $json = eval { JSON->new->utf8(0)->decode($data) };

Kann sein, dass die neue Versionen von json/perl weniger tolerant sind, wenn z.B. $jsonText leer ist. Aber die Ursache, warum es leer wäre...?

EDIT: jedenfalls, habe ich folgendes gefunden: https://stackoverflow.com/questions/58963299/perl-threads-vs-json (siehe letzte Antwort).
Vielleicht reicht es, libjson-xs-perl zu deinstallieren? Anscheinend braucht Fritzbox es nicht mehr

EDIT2: eigentlich habe ich auch
libjson-xs-perl                   3.040-1+b1 und kein Pb.
Pi 3B, Alexa, CUL868+Selbstbau 1/2λ-Dipol-Antenne, USB Optolink / Vitotronic, Debmatic und HM / HmIP Komponenten, Rademacher Duofern Jalousien, Fritz!Dect Thermostaten, Proteus