[erledigt] Alexa (Rechte?) Probleme

Begonnen von Mitch, 19 Dezember 2019, 11:36:07

Vorheriges Thema - Nächstes Thema

Mitch

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!
FHEM im Proxmox Container

Mitch

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??
FHEM im Proxmox Container

Mitch

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

FHEM im Proxmox Container

Mitch

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  >:(
FHEM im Proxmox Container

Mitch

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.
FHEM im Proxmox Container

Mitch

Manchmal ist es praktisch, wenn niemand antwortet, dann muss man sich selber durchwurschteln und lernt dabei  ;)

Es läuft alles  8)
FHEM im Proxmox Container

hoppel118

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
Server: Openmediavault, XEON E3-1240L-v5, Supermicro X11SSH-CTF, 64GB ECC RAM, SSD, RAID-Z2
Homebridge | Alexa | Yowsup
Homematic | HomeConnect | MQTT | Philips Hue | Sonos | Unifi Network & Protect | vbus | Xiaomi

Mitch

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
FHEM im Proxmox Container

MadMax-FHEM

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
FHEM PI3B+ Bullseye: HM-CFG-USB, 40x HM, ZWave-USB, 13x ZWave, EnOcean-PI, 15x EnOcean, HUE/deCONZ, CO2, ESP-Multisensor, Shelly, alexa-fhem, ...
FHEM PI2 Buster: HM-CFG-USB, 25x HM, ZWave-USB, 4x ZWave, EnOcean-PI, 3x EnOcean, Shelly, ha-bridge, ...
FHEM PI3 Buster (Test)

LHBL2003

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 sorgt der nachfolgende Befehl immer dafür das Fhem die korrekten Rechte bekommt.


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