Nach Neuinstallation aufgrund Upgrade Linux auf Bullseye light mysql Fehler

Begonnen von UweUwe, 18 November 2022, 22:43:13

Vorheriges Thema - Nächstes Thema

UweUwe

Hallo betateilchen

im Logfile sehe ich noch folgende Fehlermeldung:

2022.11.23 16:49:32 1: DbLog DBLogging - Error while reading /opt/fhem/db.conf: 'could not read connection'
2022.11.23 16:49:32 1: define DBLogging DbLog /opt/fhem/db.conf .*:.*: could not read connection


die db.conf sieht folgendermassen aus:

pi@Vagabundi02:~ $ cat  /opt/fhem/db.conf
O
####################################################################################
# database configuration file
#
# NOTE:
# If you don't use a value for user / password please delete the leading hash mark
# and write 'user => ""' respectively 'password => ""' instead !
#
#
## for MySQL
####################################################################################
%dbconfig= (
    connection => "mysql:database=fhem;host=localhost;port=3306",
    user => "fhemuser",
    password => "Passwort",
    # optional enable(1) / disable(0) UTF-8 support (at least V 4.042 is necessary)
    utf8 => 1
);
####################################################################################
#
## for PostgreSQL
####################################################################################
#%dbconfig= (
#    connection => "Pg:database=fhem;host=localhost",
#    user => "fhemuser",
#    password => "fhempassword"
#);
####################################################################################
#
## for SQLite (username and password stay empty for SQLite)
####################################################################################
#%dbconfig= (
#    connection => "SQLite:dbname=/opt/fhem/fhem.db",
#    user => "",
#    password => ""
#);
####################################################################################

betateilchen

Du verstehst einfach die Antworten nicht, die man Dir gibt - oder Du liest sie nicht vollständig.

Ok. Wir versuchen es anders. EINE Frage = EINE Antwort.

Was liefert cat /etc/systemd/system/fhem.service ?
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

betateilchen

Zitat von: UweUwe am 23 November 2022, 16:58:26
Hallo betateilchen

im Logfile sehe ich noch folgende Fehlermeldung:

Im Moment völlig irrelevant.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

UweUwe

pi@Vagabundi02:~ $ cat /etc/systemd/system/fhem.service
# $Id: fhem.service 19235 2019-04-21 13:26:17Z betateilchen $

[Unit]
Description=FHEM Home Automation
Wants=network.target
After=network.target
#Requires=postgresql.service
#After=postgresql.service
#Requires=mysql.service
#After=mysql.service

[Service]
Type=forking
User=fhem
Group=dialout
WorkingDirectory=/opt/fhem
ExecStart=/usr/bin/perl fhem.pl fhem.cfg
#ExecStart=/usr/bin/perl fhem.pl configDB
Restart=always

[Install]
WantedBy=multi-user.target

betateilchen

-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

UweUwe

Hier die Antwort:

