Missing /var/lib/mysql-file after raspbian package upgrade

I have just done the upgrade and then reboot, when i try to log back in to the web browser i get

Can't connect to database, please verify credentials/configuration in settings.php
Error message: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I have tried a reboot

When i run.

sudo service mysql start
Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.

and

sudo systemctl status mysql.service -l


● mysql.service - LSB: Start and stop the mysql database server daemon
   Loaded: loaded (/etc/init.d/mysql)
   Active: failed (Result: exit-code) since Wed 2017-10-18 20:19:01 BST; 1min 51s ago
  Process: 4930 ExecStart=/etc/init.d/mysql start (code=exited, status=1/FAILURE)

Oct 18 20:19:01 emonpi /etc/init.d/mysql[5756]: 0 processes alive and '/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping' resulted in
Oct 18 20:19:01 emonpi /etc/init.d/mysql[5756]: [61B blob data]
Oct 18 20:19:01 emonpi /etc/init.d/mysql[5756]: error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Oct 18 20:19:01 emonpi mysql[4930]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Oct 18 20:19:01 emonpi systemd[1]: mysql.service: control process exited, code=exited status=1
Oct 18 20:19:01 emonpi systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
Oct 18 20:19:01 emonpi systemd[1]: Unit mysql.service entered failed state.
sudo journalctl -xn
-- Logs begin at Wed 2017-10-18 20:11:37 BST, end at Wed 2017-10-18 20:33:36 BST. --
Oct 18 20:33:30 emonpi mysql[10291]: Starting MySQL database server: mysqld . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . failed!
Oct 18 20:33:30 emonpi systemd[1]: mysql.service: control process exited, code=exited status=1
Oct 18 20:33:30 emonpi systemd[1]: Failed to start LSB: Start and stop the mysql database server daemon.
-- 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.
Oct 18 20:33:30 emonpi systemd[1]: Unit mysql.service entered failed state.
Oct 18 20:33:30 emonpi sudo[10267]: pam_unix(sudo:session): session closed for user root
Oct 18 20:33:30 emonpi systemd[1]: Starting Emoncms MQTT Input Script...
-- Subject: Unit mqtt_input.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mqtt_input.service has begun starting up.
Oct 18 20:33:30 emonpi systemd[1]: Started Emoncms MQTT Input Script.
-- Subject: Unit mqtt_input.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mqtt_input.service has finished starting up.
--
-- The start-up result is done.
Oct 18 20:33:30 emonpi mqtt_input[11116]: Check log\n
Oct 18 20:33:36 emonpi sudo[11145]: pi : TTY=pts/1 ; PWD=/home/pi ; USER=root ; COMMAND=/bin/journalctl -xn
Oct 18 20:33:36 emonpi sudo[11145]: pam_unix(sudo:session): session opened for user root by pi(uid=0)

it look like i was missing a directory /var/lib/mysql-file

so i ran the commands bellow

rpi-rw

sudo mkdir /var/lib/mysql-files
sudo chown -R mysql:mysql /var/lib/mysql-files/
sudo chmod 700 /var/lib/mysql-files/

sudo service mysql start

Paul

Hi @Pukka,

I hope you don’t mind me moving your posts to a new thread.

Nice work fixing this. It’s strange I did not experience this issue when updating a stock emonSD-07Nov16 with latest packages.

Do you know what emonSD / emoncms version you were updating from? Can you remember when the last time you ran upgrade?

What version mysql are you running, after an update I get:

$ mysql --version
$ mysql  Ver 14.14 Distrib 5.5.57, for debian-linux-gnu (armv7l) using readline 6.3

Hi @glyn.hudson

It was a fresh install about 3 weeks ago. from the nov16 image

mysql Ver 14.14 Distrib 5.5.57, for debian-linux-gnu (armv7l) using readline 6.3

I’ve just tried a fresh upgrade from a stock emonSD-07Nov16 and ran into an issue updating Oracle JDK 8.

Preconfiguring packages ...
Setting up oracle-java8-installer (8u144-1~webupd8~0) ...
Using wget settings from /var/cache/oracle-jdk8-installer/wgetrc
Downloading Oracle Java 8...
--2017-10-19 16:10:26--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-arm32-vfp-hflt.tar.gz
Resolving download.oracle.com (download.oracle.com)... 104.86.111.155, 104.86.110.251
Connecting to download.oracle.com (download.oracle.com)|104.86.111.155|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-arm32-vfp-hflt.tar.gz [following]
--2017-10-19 16:10:26--  https://edelivery.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-arm32-vfp-hflt.tar.gz
Resolving edelivery.oracle.com (edelivery.oracle.com)... 104.73.149.93, 2a02:26f0:e8:28a::2d3e, 2a02:26f0:e8:282::2d3e
Connecting to edelivery.oracle.com (edelivery.oracle.com)|104.73.149.93|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-arm32-vfp-hflt.tar.gz?AuthParam=1508429546_4f5c1524967427ecd613a979707693a8 [following]
--2017-10-19 16:10:26--  http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-arm32-vfp-hflt.tar.gz?AuthParam=1508429546_4f5c1524967427ecd613a979707693a8
Connecting to download.oracle.com (download.oracle.com)|104.86.111.155|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2017-10-19 16:10:27 ERROR 404: Not Found.

download failed
Oracle JDK 8 is NOT installed.
dpkg: error processing package oracle-java8-installer (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 oracle-java8-installer
E: Sub-process /usr/bin/dpkg returned an error code (1)

Its seems Oracle are having issues at their end, I don’t think there is much we an do other than wait for them to fix the issue :frowning:

Here’s another thread discussing the issue:

I had the same error as well.

I have just tried to run the update again and it now installed java ok.

The updater asked about a php.ini file upgrade i said to keep the current version

now in emoncms i am seeing emonhub is working but the inputs are showing nothing. under administration is an getting

2017-10-20 21:47:25.499|WARN|phpmqtt_input.php|Starting MQTT Input script
2017-10-20 21:47:26.757|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-10-20 21:47:26.758|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-10-20 21:47:26.760|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-10-20 21:47:26.761|WARN|phpmqtt_input.php|Subscribed to topic: emon/#
2017-10-20 21:47:29.505|WARN|phpmqtt_input.php|Starting MQTT Input script
2017-10-20 21:47:30.633|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-10-20 21:47:30.634|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-10-20 21:47:30.636|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-10-20 21:47:30.637|WARN|phpmqtt_input.php|Subscribed to topic: emon/#

Woop, Oracle server issue must be fixed :slight_smile:

Great, that’s the correct choice. Nothing major but the emonSD has got a modification to php.ini to increase the max file size that can be uploaded via the web server. This is used for Emoncms backup module to be able to restore large files.

You mean inputs are not updating? Could you post your emonhub.log?

Try restarting the Emoncms MQTT service:

sudo systemctl restart mqtt_input.service

I gave up and went to bed, it looks like its working now wonder if it just needed some time to think.

on the inputs where the time in seconds normally shows it said N/A on them all.