FHEM Forum

FHEM => Frontends => Sprachsteuerung => Thema gestartet von: Mitch am 19 Dezember 2019, 11:36:07

Titel: [erledigt] Alexa (Rechte?) Probleme
Beitrag von: Mitch am 19 Dezember 2019, 11:36:07
Hallo Zusammen,

wollte von meiner alten Alex Installation auf die neue gehen.
So wie im Wiki hat es schonmal nicht funktioniert, musste die CFG manuell anpassen.

Wenn ich jetzt Alexa starten möchte, bekomme folgende Fehler im Log:
2019.12.19 11:33:45 4: Alexa: last run duration was only 0 sec, restarting with delay
2019.12.19 11:33:45 3: Alexa: stopped
2019.12.19 11:33:45 3: Alexa: read: end of file reached while sysread
2019.12.19 11:33:45 5: Alexa: read: Startup rejected. Reason: TypeError: Path must be a string. Received undefined
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] No suitable, writable users home directory found
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] process.env.PWD set to /opt/fhem, but this is not writable
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] process.env.PWD=/opt/fhem
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] process.env.USERPROFILE=undefined
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] process.env.HOMEPATH=undefined
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] process.env.HOME set to /root, but this is not writable
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] process.env.HOME=/root
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] os.homedir() set to /root, but this is not writable
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] os.homedir()=/root
2019.12.19 11:33:45 5: Alexa: read: *** CONFIG: parsed completely
2019.12.19 11:33:45 5: Alexa: read: [2019-12-19 11:33:45] using config from /opt/fhem/alexa-fhem.cfg
2019.12.19 11:33:45 3: Alexa: using logfile: ./log/alexa-2019-12-19.log
2019.12.19 11:33:45 3: Alexa: starting
2019.12.19 11:33:45 2: Alexa: starting alexa-fhem: /usr/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg


Habe ich ein Rechteproblem?

Vielen Dank!
Titel: Antw:Alexa (Rechte?) Probleme
Beitrag von: Mitch am 19 Dezember 2019, 12:01:14
Hab jetzt mal testweise ein chmod 777 /opt/fhem/ gemacht und nun läuft Alexa zwar, aber ich bekomme

alexaFHEM.ProxyConnection
error; user homedir writable by group/other ('chmod 755 /opt/fhem' required)


mache ich ein chmod 755 /opt/fhem bekomme ich wieder den Fehler wie im ersten Post??
Titel: Antw:Alexa (Rechte?) Probleme
Beitrag von: Mitch am 19 Dezember 2019, 12:41:17
Okay, bin weiter, hatte tatsächlich ein Rechtproblem, was mir so noch nicht aufgefallen war.
im Ordern /opt/fhem/ waren die Rechte richtig auf User fhem, aber der Order selber war auf einen anderen User  :o

Titel: Antw:Alexa (Rechte?) Probleme
Beitrag von: Mitch am 19 Dezember 2019, 13:14:39
Hm, nach einem Neustart meines Servers wieder der Fehler:
2019.12.19 13:13:10 4: Alexa: last run duration was only 0 sec, restarting with delay
2019.12.19 13:13:10 3: Alexa: stopped
2019.12.19 13:13:10 3: Alexa: read: end of file reached while sysread
2019.12.19 13:13:10 5: Alexa: read: Startup rejected. Reason: TypeError: Path must be a string. Received undefined
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] No suitable, writable users home directory found
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] process.env.PWD=undefined
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] process.env.USERPROFILE=undefined
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] process.env.HOMEPATH=undefined
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] process.env.HOME set to /root, but this is not writable
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] process.env.HOME=/root
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] os.homedir() set to /root, but this is not writable
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] os.homedir()=/root
2019.12.19 13:13:10 5: Alexa: read: *** CONFIG: parsed completely
2019.12.19 13:13:10 5: Alexa: read: [2019-12-19 13:13:10] using config from /opt/fhem/alexa-fhem.cfg
2019.12.19 13:13:10 3: Alexa: using logfile: ./log/alexa-2019-12-19.log
2019.12.19 13:13:10 3: Alexa: starting


Rechte stimmen?