pi@Vagabundi02:~ $ sudo service fhem status
● fhem.service - FHEM Home Automation
     Loaded: loaded (/etc/systemd/system/fhem.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2022-11-23 16:26:56 CET; 44min ago
    Process: 3754 ExecStart=/usr/bin/perl fhem.pl fhem.cfg (code=exited, status=0/SUCCESS)
   Main PID: 3756 (perl)
      Tasks: 13 (limit: 1596)
        CPU: 51.251s
     CGroup: /system.slice/fhem.service
             ├─3756 /usr/bin/perl fhem.pl fhem.cfg
             ├─3762 node /usr/local/bin/alexa-fhem -c ./alexa-fhem.cfg -a xx:xx
             └─3781 /usr/bin/ssh -R 1234:127.0.0.1:46331 -oServerAliveInterval=90 -i /opt/fhem/.ssh/id_rsa -p 58824 fhe>

Nov 23 17:09:12 Vagabundi02 sudo[5477]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=999)
Nov 23 17:09:23 Vagabundi02 sudo[5477]: pam_unix(sudo:session): session closed for user root
Nov 23 17:09:53 Vagabundi02 sudo[5496]:     fhem : PWD=/opt/fhem ; USER=root ; COMMAND=/opt/fhem/lescan.sh 7C:2F:80:D1:>
Nov 23 17:09:53 Vagabundi02 sudo[5496]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=999)
Nov 23 17:10:04 Vagabundi02 sudo[5496]: pam_unix(sudo:session): session closed for user root
Nov 23 17:10:34 Vagabundi02 sudo[5525]:     fhem : PWD=/opt/fhem ; USER=root ; COMMAND=/opt/fhem/lescan.sh 7C:2F:80:D1:>
Nov 23 17:10:34 Vagabundi02 sudo[5525]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=999)
Nov 23 17:10:45 Vagabundi02 sudo[5525]: pam_unix(sudo:session): session closed for user root
Nov 23 17:11:16 Vagabundi02 sudo[5549]:     fhem : PWD=/opt/fhem ; USER=root ; COMMAND=/opt/fhem/lescan.sh 7C:2F:80:D1:>
Nov 23 17:11:16 Vagabundi02 sudo[5549]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=999)

betateilchen

-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

UweUwe

