Mysql goes down now for 7 days - need help… what could i try?
Thanks for your help?
changed the head title of this thread form
Mysql and postgresql down / no updates possible
to
Mysql and postgresql go down
since with the help of @rodinux updates do work now
__
still don’t know what how to solve the rest of the problem
It’s hard to identify what’s going wrong…
Did you have reboot your server ?? why you have got an error here
OSError: [Errno 5] Input/output error: '/var/log/yunohost/categories/operation/20240919-071642-tools_reboot.yml'
It seems the DB is corrupted, it’s hard to found how repair it
Look at this post Getting error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed” when starting MySQL
Or you can try force recovery
put innodb_force_recovery=1 under mysqld, restarted MariaDB. This time, MariaDB started. I then exported all my databases, removed the innodb_force_recovery=1 option, restarted MariaDB again
Here something similar (in french) Mysql ne démarre plus : [ERROR] InnoDB: Malformed log record; - #8 by tramwiste
You should monitor it and evaluate if you need to increase the RAM or make any change to improve the performance of the server…
You also have also the service postgresql down ?
Have you logs for postgresql ?
cat /var/log/postgresql/postgresql-13-main.log
cat /var/log/postgresql/postgresql-13-main.log.1
What are the list of apps used ?
Can you say us what returns (perhaps need mysql running)
mysql -e "show databases;"
and for list postgresql databases (perhaps also need the service running)
su postgres
postgres@mymachine:/root$ psql
could not change directory to "/root": Permission denied
psql (13.16 (Debian 13.16-0+deb11u1))
Type "help" for help.
postgres=# \list
Or you can look for in the apps settings in /etc/yunohost/apps/$app/settings.yml
reboot did work last weak at a second try
but have a look of what i got just now going to
/yunohost/admin/#/services
/yunohost/admin/#/services
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/moulinette/interfaces/api.py", line 450, in process
ret = self.actionsmap.process(arguments, timeout=30, route=_route)
File "/usr/lib/python3/dist-packages/moulinette/actionsmap.py", line 574, in process
return func(**arguments)
File "/usr/lib/python3/dist-packages/yunohost/service.py", line 360, in service_status
output = {
File "/usr/lib/python3/dist-packages/yunohost/service.py", line 361, in <dictcomp>
s: _get_and_format_service_status(s, infos) for s, infos in services.items()
File "/usr/lib/python3/dist-packages/yunohost/service.py", line 398, in _get_and_format_service_status
raw_status, raw_service = _get_service_information_from_systemd(systemd_service)
File "/usr/lib/python3/dist-packages/yunohost/service.py", line 380, in _get_service_information_from_systemd
service_unit = manager.LoadUnit(service + ".service")
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 72, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
return self._connection.call_blocking(self._named_service,
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.InvalidArgs: Unit name phpdpkg-query: error: parsing file '/var/lib/dpkg/status' near line 0:-fpm.service is not valid.
and going to /yunohost/admin/#/update
just gave me:
/yunohost/admin/#/update
Fehler: "500"
Aktion: "PUT" /yunohost/api/update/all
Fehlermeldung:
Kann den Cache von APT (Debians Paketmanager) nicht aktualisieren. Hier ist ein Auszug aus den sources.list-Zeilen, die helfen könnten, das Problem zu identifizieren:
sources.list:deb http://deb.debian.org/debian bullseye main contrib non-free
sources.list:deb http://security.debian.org/debian-security bullseye-security main contrib non-free
sources.list:deb http://deb.debian.org/debian bullseye-updates main contrib non-free
sources.list.d/extra_php_version.list:deb https://packages.sury.org/php/ bullseye main
sources.list.d/yunohost.list:deb http://forge.yunohost.org/debian/ bullseye stable
sources.list.d/raspi.list:deb http://archive.raspberrypi.org/debian/ bullseye main
reboot did work now without problems:
root@my:~# cat /var/log/postgresql/postgresql-13-main.log
root@my:~# cat /var/log/postgresql/postgresql-13-main.log.1
2024-09-13 14:57:15.041 BST [1970306] LOG: received SIGHUP, reloading configuration files
2024-09-13 15:17:34.620 BST [926] LOG: starting PostgreSQL 13.16 (Debian 13.16-0+deb11u1) on aarch64-u
nknown-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit
2024-09-13 15:17:34.631 BST [926] LOG: listening on IPv6 address "::1", port 5432
2024-09-13 15:17:34.631 BST [926] LOG: listening on IPv4 address "127.0.0.1", port 5432
2024-09-13 15:17:34.675 BST [926] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2024-09-13 15:17:35.047 BST [939] LOG: database system was interrupted; last known up at 2024-09-13 15
:42:32 BST
2024-09-13 15:17:35.947 BST [939] LOG: database system was not properly shut down; automatic recovery
in progress
2024-09-13 15:17:36.129 BST [939] LOG: redo starts at 0/F0A34FE8
2024-09-13 15:17:36.176 BST [939] LOG: invalid record length at 0/F0A3BFB0: wanted 24, got 0
2024-09-13 15:17:36.176 BST [939] LOG: redo done at 0/F0A3BF88
2024-09-13 15:17:37.105 BST [926] LOG: database system is ready to accept connections
root@my:~# mysql -e "show databases;"
+--------------------+
| Database |
+--------------------+
| hubzilla |
| hubzilla-save |
| information_schema |
| mysql |
| nextcloud |
| performance_schema |
| phpmyadmin |
| wallabag2 |
+--------------------+
root@my:~# su postgres
postgres@my:/root$ psql
could not change directory to "/root": Permission denied
psql (13.16 (Debian 13.16-0+deb11u1))
Type "help" for help.
postgres=#
well…
postgresql seems working this time… isn’t it ?
right now it is… but i guess it will be down in few minutes
what is the apps using it ?
not sure about cryptpad but synapse does for sure
after reboot the update functions seams to work fine and also
/yunohost/admin/#/services
show results like it could
Hmmmm… I think perhaps something wrong with synapse… but I can’t be sure…
All the services works ?
I was looking this with the
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.InvalidArgs
but it not really the same error
after reoot
all services run but coturn-synapse is not
You can try to restart the service, and if it doesn’t work, have a look at the service logs, you can do this with yunohost service restart coturn-synapse
and yunohost service log coturn-synapse
.
over night postgresql kept running
root@my:~# yunohost service restart coturn-synapse
Success! Service 'coturn-synapse' restarted
root@my:~# yunohost service log coturn-synapse
journalctl:
- -- Journal begins at Wed 2023-08-02 21:17:01 BST, ends at Tue 2024-09-24 06:33:08 BST. --
- Sep 13 15:17:31 turnserver[545]: 0: : log file opened: /var/log/matrix-synapse/turnserver.log
- Sep 13 15:17:31 turnserver[545]: 0: :
- Sep 13 15:17:31 turnserver[545]: RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server
- Sep 13 15:17:31 turnserver[545]: Version Coturn-4.5.2 'dan Eider'
- Sep 13 15:17:31 turnserver[545]: 0: :
- Sep 13 15:17:31 turnserver[545]: Max number of open files/sockets allowed for this process: 999999
- Sep 13 15:17:31 turnserver[545]: 0: :
- Sep 13 15:17:31 turnserver[545]: Due to the open files/sockets limitation,
- Sep 13 15:17:31 turnserver[545]: max supported number of TURN Sessions possible is: 499500 (approximately)
- Sep 13 15:17:31 turnserver[545]: 0: :
- Sep 13 15:17:31 turnserver[545]: ==== Show him the instruments, Practical Frost: ====
- Sep 13 15:17:31 turnserver[545]: 0: : TLS supported
- Sep 13 15:17:31 turnserver[545]: 0: : DTLS supported
- Sep 13 15:17:31 turnserver[545]: 0: : DTLS 1.2 supported
- Sep 13 15:17:31 turnserver[545]: 0: : TURN/STUN ALPN supported
- Sep 13 15:17:31 turnserver[545]: 0: : Third-party authorization (oAuth) supported
- Sep 13 15:17:31 turnserver[545]: 0: : GCM (AEAD) supported
- Sep 13 15:17:31 turnserver[545]: 0: : OpenSSL compile-time version: OpenSSL 1.1.1k 25 Mar 2021 (0x101010bf)
- Sep 13 15:17:31 turnserver[545]: 0: :
- Sep 13 15:17:31 turnserver[545]: 0: : SQLite supported, default database location is /var/lib/turn/turndb
- Sep 13 15:17:31 turnserver[545]: 0: : Redis supported
- Sep 13 15:17:31 turnserver[545]: 0: : PostgreSQL supported
- Sep 13 15:17:31 turnserver[545]: 0: : MySQL supported
- Sep 13 15:17:31 turnserver[545]: 0: : MongoDB is not supported
- Sep 13 15:17:31 turnserver[545]: 0: :
- Sep 13 15:17:31 turnserver[545]: 0: : Default Net Engine version: 3 (UDP thread per CPU core)
- Sep 13 15:17:31 turnserver[545]: =====================================================
- Sep 13 15:17:31 turnserver[545]: 0: : Domain name:
- Sep 13 15:17:31 turnserver[545]: 0: : Default realm: domain.tld
- Sep 13 15:17:31 turnserver[545]: 0: :
- Sep 13 15:17:31 turnserver[545]: CONFIGURATION ALERT: You specified --lt-cred-mech and --use-auth-secret in the sa
me time.
- Sep 13 15:17:31 turnserver[545]: Be aware that you could not mix the username/password and the shared secret based
auth methods.
- Sep 13 15:17:31 turnserver[545]: Shared secret overrides username/password based auth method. Check your configura
tion!
- Sep 13 15:17:31 turnserver[545]: 0: : SSL23: Certificate file found: /etc/yunohost/certs/domain.tld/crt.pem
- Sep 13 15:17:31 turnserver[545]: 0: : SSL23: Private key file found: /etc/yunohost/certs/domain.tld/key.pem
- Sep 13 15:17:31 turnserver[545]: 0: : TLS1.2: Certificate file found: /etc/yunohost/certs/domain.tld/crt.pem
- Sep 13 15:17:31 turnserver[545]: 0: : TLS1.2: Private key file found: /etc/yunohost/certs/domain.tld/key.pem
- Sep 13 15:17:31 turnserver[545]: 0: : TLS cipher suite: DEFAULT
- Sep 13 15:17:31 turnserver[545]: 0: : DTLS: Certificate file found: /etc/yunohost/certs/domain.tld/crt.pem
- Sep 13 15:17:31 turnserver[545]: 0: : DTLS: Private key file found: /etc/yunohost/certs/domain.tld/key.pem
- Sep 13 15:17:31 turnserver[545]: 0: : DTLS1.2: Certificate file found: /etc/yunohost/certs/domain.tld/crt.pem
- Sep 13 15:17:31 turnserver[545]: 0: : DTLS1.2: Private key file found: /etc/yunohost/certs/domain.tld/key.pem
- Sep 13 15:17:31 turnserver[545]: 0: : DTLS cipher suite: DEFAULT
- Sep 13 15:17:31 turnserver[545]: 0: : NO EXPLICIT LISTENER ADDRESS(ES) ARE CONFIGURED
- Sep 13 15:17:31 turnserver[545]: 0: : ===========Discovering listener addresses: =========
- Sep 13 15:17:31 turnserver[545]: 0: : Listener address to use: 127.0.0.1
- Sep 13 15:17:31 turnserver[545]: 0: : Listener address to use: ::1
- Sep 13 15:17:31 turnserver[545]: 0: : ERROR: main: Cannot configure any meaningful IP listener address
- Sep 24 06:32:53 systemd[1]: Started Coturn.
- Sep 24 06:32:53 turnserver[475820]: error resolving '82.83.220.222%\n' hostname: Name or service not known
root@my:~# service mysql restart
root@my:~#
phpAdmin shows me
phpMyAdmin
Error
MySQL reports: Documentation
The connection could not be established due to invalid settings.
mysqli::real_connect(): (HY000/2002): Connection refused
Connection for the controluser as specified in your configuration failed.
mysqli::real_connect(): (HY000/2002): Connection refused
phpMyAdmin tried to establish a connection to the MySQL server and the connection was refused. You should check your host, username and password settings in your config.inc.php and make sure that they match the information you received from the administrator.
not sure how to see detailed logs for mysql
I suppose it perhaps is related to this
but in fact, here mysql is not concerned…
You can have a look at /var/log/mysql/error.log
For this this message, it can be few possibilities
- Check that some config/config.ini.php configuration file contains the correct and up-to-date database credentials in the [database] section. Check that the database username and password, database host and database port are correct.
You can found informations of the credentials in/etc/yunohost/apps/$app/settings.yml
. For the databases, in most most of case: thedb_user
=name_app
, thedb_name
=name_app
, you can found the password with
echo "$(yunohost app setting name_app db_pwd)"
-
If the configuration file refers to host = “localhost”, you can try changing it to 127.0.0.1 instead, for example in your config.ini.php under [database] configure host = “127.0.0.1”.
-
If the above changes don’t solve the problem, we recommend you try connecting to MySQL from the command line to check that the credentials are correct and that the server is running. Try connect to an app running this command (here example hubzilla)
app=hubzilla; mysql -u localhost -u"$(yunohost app setting $app db_user)" -p"$(yunohost app setting $app db_pwd)" -D "$(yunohost app setting $app db_name)"
(and replace the parameters in "$(yunohost app setting $app db_*)"
with the values found in your config.ini.php
file).
-
If the above command works, but you still get the error “Connection refused” in the browser, there may be an error related to PHP.
-
Check that the MySQL server is working. Connect to the server that manages the MySQL database and check that the MySQL server is actively running by running the command
mysqladmin -u root -p status
(forEnter password
, keep it balnk and just use Enter) orsystemctl status mysql
(which should return a result like this: Connection time: 172505 Threads: 2 Queries: 90 Slow queries: 0 Opens: 157 Flush tables: 3 Open tables: 76) -
If you find that the database server isn’t working, restart the Mysql server (or restart the whole server).
-
If the database server has run out of disk space and there’s no more space available on the server, it may also start refusing connections.
-
MySQL servers are sometimes configured to refuse certain connections (e.g. connections from outside the network).
Good luck…
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (111)
well but MySQL is not running so how could it connect?
this is what i see in LOGFILE: journalctl
Ok, I think you really need to fix corrupted files INNODB in mysql
Or try repair tables
Did you have something in the diagnosis ?