[Gelöst] Alexa, ständige Neustarts "read:end of file reached while sysread"

Begonnen von Gueco315, 25 März 2019, 10:06:00

Vorheriges Thema - Nächstes Thema

passibe

Alles klar. Dann poste mal bitte Infos zu Betriebssystem, Art der Installation (Docker?) usw. auch node bzw. npm-Version.

Und bitte einmal die Ausgabe vonps -aux | grep -E '(alexa|ssh)'
Und poste mal die entsprechenden Log-Auszüge, sowohl vom FHEM-Log als auch vom alexa-fhem-Log, mehr als nur eine Zeile, vielleicht auch mit etwas Kontext. Zum Beispiel so, dass man anhand der Timestamps sieht, in was für einem Intervall/wie oft das neustartet, usw.

Und bitte noch ein list vom alexa Device.

Danke!

hugomckinley

Danke für deine Hilfe. Bitte keine Zeit investieren, denn das System wird in den nächsten 2 Monaten auf eine Linux-Basis (TrueNAS Scale) umgestellt, dann ist wieder alles anders. Ich hoffte nur, dass das vielleicht wer aus dem Stehgreif beantworten könnte.

FHEM läuft in einer FreeBSD Jail (TrueNAS-13.0-U6.7)

node --version
v18.12.1
Neuer geht bei diesem antiken System nicht mehr. Drum ist ja der Umstieg nötig.


Hier die Daten:
root  28657  0.0  0.4 311376  96700  -  SJ   07:29    0:01.73 node: /usr/local/bin/node /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s (node)
root  28666  0.0  0.0  18632   7924  -  IJ   07:29    0:00.03 /usr/bin/ssh -R 1234:127.0.0.1:28172 -oServerAliveInterval=90 -i /root/.ssh/id_rsa -p 58824 fhem-va.fhem.de
root  28807  0.0  0.0  21544   9840  -  SsJ  07:34    0:00.02 sshd: root@pts/15 (sshd)
root  65045  0.0  0.0  21104   8260  -  IsJ  Tue23    0:00.01 sshd: /usr/sbin/sshd [listener] 0 of 10-100 startups (sshd)
root  28840  0.0  0.0  12840   2304 15  S+J  07:35    0:00.00 grep -E (alexa|ssh)
(Der User root ist einer Eigenheit meiner FreeBSD-Installation geschuldet.)