Was noch hinzu kommt, Homebridge geht auch nicht mehr  >:(
Titel: Antw:Alexa (Rechte?) Probleme
Beitrag von: Mitch am 19 Dezember 2019, 14:56:08
So, habe jetzt alles rückgängig gemacht.
Zumindest die Homebridge läuft wieder.

Wollte jetzt nochmal anfangen, bekomme aber den gleichen Fehler wieder:
2019.12.19 14:54:30 4: alexa: last run duration was only 1 sec, restarting with delay
2019.12.19 14:54:30 3: alexa: stopped
2019.12.19 14:54:30 3: alexa: read: end of file reached while sysread
2019.12.19 14:54:30 5: alexa: read: Startup rejected. Reason: TypeError: Path must be a string. Received undefined
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] No suitable, writable users home directory found
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] process.env.PWD=undefined
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] process.env.USERPROFILE=undefined
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] process.env.HOMEPATH=undefined
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] process.env.HOME set to /root, but this is not writable
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] process.env.HOME=/root
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] os.homedir() set to /root, but this is not writable
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] os.homedir()=/root
2019.12.19 14:54:30 5: alexa: read: *** CONFIG: parsed completely
2019.12.19 14:54:30 5: alexa: read: [2019-12-19 14:54:30] using config from /opt/fhem/alexa-fhem.cfg
2019.12.19 14:54:29 3: alexa: using logfile: ./log/alexa-2019-12-19.log
2019.12.19 14:54:29 3: alexa: starting
2019.12.19 14:54:29 2: alexa: starting alexa-fhem: /usr/bin/alexa-fhem -c /opt/fhem/alexa-fhem.cfg


Jetzt komm ich wirklich nicht weiter.
Titel: Antw:Alexa (Rechte?) Probleme
Beitrag von: Mitch am 19 Dezember 2019, 16:10:55
Manchmal ist es praktisch, wenn niemand antwortet, dann muss man sich selber durchwurschteln und lernt dabei  ;)

Es läuft alles  8)
Titel: Antw:[erledigt] Alexa (Rechte?) Probleme
Beitrag von: hoppel118 am 20 Dezember 2019, 15:53:18
Und was war nun genau dein Problem bzw. wie hast du es gelöst?

So bringt deine Selbstunterhaltung in der Zukunft niemandem etwas. ;)

Gruß Hoppel
Titel: Antw:[erledigt] Alexa (Rechte?) Probleme
Beitrag von: Mitch am 20 Dezember 2019, 15:59:18
Es waren mehrere Problemchen:

1. der Ordern fhem hatte falschen Besitzer
2. alte SSH Keys im Ordner /opt/fhem/.ssh
3. Reste vom alten Alexa
Titel: Antw:[erledigt] Alexa (Rechte?) Probleme
Beitrag von: MadMax-FHEM am 20 Dezember 2019, 16:17:03
Mit Suche wärst du vielleicht auch weitergekommen...

Der sichere/schnelle Weg:

Sicherung: alexa-fhem Ordner, config.json und Startscript...

ALLES alte löschen/deaktivieren (alexa-Start)...

Und dann einfach laut Wiki...

Evtl. config.json (alexa-fhem.cfg -> edit files) anpassen: eigenen Smart Home Skill (warum auch immer) bzw. Custom Skill eintragen...

Gruß, Joachim
Titel: Antw:[erledigt] Alexa (Rechte?) Probleme
Beitrag von: LHBL2003 am 07 Januar 2023, 21:59:18
Für alle die das Problem auch haben und eine Lösung benötigen mit mehr Info was man machen muss:

In den Ordner wechseln und die Rechte der Unterordner anzeigen lassen:

cd /opt
ls -l


Ergebnis im gut Fall:
drwxr-xr-x  16 fhem     dialout  4096  7. Jan 21:45 fhem

Der Ordner Fhem solte in der Mitte "fhem" und "dialout" als Rechte haben, andernfalls hatte man seine Rechne irgendwann einmal verbastelt.
Laut Otto123 https://forum.fhem.de/index.php?topic=75801.0 (https://forum.fhem.de/index.php?topic=75801.0) sorgt der nachfolgende Befehl immer dafür das Fhem die korrekten Rechte bekommt.


chown -R fhem: /opt/fhem
ls -l