pi@Vagabundi02:~ $ cat /opt/fhem/fhem.cfg | grep DbLog
attr global userattr DbLogExclude DbLogInclude DbLogValueFn:textField-long alarmDevice:Actor,Sensor alarmSettings alexaName alexaProactiveEvents:1,0 alexaRoom cmdIcon devStateIcon:textField-long devStateStyle genericDeviceType:security,ignore,switch,outlet,light,blind,thermometer,thermostat,contact,garage,window,lock,scene homebridgeMapping:textField-long icon msgContactAudio msgContactLight msgContactMail msgContactPush msgContactScreen msgParams msgPriority msgRecipient msgRecipientAudio msgRecipientLight msgRecipientMail msgRecipientPush msgRecipientScreen msgRecipientText msgTitle msgTitleShrt msgType:text,push,mail,screen,light,audio,queue sortby webCmd webCmdLabel:textField-long widgetOverride
attr global DbLogExclude .*
attr WEB DbLogExclude .*
attr Logfile DbLogExclude .*
attr autocreate DbLogExclude .*
attr eventTypes DbLogExclude .*
attr initialUsbCheck DbLogExclude .*
define at_DbLoggingReduce at *03:00:00 set DBLogging reduceLogNbl 90 average
setuuid at_DbLoggingReduce 5c770347-f33f-813e-edb1-7376c410d2058fec
attr at_DbLoggingReduce room LOGGING
attr myHmUART DbLogExclude .*
attr virtualCCU DbLogExclude .*
attr Rauchmelder_Team DbLogExclude .*
attr Taster_Wohni DbLogExclude .*
attr Rauch_Wohn DbLogExclude .*
attr Rauch_Deichsel DbLogExclude .*
attr AAA_Hand_Wohni DbLogExclude .*
attr Klima_Wohni DbLogExclude .*
attr Klima_Wohni DbLogInclude temperature,humidity,state
define n_DbLogExclude notify global:DEFINED.* attr $EVTPART1 DbLogExclude .*
setuuid n_DbLogExclude 5c7e714d-f33f-813e-9226-dd518caecabc1bb0
attr n_DbLogExclude DbLogExclude .*
attr BluetoothAnwesend DbLogExclude .*
attr N.Present_Vagabundi DbLogExclude .*
attr globalMsg DbLogExclude .*
attr pushmsg DbLogExclude .*
attr W_ReisenWeblink DbLogExclude .*
attr GPS_global_upd DbLogExclude .*
attr GPSlat_global_upd DbLogExclude .*
attr Wettervorhersage_Morgen DbLogExclude .*
attr FileLog_T_Wohni DbLogExclude .*
attr c_grep DbLogExclude .*
attr Klima_Deichsel DbLogExclude .*
attr Klima_Deichsel DbLogInclude state,humidity,temperature
attr FileLog_Klima_Deichsel DbLogExclude .*
attr SVG_DBLogging_2 DbLogExclude .*
attr FileLog_T_Wohn DbLogExclude .*
attr T_Wohni DbLogExclude .*
attr FileLog_HM_690BB9 DbLogExclude .*
attr virtualCCU_Btn2 DbLogExclude .*
attr virtualCCU_Btn3 DbLogExclude .*
attr virtualCCU_Btn4 DbLogExclude .*
attr virtualCCU_Btn5 DbLogExclude .*
attr virtualCCU_Btn6 DbLogExclude .*
attr virtualCCU_Btn7 DbLogExclude .*
attr virtualCCU_Btn8 DbLogExclude .*
attr virtualCCU_Btn9 DbLogExclude .*
attr W_Reisen DbLogExclude .*
attr GPS_notify DbLogExclude .*
attr ui DbLogExclude .*
attr 4fach DbLogExclude .*
attr FileLog_4fach DbLogExclude .*
attr ChannelFussboden DbLogExclude .*
attr ChannelWasserAussen DbLogExclude .*
attr ChannelStromAussenvorne DbLogExclude .*
attr ChannelStromAussenhinten DbLogExclude .*
attr Heizung DbLogExclude .*
attr FileLog_Heizung DbLogExclude .*
attr Heizung_Weather DbLogExclude .*
attr Heizung_Climate DbLogExclude .*
attr Heizung_WindowRec DbLogExclude .*
attr Heizung_remote DbLogExclude .*
attr Heizung_SwitchTr DbLogExclude .*
attr Motion_Vagabundi DbLogExclude .*
attr FileLog_Motion_Vagabundi DbLogExclude .*
attr Import DbLogExclude .*
attr Vaga_HeizungNachtabsenkung DbLogExclude .*
attr di_Heizung_morgens DbLogExclude .*
attr AussenWasseraus_DreiMinuten DbLogExclude .*
attr alarm0.off.N DbLogExclude .*
attr alarm0.on.N DbLogExclude .*
attr alarm0.arm.N DbLogExclude .*
attr alarm0.disarm.N DbLogExclude .*
attr alarm2.off.N DbLogExclude .*
attr alarm2.on.N DbLogExclude .*
attr alarm2.arm.N DbLogExclude .*
attr alarm2.disarm.N DbLogExclude .*
attr alexa DbLogExclude .*
define DBLogging DbLog /opt/fhem/db.conf .*:.*
attr DBLogging DbLogExclude .*
pi@Vagabundi02:~ $

betateilchen

-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

UweUwe

pi@Vagabundi02:~ $ cat /opt/fhem/db.conf
O
####################################################################################
# database configuration file
#
# NOTE:
# If you don't use a value for user / password please delete the leading hash mark
# and write 'user => ""' respectively 'password => ""' instead !
#
#
## for MySQL
####################################################################################
%dbconfig= (
    connection => "mysql:database=fhem;host=localhost;port=3306",
    user => "fhemuser",
    password => "aufReisen",
    # optional enable(1) / disable(0) UTF-8 support (at least V 4.042 is necessary)
    utf8 => 1
);
####################################################################################
#
## for PostgreSQL
####################################################################################
#%dbconfig= (
#    connection => "Pg:database=fhem;host=localhost",
#    user => "fhemuser",
#    password => "fhempassword"
#);
####################################################################################
#
## for SQLite (username and password stay empty for SQLite)
####################################################################################
#%dbconfig= (
#    connection => "SQLite:dbname=/opt/fhem/fhem.db",
#    user => "",
#    password => ""
#);
####################################################################################
pi@Vagabundi02:~ $
pi@Vagabundi02:~ $
pi@Vagabundi02:~ $ cat /opt/fhem/db.conf
O
####################################################################################
# database configuration file
#
# NOTE:
# If you don't use a value for user / password please delete the leading hash mark
# and write 'user => ""' respectively 'password => ""' instead !
#
#
## for MySQL
####################################################################################
%dbconfig= (
    connection => "mysql:database=fhem;host=localhost;port=3306",
    user => "fhemuser",
    password => "aufReisen",
    # optional enable(1) / disable(0) UTF-8 support (at least V 4.042 is necessary)
    utf8 => 1
);
####################################################################################
#
## for PostgreSQL
####################################################################################
#%dbconfig= (
#    connection => "Pg:database=fhem;host=localhost",
#    user => "fhemuser",
#    password => "fhempassword"
#);
####################################################################################
#
## for SQLite (username and password stay empty for SQLite)
####################################################################################
#%dbconfig= (
#    connection => "SQLite:dbname=/opt/fhem/fhem.db",
#    user => "",
#    password => ""
#);
####################################################################################

