FHEM Forum

FHEM => Anfängerfragen => Thema gestartet von: Bracew am 17 Januar 2016, 07:56:22

Titel: [Gelöst] Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 07:56:22
Hallo,

meinem RasPi mit FHEM ist gestern abend der Strom ausgefallen. Ich habe die SD-Karte mit einem Backup vom Oktober 2015 neu beschrieben, den RasPi neu gestartet, "apt-get update" und "apt-get upgrade" ausgeführt. Auch in FHEM habe ich ein Update gemacht.

Nun läuft FHEM wieder, aber...
  ... bei Restart bekomme ich die Meldung: "Forbidden command shutdown."
  ... bei Update bekomme ich die Meldung: "Forbidden command update."
  ... bei Edit Files bekomme ich keine Meldung und kann nichts mehr bearbeiten
  ... bei Select Style und Event Monitor kommt auch keine Reaktion.

Ich habe nun die ganze Nacht dran gesessen, den RasPi wieder flott zu machen und würde mich über Hilfe freuen, wie ich FHEM wieder so hinbekomme, dass ich die Konfiguration wieder in FHEM in der WEB Instanz bearbeiten, Updaten und Neu starten kann.

Danke Bracew

Übrigens hatte und habe ich "attr WEB editConfig 1" schon in der fhem.cfg
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 08:53:31
Kontrollier mal ob fhem Schreibrechte hat und ob der Benutzer/Gruppe fhem/dialout ist. Sonst die Rechte und Benutzer/Gruppe neu setzen.

VG
Frank
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Tom111 am 17 Januar 2016, 09:43:42
Zitat von: Bracew am 17 Januar 2016, 07:56:22
[...]Ich habe die SD-Karte mit einem Backup vom Oktober 2015 neu beschrieben[...]

Nur um sicher zu gehen; bei dem "Backup" handelt es sich um ein Image der Karte seinerzeit!?

Gruß
Tom
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 10:01:53
Hallo,

also ich habe nun alle Ordner und Dateien, außer den Ordner certs, Rekursiv auf Gruppe: dialout und Eigentümer: fhem mit den Rechten 0775 gesetzt. Dannach "sudo /etc/init.d/fhem stop" und "sudo /etc/init.d/fhem start".
Verhalten ist unverändert.

Ja, das Backup war ein Image der Ursprungs SD-Karte mit Win32DiskImager, welches ich im Oktober auf eine 2. Karte geschrieben hatte und seit dem im Schrank verwahrt hatte. Die 2. Karte habe ich nun in den RasPi getan und wie beschrieben die Updates gemacht.
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 10:03:08
ZitatNun läuft FHEM wieder, aber...

wenn´s kein Image wäre, würde fhem sicher auch nicht starten  ;)
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 10:04:40
Was passiert wenn du den Host komplett neu durchstartest?

Poste mal den Log vom Neustart
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 10:07:33
meinst Du einen "sudo reboot"?

Welches Log benötigst Du?
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 10:09:28
sudo shutdown -r now oder sudo reboot

den fhem Log
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 10:14:37
Falls das nicht einzugrenzen sein sollte, bist du wahrscheinlich schneller in dem du eine Karte mit einem neuen Image beschreibst und deine, vorher gesicherten Dateien, zurück kopierst (fhem.cfg, eigene gplots, 99_myUtils usw.)
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 10:15:40
OK, "sudo reboot" ist fertig und das fhem-Log (Auszug seit reboot) ist:
Zitat