Logauszug(vollständig in diesem Zeitraum):
2025.07.17 06:00:02 3: alexa: read: end of file reached while sysread
2025.07.17 06:00:02 3: alexa: stopped
2025.07.17 06:00:02 2: alexa: setting $HOME to /root/
2025.07.17 06:00:02 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 06:00:02 3: alexa: starting
2025.07.17 06:00:02 3: alexa: using logfile: ./log/alexa-2025-07-17.log
2025.07.17 06:04:26 3: alexa: read: end of file reached while sysread
2025.07.17 06:04:26 3: alexa: stopped
2025.07.17 06:04:26 2: alexa: setting $HOME to /root/
2025.07.17 06:04:26 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 06:04:26 3: alexa: starting
2025.07.17 06:04:26 3: alexa: using logfile: ./log/alexa-2025-07-17.log
2025.07.17 06:18:37 3: alexa: read: end of file reached while sysread
2025.07.17 06:18:37 3: alexa: stopped
2025.07.17 06:18:37 2: alexa: setting $HOME to /root/
2025.07.17 06:18:37 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 06:18:37 3: alexa: starting
2025.07.17 06:18:37 3: alexa: using logfile: ./log/alexa-2025-07-17.log
2025.07.17 06:32:48 3: alexa: read: end of file reached while sysread
2025.07.17 06:32:48 3: alexa: stopped
2025.07.17 06:32:48 2: alexa: setting $HOME to /root/
2025.07.17 06:32:48 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 06:32:48 3: alexa: starting
2025.07.17 06:32:48 3: alexa: using logfile: ./log/alexa-2025-07-17.log
2025.07.17 06:46:59 3: alexa: read: end of file reached while sysread
2025.07.17 06:46:59 3: alexa: stopped
2025.07.17 06:46:59 2: alexa: setting $HOME to /root/
2025.07.17 06:46:59 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 06:46:59 3: alexa: starting
2025.07.17 06:46:59 3: alexa: using logfile: ./log/alexa-2025-07-17.log
2025.07.17 07:00:03 3: alexa: read: end of file reached while sysread
2025.07.17 07:00:03 3: alexa: stopped
2025.07.17 07:00:03 2: alexa: setting $HOME to /root/
2025.07.17 07:00:03 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 07:00:03 3: alexa: starting
2025.07.17 07:00:03 3: alexa: using logfile: ./log/alexa-2025-07-17.log
2025.07.17 07:01:10 3: alexa: read: end of file reached while sysread
2025.07.17 07:01:10 3: alexa: stopped
2025.07.17 07:01:10 2: alexa: setting $HOME to /root/
2025.07.17 07:01:10 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 07:01:11 3: alexa: starting
2025.07.17 07:01:11 3: alexa: using logfile: ./log/alexa-2025-07-17.log
2025.07.17 07:15:21 3: alexa: read: end of file reached while sysread
2025.07.17 07:15:21 3: alexa: stopped
2025.07.17 07:15:21 2: alexa: setting $HOME to /root/
2025.07.17 07:15:21 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 07:15:21 3: alexa: starting
2025.07.17 07:15:21 3: alexa: using logfile: ./log/alexa-2025-07-17.log
2025.07.17 07:29:32 3: alexa: read: end of file reached while sysread
2025.07.17 07:29:32 3: alexa: stopped
2025.07.17 07:29:32 2: alexa: setting $HOME to /root/
2025.07.17 07:29:32 2: alexa: starting alexa-fhem: /usr/local/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg -a xx:xx -s
2025.07.17 07:29:32 3: alexa: starting
2025.07.17 07:29:32 3: alexa: using logfile: ./log/alexa-2025-07-17.log