betateilchen

Warum machst Du das immer zweimal?

Zitat
pi@Vagabundi02:~ $ cat /opt/fhem/db.conf
O
####################################################################################


Nimm mal das O in der ersten Zeile der Konfigurationsdatei raus.
-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

UweUwe

Hab gerade festgestellt, das in der Detei:
/opt/fhem/db.conf

in der erste Zeile ein "O" sitzen könnte. Ich mach den mal raus und versuche es nochmals.

betateilchen

-----------------------
Formuliere die Aufgabe möglichst einfach und
setze die Lösung richtig um - dann wird es auch funktionieren.
-----------------------
Lesen gefährdet die Unwissenheit!

UweUwe

Hallo betateilchen,

der O war das Problem! Jetzt konnte ich das device definieren und es ist connected


Save config ?
ui
Alarmanlage
A-Strom
A-Wasser
ALARM
Alarm
Anwesenheit
CUL_HM
Draussen
Entwicklung
F-Heizung
GERAETE
Homematic
IPAD
LOGGING
Unsorted
Wohnraum
icoEverything Everything
Logfile
Commandref
Remote doc
Edit files
Select style
Event monitor
CodeImport

Internals:
   CFGFN     
   COLUMNS    field length used for Device: 64, Type: 64, Event: 512, Reading: 64, Value: 128, Unit: 32
   CONFIGURATION /opt/fhem/db.conf
   DEF        /opt/fhem/db.conf .*:.*
   FUUID      637e4c54-f33f-813e-b9f8-d83727bb55002b0b
   FVERSION   93_DbLog.pm:v4.13.2-s26672/2022-11-07
   MODE       synchronous
   MODEL      MYSQL
   NAME       DBLogging
   NR         258
   NTFY_ORDER 50-DBLogging
   PID        3756
   REGEXP     .*:.*
   STATE      connected
   TYPE       DbLog
   UTF8       1
   dbconn     mysql:database=fhem;host=localhost;port=3306
   dbuser     fhemuser
   eventCount 3
   HELPER:
     COLSET     1
     DEVICECOL  64
     EVENTCOL   512
     OLDSTATE   connected
     PACKAGE    main
     READINGCOL 64
     TC         current
     TH         history
     TYPECOL    64
     UNITCOL    32
     VALUECOL   128
     VERSION    4.13.2
   READINGS:
     2022-11-23 17:37:40   CacheOverflowLastNum 0
     2022-11-23 17:37:40   CacheOverflowLastState normal
     2022-11-23 17:41:01   state           connected
Attributes:
   DbLogExclude .*
   room       LOGGING



Vielen Dank für die Unterstützung..

Wernieman

- Bitte um Input für Output
- When there is a Shell, there is a Way
- Wann war Dein letztes Backup?

Wie man Fragen stellt: https://tty1.net/smart-questions_de.html