2016.01.17 10:10:54 0: Server shutdown
2016.01.17 10:11:08 1: Including fhem.cfg
2016.01.17 10:11:08 3: telnetPort: port 7072 opened
2016.01.17 10:11:08 3: telnetPort: creating device allowed_telnetPort for attribute globalpassword
2016.01.17 10:11:09 3: WEB: port 8083 opened
2016.01.17 10:11:09 3: WEB: creating device allowed_WEB for attribute basicAuth
2016.01.17 10:11:10 3: WEBphone: port 8084 opened
2016.01.17 10:11:10 3: WEBphone: creating device allowed_WEBphone for attribute basicAuth
2016.01.17 10:11:10 3: WEBtablet: port 8085 opened
2016.01.17 10:11:10 3: WEBtablet: creating device allowed_WEBtablet for attribute basicAuth
2016.01.17 10:11:10 3: WEBtv: port 8086 opened
2016.01.17 10:11:10 2: eventTypes: loaded 244 events from ./log/eventTypes.txt
2016.01.17 10:11:13 3: [STV] You are using a deprecated MAC detection mechanism using ifconfig.
2016.01.17 10:11:13 3: [STV] Please install Pearl Modules libnet-address-ip-local-perl and libio-interface-perl
2016.01.17 10:11:17 1: Including ./log/fhem.save
2016.01.17 10:11:18 1: configfile: telnetPort: creating device allowed_telnetPort for attribute globalpassword
WEB: creating device allowed_WEB for attribute basicAuth
WEBphone: creating device allowed_WEBphone for attribute basicAuth
WEBtablet: creating device allowed_WEBtablet for attribute basicAuthstatefile: Please define admin first
Please define admin first
Please define allowedTelnet first
Please define allowedTelnet first
Please define allowedWEB first
Please define allowedWEB first
2016.01.17 10:11:18 1: usb create starting
2016.01.17 10:11:20 3: Probing CUL device /dev/ttyAMA0
2016.01.17 10:11:20 3: Probing TCM_ESP3 device /dev/ttyAMA0
2016.01.17 10:11:21 3: Probing FRM device /dev/ttyAMA0
2016.01.17 10:11:26 1: usb create end
2016.01.17 10:11:26 2: Error messages while initializing FHEM: configfile: telnetPort: creating device allowed_telnetPort for attribute globalpassword WEB: creating device allowed_WEB for attribute basicAuth WEBphone: creating device allowed_WEBphone for attribute basicAuth WEBtablet: creating device allowed_WEBtablet for attribute basicAuthstatefile: Please define admin first Please define admin first Please define allowedTelnet first Please define allowedTelnet first Please define allowedWEB first Please define allowedWEB first
2016.01.17 10:11:26 0: Featurelevel: 5.7
2016.01.17 10:11:26 0: Server started with 87 defined entities (fhem.pl:10510/2016-01-15 perl:5.014002 os:linux user:fhem pid:1991)
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 10:20:37
Jetzt hat er die allowed devices angelegt, mach ein save und nochmals, diesmal fhem shutdown restart, nochmal den Log posten, bitte in code tags

und
Please install Pearl Modules libnet-address-ip-local-perl and libio-interface-perl

Pearl das ist ein Versandhandel, oder ?? Da müsste Perl stehen  ;)
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 10:31:29
Also: "...ein save und nochmals, diesmal fhem shutdown restart..." gemacht:

Log:
Zitat
2016.01.17 10:25:21 0: Server shutdown
2016.01.17 10:25:25 1: Including fhem.cfg
2016.01.17 10:25:25 3: telnetPort: port 7072 opened
2016.01.17 10:25:26 3: WEB: port 8083 opened
2016.01.17 10:25:26 3: WEBphone: port 8084 opened
2016.01.17 10:25:26 3: WEBtablet: port 8085 opened
2016.01.17 10:25:26 3: WEBtv: port 8086 opened
2016.01.17 10:25:26 2: eventTypes: loaded 244 events from ./log/eventTypes.txt
2016.01.17 10:25:28 3: [STV] You are using a deprecated MAC detection mechanism using ifconfig.
2016.01.17 10:25:28 3: [STV] Please install Pearl Modules libnet-address-ip-local-perl and libio-interface-perl
2016.01.17 10:25:30 1: Including ./log/fhem.save
2016.01.17 10:25:30 1: usb create starting
2016.01.17 10:25:31 3: Probing CUL device /dev/ttyAMA0
2016.01.17 10:25:31 3: Probing TCM_ESP3 device /dev/ttyAMA0
2016.01.17 10:25:31 3: Probing FRM device /dev/ttyAMA0
2016.01.17 10:25:37 1: usb create end
2016.01.17 10:25:37 2: SecurityCheck:  WEBtv has no associated allowed device with basicAuth.  Restart FHEM for a new check if the problem is fixed, or set the global attribute motd to none to supress this message.
2016.01.17 10:25:37 0: Featurelevel: 5.7
2016.01.17 10:25:37 0: Server started with 87 defined entities (fhem.pl:10510/2016-01-15 perl:5.014002 os:linux user:fhem pid:3707)

Was meinst Du mit "...bitte in code tags"?
Es steht wirklich dort "Pearl", aber wie kann ich die Perl-Module installieren?
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 10:37:11
sudo apt-get install libnet-address-ip-local-perl && sudo apt-get install libio-interface-perl

Code Tags da hast du beim schreiben oben in der Leiste den # Button
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 10:48:33
Ich habe "sudo apt-get install libnet-address-ip-local-perl && sudo apt-get install libio-interface-perl" ausgeführt.