Alexa-Log (zeitlicher Auszug, immer das gleiche):
[7/17/2025, 6:04:16 AM] [FHEM]     caching: CurrentAmbientLightLevel: 12808.679245283018 (as number; from '3394.3')
[7/17/2025, 6:04:25 AM] [FHEM] longpoll ended, reconnect in: 200msec
[7/17/2025, 6:04:25 AM] [FHEM] trying longpoll to listen for fhem events
[7/17/2025, 6:04:25 AM] [FHEM] starting longpoll: https://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=1752725056.943;fmt=JSON×tamp=1752725065776
[7/17/2025, 6:04:25 AM] [FHEM] got csrfToken: xxxxxxxxxxxxxx
[7/17/2025, 6:04:25 AM] [FHEM] Checking devices and attributes...
[7/17/2025, 6:04:25 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3B%7BAttrVal(%22global%22%2C%22userattr%22%2C%22%22)%7D%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:25 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Bjsonlist2%20TYPE%3Dalexa%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:25 AM] [FHEM] waiting for events ...
[7/17/2025, 6:04:25 AM] [FHEM] Fetching FHEM devices...
[7/17/2025, 6:04:25 AM] [FHEM] fetching: https://127.0.0.1:8083/fhem?cmd=jsonlist2%20alexaName=..*&fwcsrf=xxxxxxxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:26 AM] [FHEM] alexa device is alexa
[7/17/2025, 6:04:26 AM] [FHEM] alexa will not send proactive events
[7/17/2025, 6:04:26 AM] [FHEM] alexa uses ID: 5df5481f-f33f-faac-f394-cd6f1c0bb5e4bb7a
[7/17/2025, 6:04:26 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3B%7B%24defs%7Balexa%7D-%3E%7B%22alexa-fhem%20version%22%7D%20%3D%20%220.5.51%22%7D%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:26 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Bget%20alexa%20proxyToken%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:26 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Blist%20alexa%20.eventToken%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:26 AM] Server emitted error: {"code":"EADDRINUSE","errno":-48,"syscall":"listen","address":"127.0.0.1","port":34262}
[7/17/2025, 6:04:26 AM] Terminating - starting the listener not possible (another instance running?)
[7/17/2025, 6:04:26 AM] using config from /opt/fhem/alexa-fhem.cfg
*** CONFIG: parsed completely
[7/17/2025, 6:04:26 AM] os.homedir()=/root/
[7/17/2025, 6:04:26 AM] this is alexa-fhem 0.5.51
[7/17/2025, 6:04:26 AM] connecting to FHEM ...
[7/17/2025, 6:04:26 AM] [FHEM] defaults to: will not send proactive events
[7/17/2025, 6:04:26 AM] [FHEM] trying longpoll to listen for fhem events
[7/17/2025, 6:04:26 AM] [FHEM] starting longpoll: https://127.0.0.1:8083/fhem?XHR=1&inform=type=status;addglobal=1;filter=.*;since=null;fmt=JSON×tamp=1752725066750
[7/17/2025, 6:04:26 AM] [FHEM] got csrfToken: xxxxxxxxxxxxxxxxxxxx
[7/17/2025, 6:04:26 AM] [FHEM] Checking devices and attributes...
[7/17/2025, 6:04:26 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7BAttrVal(%22global%22%2C%22userattr%22%2C%22%22)%7D&fwcsrf=xxxxxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:26 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=jsonlist2%20TYPE%3Dalexa&fwcsrf=xxxxxxxxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:26 AM] [FHEM] waiting for events ...
[7/17/2025, 6:04:26 AM] [FHEM] Fetching FHEM devices...
[7/17/2025, 6:04:26 AM] [FHEM] fetching: https://127.0.0.1:8083/fhem?cmd=jsonlist2%20alexaName=..*&fwcsrf=xxxxxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:27 AM] [FHEM] alexa device is alexa
[7/17/2025, 6:04:27 AM] [FHEM] alexa will not send proactive events
[7/17/2025, 6:04:27 AM] [FHEM] alexa uses ID: 5df5481f-f33f-faac-f394-cd6f1c0bb5e4bb7a
[7/17/2025, 6:04:27 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3B%7B%24defs%7Balexa%7D-%3E%7B%22alexa-fhem%20version%22%7D%20%3D%20%220.5.51%22%7D%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:27 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Bget%20alexa%20proxyToken%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:27 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Blist%20alexa%20.eventToken%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxxxxxxxxxxx&XHR=1
[7/17/2025, 6:04:27 AM] Server listening on: http://127.0.0.1:27404 for proxy connections
[7/17/2025, 6:04:27 AM] *** SSH: checking proxy configuration
[7/17/2025, 6:04:27 AM] sshautoconf: home=/root/, spath=/root/.alexa, cpath=/opt/fhem/alexa-fhem.cfg, sshpath=/root/.ssh
[7/17/2025, 6:04:27 AM] Passed config: {"sshproxy":{"description":"FHEM Connector","ssh":"/usr/bin/ssh","options":["-i","/root/.ssh/id_rsa","-p",58824,"fhem-va.fhem.de"],"bind-ip":"127.0.0.1","port":27404},"connections":[{"server":"127.0.0.1","filter":"alexaName=..*","name":"FHEM","port":8083,"webname":"fhem","uid":0}]}
[7/17/2025, 6:04:27 AM] sshautoconf: SSH key seems to exist
[7/17/2025, 6:04:27 AM] sshautoconf: Our SSH key is known at the reverse proxy, good!
[7/17/2025, 6:04:27 AM] [FHEM]   executing: https://127.0.0.1:8083/fhem?cmd=%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%201%3B%3Bundef%7D%3Bjsonlist2%20alexa%3B%7B%24defs%7Balexa%7D-%3E%7B%22active%22%7D%20%3D%200%3B%3Bundef%7D&fwcsrf=xxxxxxxxxxxxxxxx&XHR=1
*** FHEM: connected



list alexa:
Internals:
   FD         20
   FUUID      5df5481f-f33f-faac-f394-cd6f1c0bb5e4bb7a
   FVERSION   39_alexa.pm:0.238200/2021-02-24
   LAST_START 2025-07-17 07:45:05
   LAST_STOP  2025-07-17 07:45:05
   NAME       alexa
   NOTIFYDEV  global,global:npmjs.*alexa-fhem.*
   NR         410
   NTFY_ORDER 50-alexa
   PARTIAL   
   PID        29088
   STARTS     144
   STATE      running /usr/local/bin/alexa-fhem
   TYPE       alexa
   active     0
   alexa-fhem version 0.5.51
   currentlogfile ./log/alexa-2025-07-17.log
   eventCount 575
   logfile    ./log/alexa-%Y-%m-%d.log
   CoProcess:
     cmdFn      alexa_getCMD
     name       alexaFHEM
     state      running /usr/local/bin/alexa-fhem
   Helper:
     DBLOG:
       alexaFHEM:
         LogSQL:
           TIME       1752731105.8429
           VALUE      running /usr/local/bin/alexa-fhem
       alexaFHEM.ProxyConnection:
         LogSQL:
           TIME       1752731108.17162
           VALUE      running; SSH connected
   READINGS:
     2025-07-17 07:45:05   alexaFHEM       running /usr/local/bin/alexa-fhem
     2025-07-17 07:45:08   alexaFHEM.ProxyConnection running; SSH connected
     2020-03-21 15:10:02   alexaFHEM.bearerToken crypt:xxx
     2020-03-21 15:10:02   alexaFHEM.skillRegKey crypt:xxx
   helper:
Attributes:
   alexaFHEM-auth crypt:0509040b0f5e5d015c4756534d1242085e51
   alexaFHEM-cmd /usr/local/bin/alexa-fhem
   alexaFHEM-config /opt/fhem/alexa-fhem.cfg
   alexaFHEM-home /root/
   alexaFHEM-log ./log/alexa-%Y-%m-%d.log
   alexaFHEM-sshUser fhem
   alexaMapping #Characteristic=<name>=<value>,...
On=verb=schalte,valueOn=an;ein,valueOff=aus,valueToggle=um

Brightness=verb=stelle,property=helligkeit,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

Hue=verb=stelle,valuePrefix=auf,values=rot:0;grün:128;blau:200
Hue=verb=färbe,values=rot:0;grün:120;blau:220

Saturation=verb=stelle,property=sättigung,valuePrefix=auf,values=AMAZON.NUMBER
Saturation=verb=sättige,values=AMAZON.NUMBER

TargetPosition=verb=mach,articles=den;die,values=auf:100;zu:0
TargetPosition=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

TargetTemperature=verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=grad

Volume:verb=stelle,valuePrefix=auf,values=AMAZON.NUMBER,valueSuffix=prozent

#Weckzeit=verb=stelle,valuePrefix=auf;für,values=AMAZON.TIME,valueSuffix=uhr
   alexaTypes #Type=<alias>[,<alias2>[,...]]
light=licht,lampen
blind=rolladen,rolläden,jalousie,jalousien,rollo,rollos
   devStateIcon stopped:control_home@red:start stopping:control_on_off@orange running.*:control_on_off@green:stop
   echoRooms  #<deviceId>=<room>

   fhemIntents #IntentName=<sample utterance>
gutenMorgen=guten morgen
guteNacht=gute nacht
   persons    #<personId>=<name>

   room       System->Alexa
   stateFormat alexaFHEM
   verbose    3

----------------------------------------------------
FHEM in TrueNAS-Jail
HMLGW + HM-Komponenten, alexa-fhem, Modbus/TCP, Modbus/RS485, LG-WebOS, Firmata, 1wire, ESP-RGBWW, DaikinAC per WLAN, Shellys, Denon AVR, Fronius WR, Helios Wohnraumlüftung, ...

passibe

Ok, ne, ist mir jetzt nicht sofort offensichtlich, was da das Problem ist.

Ein bisschen komisch ist, dass der longpoll einfach so endet ...
Zitat von: hugomckinley am 17 Juli 2025, 08:05:08[7/17/2025, 6:04:25 AM] [FHEM] longpoll ended, reconnect in: 200msec

Vielleicht müsstest du im Fehlerfall auch mal mitsudo lsof -i :34262checken, welcher Prozess da noch läuft/den Port belegt (ggfs. Port je nach EADDRINUSE-Fehlermeldung anpassen). Geht vermutlich auch mit netstat -tlnp
Aber, wenn du eh das System umziehst, dann hoffe ich mal, dass der Fehler sich einfach damit erledigt :D