Esta consulta es de hace 7 años. No tome esta información como actualizada. Si tiene problemas con FacturaScripts, consulte la sección ayuda o la sección contacto
xavier_3690fc

Abrí un error, y como lo solucioné yo mismo y no era...

xavier_3690fc   España   15-02-2018 21:24:05   15-02-2018 21:24:05   9502  
Abrí un error, y como lo solucioné yo mismo y no era visible lo posteo de nuevo aquí por si a alguien le pasa.
Error mySQL !!!

Buenas tardes,
he llegado a casa, y me he encontrado que se ha ido la luz... enciendo mi PC, y arranco la máquina virtual donde tengo corriendo el Ubuntu Server 16.04 con FacturaScripts.

Sorpresa! Error! Me da el siguiente error:
No such file or directory
¡Imposible conectar con la base de datos facturascripts!
Error al comprobar la tabla fs_logs

He pensado que no habría arrancado mySQL y me he ido a mirar... pero me encuentro lo siguiente:
xevi@UbuntuFacturaScripts:/$ systemctl status mysql.service
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: activating (start-post) (Result: exit-code) since jue 2018-02-15 19:28:56 CET; 27s ago
Process: 12294 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
Process: 12286 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 12294 (code=exited, status=1/FAILURE); : 12295 (mysql-systemd-s)
Tasks: 2
Memory: 416.0K
CPU: 286ms
CGroup: /system.slice/mysql.service
└─control
├─12295 /bin/bash /usr/share/mysql/mysql-systemd-start post
└─12366 sleep 1

feb 15 19:28:56 UbuntuFacturaScripts systemd[1]: Starting MySQL Community Server...
feb 15 19:28:57 UbuntuFacturaScripts systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE

xevi@UbuntuFacturaScripts:/$ journalctl -xe
feb 15 19:29:26 UbuntuFacturaScripts systemd[1]: Failed to start MySQL Community Server.
-- Subject: Unit mysql.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has failed.
--
-- The result is failed.
feb 15 19:29:26 UbuntuFacturaScripts systemd[1]: mysql.service: Unit entered failed state.
feb 15 19:29:26 UbuntuFacturaScripts systemd[1]: mysql.service: Failed with result 'exit-code'.
feb 15 19:29:26 UbuntuFacturaScripts systemd[1]: mysql.service: Service hold-off time over, scheduling restart.
feb 15 19:29:26 UbuntuFacturaScripts systemd[1]: Stopped MySQL Community Server.
-- Subject: Unit mysql.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has finished shutting down.
feb 15 19:29:26 UbuntuFacturaScripts systemd[1]: Starting MySQL Community Server...
-- Subject: Unit mysql.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysql.service has begun starting up.
feb 15 19:29:26 UbuntuFacturaScripts audit[12386]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/12386/status" pid=12386 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=107 ou
feb 15 19:29:26 UbuntuFacturaScripts audit[12386]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=12386 comm="mysqld" requested_mask="r" denied_mask="r" fsuid
feb 15 19:29:26 UbuntuFacturaScripts audit[12386]: AVC apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/12386/status" pid=12386 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=107 ou
feb 15 19:29:26 UbuntuFacturaScripts kernel: audit: type=1400 audit(1518719366.581:341): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/12386/status" pid=12386 comm="mysqld" requested_mas
feb 15 19:29:26 UbuntuFacturaScripts kernel: audit: type=1400 audit(1518719366.581:342): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=12386 comm="mysqld" reques
feb 15 19:29:26 UbuntuFacturaScripts kernel: audit: type=1400 audit(1518719366.581:343): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/12386/status" pid=12386 comm="mysqld" requested_mas
feb 15 19:29:27 UbuntuFacturaScripts systemd[1]: mysql.service: Main process exited, code=exited, status=1/FAILURE


Bien... después de buscar mucho... he hecho varias cosas, pero creo que el error era debido a que el log de mysql ha quedado corrupto. Así pues dejo la solución que he encontrado:
1) Mirar el log de errores de mysql
nano /var/log/mysql/error.log

os posteo lo que me ha salido a mi:
2018-02-15T19:36:25.677808Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000)
2018-02-15T19:36:25.677857Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
2018-02-15T19:36:25.830665Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-02-15T19:36:25.831503Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as process 10614 ...
2018-02-15T19:36:25.834639Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-02-15T19:36:25.834656Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-02-15T19:36:25.834663Z 0 [Note] InnoDB: Uses event mutexes
2018-02-15T19:36:25.834668Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-02-15T19:36:25.834677Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-02-15T19:36:25.834683Z 0 [Note] InnoDB: Using Linux native AIO
2018-02-15T19:36:25.834976Z 0 [Note] InnoDB: Number of pools: 1
2018-02-15T19:36:25.835097Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-02-15T19:36:25.836713Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2018-02-15T19:36:25.844526Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-02-15T19:36:25.846729Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-02-15T19:36:25.858821Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-15T19:36:25.860221Z 0 [ERROR] InnoDB: Ignoring the redo log due to missing MLOG_CHECKPOINT between the checkpoint 81808079 and the end 81807872.
2018-02-15T19:36:25.860240Z 0 [ERROR] InnoDB: Plugin initialization aborted with error Generic error
2018-02-15T19:36:26.547379Z 0 [ERROR] Plugin 'InnoDB' init function returned error.
2018-02-15T19:36:26.547411Z 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2018-02-15T19:36:26.547419Z 0 [ERROR] Failed to initialize builtin plugins.
2018-02-15T19:36:26.547423Z 0 [ERROR] Aborting

2018-02-15T19:36:26.547439Z 0 [Note] Binlog end
2018-02-15T19:36:26.547639Z 0 [Note] /usr/sbin/mysqld: Shutdown complete

Veréis que hay un par de WARNINGS, pero no importante son los errores, concretamente "missing MLOG_CHECKPOINT".

2) Eliminar el logfile de mysql
rm /var/lib/mysql/ib_logfile*

3) Reiniciar mysql
service mysql restart

Y ya debería arrancar!!!!!
El log dirá:
2018-02-15T19:53:46.129143Z 0 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2018-02-15T19:53:46.262436Z 0 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2018-02-15T19:53:46.397100Z 0 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2018-02-15T19:53:46.397166Z 0 [Warning] InnoDB: New log files created, LSN=52099200
2018-02-15T19:53:46.397381Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-15T19:53:46.398352Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 52099596
2018-02-15T19:53:46.398364Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 52099605
2018-02-15T19:53:46.398370Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-02-15T19:53:46.398376Z 0 [Note] InnoDB: Starting crash recovery.

Realiza un recovery y ya funciona!!
En cuanto a los warnings, he aumentado el límite de archivos abiertos:
# nano /etc/systemd/system/mysql.service

Añadimos la línia:
LimitNOFILE=5000

# systemctl daemon-reload
# systemctl restart mysql

He puesto 5000 por el valor que me da el log.
Ya no sale el WARNING
Saludos!
[[Cerrado por inactividad]]
¿Problemas con FacturaScripts?
Si tiene problemas con FacturaScripts consulte la sección ayuda o la sección contacto



Cookies
Usamos cookies en nuestro sitio web para brindarte la experiencia más relevante recordando tus preferencias y visitas repetidas. Al hacer clic en "Aceptar", aceptas el uso de TODAS las cookies necesarias.
Copyright (c) 2013-2024 FacturaScripts
0.19334s

Soporte