Das Log ist nun:
Zitat
2016.01.17 10:41:10 0: Server shutdown
2016.01.17 10:41:14 1: Including fhem.cfg
2016.01.17 10:41:14 3: telnetPort: port 7072 opened
2016.01.17 10:41:15 3: WEB: port 8083 opened
2016.01.17 10:41:15 3: WEBphone: port 8084 opened
2016.01.17 10:41:15 3: WEBtablet: port 8085 opened
2016.01.17 10:41:15 3: WEBtv: port 8086 opened
2016.01.17 10:41:15 2: eventTypes: loaded 244 events from ./log/eventTypes.txt
2016.01.17 10:41:17 3: [STV] defined with host: 192.168.0.102 port: 55000 MAC: b8:27:eb:b8:53:34
2016.01.17 10:41:19 1: Including ./log/fhem.save
2016.01.17 10:41:19 1: usb create starting
2016.01.17 10:41:20 3: Probing CUL device /dev/ttyAMA0
2016.01.17 10:41:21 3: Probing TCM_ESP3 device /dev/ttyAMA0
2016.01.17 10:41:21 3: Probing FRM device /dev/ttyAMA0

Den "# Button" habe ich nicht gefunden, wo muss ich den suchen? Im Browser-Menü oder im FHEM innerhalb des Browsers?
Ich habe den Log-Auszug mit WinSCP aus der /opt/fhem/log/fhem-2016-01.log Datei kopiert, meinst Du dort einen # Button?

FHEM sagt beim starten:
ZitatSecurityCheck:

WEBtv has no associated allowed device with basicAuth.
WEBtv soll auch ohne Passwort abfrage vom Fernseher mit eingeschrängtem Zugriff (ohne Edit, etc) aus funktioniert.


Nun geht auch der Zugriff auf Restart, Update, Edit Files.... wieder.
Ich bin sehr froh!!! Vielen Dank schon einmal dafür!!!
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 10:51:33
WEBtv has no associated allowed device with basicAuth.

Du kannst für die WEBtv Instanz noch ein Passwort vergeben, must du aber nicht

Der # Button, Code Tag
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 10:57:11
Und setz das
usb create starting

usb create Zeug´s mal auf disable oder kommentiere es aus, macht auch manchmal Probleme

VG
Frank
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: betateilchen am 17 Januar 2016, 10:58:47
Zitat von: franky08 am 17 Januar 2016, 10:20:37
Pearl das ist ein Versandhandel, oder ?? Da müsste Perl stehen  ;)

ja, müsste, tut es aber nicht:

      Log3 undef, 3, "[STV] Please install Pearl Modules libnet-address-ip-local-perl and libio-interface-perl";

(Zeile 242 in 70_STV.pm)

Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 11:00:49
Da war der Modulautor wohl zeitgleich zum programmieren noch auf Schnäppchenjagt...  ;D

VG
Frank
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 11:05:41
Hallo franky08,

für die WEBtv Instanz möchte ich kein Passwort vergeben. Auf diesem Wege können alle Familienmitglieder über den Fernseher (tv) FHEM benutzen ohne Veränderungen an den Einstellungen vornehmen zu können und schauen ob sie E-Mails bekommen haben.

Ja, jetzt habe ich verstanden, was Du meinst. Hier im Forum habe ich die Zitat-Auszeichnung und nicht die Code-Auszeichnung verwendet. Entschuldigung dafür, dass ich gedacht habe der Log-Auszug wäre ein Zitat, mache ich das nächste Mal besser.

Ich denke, dass nun alles wieder prima läuft. Nochmals vielen, vielen Dank für die schnelle Hilfe.

Nun kann ich Kaffee trinken gehen und Schnee räumen. Dannach möchte ich den Code innerhalb fhem.cfg wieder mit meinen zugehörigen #-Kommentaren versehen und sortieren. So kann ich es als Gelegenheits-Benutzer besser verstehen, wenn ich das nächste mal wieder in die fhem.cfg schaue.

Gruß Bracew
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 11:13:39
Hallo,

im fhem.cfg-File steh nun neu drin:
configfile: telnetPort: creating device allowed_telnetPort for attribute globalpassword\
WEB: creating device allowed_WEB for attribute basicAuth\
WEBphone: creating device allowed_WEBphone for attribute basicAuth\
WEBtablet: creating device allowed_WEBtablet for attribute basicAuthstatefile: Please define admin first\
Please define admin first\
Please define allowedTelnet first\
Please define allowedTelnet first\
Please define allowedWEB first\
Please define allowedWEB first


muss ich diesbezüglich noch etwas unternehmen?
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 11:16:15
Bei mir war das nach save und shutdown restart weg
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: betateilchen am 17 Januar 2016, 11:23:22
Die Logausgabe steht doch nicht im configfile  :o

Ausserdem muss man die mal richtig sortieren:


configfile: telnetPort: creating device allowed_telnetPort for attribute globalpassword\
WEB: creating device allowed_WEB for attribute basicAuth\
WEBphone: creating device allowed_WEBphone for attribute basicAuth\
WEBtablet: creating device allowed_WEBtablet for attribute basicAuth

statefile: Please define admin first\
Please define admin first\
Please define allowedTelnet first\
Please define allowedTelnet first\
Please define allowedWEB first\
Please define allowedWEB first


Du hattest offenbar in Deiner vorherigen Installation die Geräte anders benannt.
Die Meldungen kommen also nicht aus der Konfiguration, sondern aus dem (vorher) abgespeicherten Systemzustand.

Am einfachsten beendest Du Dein fhem, löscht die Datei fhem.save im Verzeichnis ./log und startest Dein fhem neu. Danach sollten die Meldungen verschwunden sein.
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 11:30:59
Also ich habe:
- "sudo /etc/init.d/fhem stop" in PuTTY
- /opt/fhem/log/fhem.save gelöscht mit WinSCP
- "sudo /etc/init.d/fhem start" in PuTTY

trotzdem steht in fhem.cfg noch:
attr global motd Error messages while initializing FHEM:\
configfile: telnetPort: creating device allowed_telnetPort for attribute globalpassword\
WEB: creating device allowed_WEB for attribute basicAuth\
WEBphone: creating device allowed_WEBphone for attribute basicAuth\
WEBtablet: creating device allowed_WEBtablet for attribute basicAuthstatefile: Please define admin first\
Please define admin first\
Please define allowedTelnet first\
Please define allowedTelnet first\
Please define allowedWEB first\
Please define allowedWEB first
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: betateilchen am 17 Januar 2016, 11:34:07
Ich glaube nicht, dass die Datei fhem.save wirklich gelöscht wurde.
Warum machst Du das nicht auch mit putty?

sudo rm /opt/fhem/log/fhem.save

Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 11:36:18
Ok, kann ich auch mit PuTTY mal machen, Ergebnis:
Zitat
sudo rm /opt/fhem/log/fhem.save
rm: Entfernen von ,,/opt/fhem/log/fhem.save" nicht möglich: Datei oder Verzeichnis nicht gefunden
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: betateilchen am 17 Januar 2016, 11:40:09
Naja, nun hast Du zumindest mal eine Rückmeldung.

Bei einem fhem Neustart ist nun kein statefile vorhanden. Kommen die Meldungen jetzt immer noch beim Neustart?
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 11:44:50
Ich habe nun nochmal:
- "sudo /etc/init.d/fhem stop" in PuTTY
- "sudo /etc/init.d/fhem start" in PuTTY
- in fhem auf den Restart-Button gedrueckt.

Auszug aus fhem.cfg (Kopie aus Firefox mit FHEM nach Edit Files Button und fhem.cfg Button):
attr global motd Error messages while initializing FHEM:\
configfile: telnetPort: creating device allowed_telnetPort for attribute globalpassword\
WEB: creating device allowed_WEB for attribute basicAuth\
WEBphone: creating device allowed_WEBphone for attribute basicAuth\
WEBtablet: creating device allowed_WEBtablet for attribute basicAuthstatefile: Please define admin first\
Please define admin first\
Please define allowedTelnet first\
Please define allowedTelnet first\
Please define allowedWEB first\
Please define allowedWEB first

Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: betateilchen am 17 Januar 2016, 11:47:17
oh Mann...

attr global motd none

Anschließend ein save und der Spuk ist vorbei.
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 11:50:38
Jaaa, Tschaka, das wars!
Meldungen sind nicht mehr im fhem.cfg
Text ist nicht mehr in fhem.cfg
Vielen Dank auch Dir!
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: betateilchen am 17 Januar 2016, 11:51:53
Und schreibe bitte NIE WIEDER "Meldungen sind in der fhem.cfg" - das ist völliger Quatsch.

Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: Bracew am 17 Januar 2016, 11:53:53
Ok, korrigiert, siehe zu vor.
Danke und schönen Sonntag noch!
Titel: Antw:Forbidden command nach RasPi Stromausfall und FHEM Restore
Beitrag von: franky08 am 17 Januar 2016, 13:25:44
Schreib mal noch ein gelöst vor den Thread Titel.

VG
Frank