Yesterday I did an apt update/upgrade and rpi-update on my emonpi which has been running fine for a year or so. I frequently do this as well as using the update from the emoncms dashboard. No problems before. Everything was up to date from this about a week ago.
I’ve seen some discussion about this but don’t really understand the fixes mentioned. Can someone tell me what I need to do here to get back online?
Here is some error information:
mariadb.service - MariaDB 10.1.38 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2019-04-30 19:01:47 EDT; 3min 0s ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 1319 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited,
Apr 30 19:01:47 emonpiB3 systemd[1]: Starting MariaDB 10.1.38 database server...
Apr 30 19:01:47 emonpiB3 systemd[1]: mariadb.service: Control process exited, code=exited status=1
Apr 30 19:01:47 emonpiB3 systemd[1]: Failed to start MariaDB 10.1.38 database server.
Apr 30 19:01:47 emonpiB3 systemd[1]: mariadb.service: Unit entered failed state.
Apr 30 19:01:47 emonpiB3 systemd[1]: mariadb.service: Failed with result 'exit-code'.
My attempted access to http server:
Can’t connect to database, please verify credentials/configuration in settings.php
Error message: Connection refused
My settings.php:
//1 #### Mysql database settings
$server = "127.0.0.1";
$database = "emoncms";
$username = "emoncms";
$password = "emonpiemoncmsmysql2016";
$port = "3306";
// Skip database setup test - set to false once database has been setup.
$dbtest = false;
Thanks. I’ll be happy to send more information if needed.
Thanks for the quick reply, Brian. I did apt update/upgrade and not dist-upgrade.
I also changed the true to false.
root@emonpiB3:/var/www/emoncms# git status
On branch stable
Your branch is up-to-date with 'origin/stable'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
scripts/logger/logrotate.conf.old
scripts/logger/logrotate.old
settings.php.bak
nothing added to commit but untracked files present (use "git add" to track)
root@emonpiB3:/var/www/emoncms# git describe
9.9.4-247-gd0db7a57
root@emonpiB3:/var/www/emoncms#
root@emonpiB3:/lib/systemd/system# systemctl restart mariadb.service
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
root@emonpiB3:/lib/systemd/system# systemctl status mariadb.service
● mariadb.service - MariaDB 10.1.38 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2019-05-01 11:52:37 EDT; 5min ago
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
Process: 9092 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited,
May 01 11:52:37 emonpiB3 systemd[1]: Starting MariaDB 10.1.38 database server...
May 01 11:52:37 emonpiB3 systemd[1]: mariadb.service: Control process exited, code=exited status=1
May 01 11:52:37 emonpiB3 systemd[1]: Failed to start MariaDB 10.1.38 database server.
May 01 11:52:37 emonpiB3 systemd[1]: mariadb.service: Unit entered failed state.
May 01 11:52:37 emonpiB3 systemd[1]: mariadb.service: Failed with result 'exit-code'.
Bob, in the status line above, the end of this line is cut off. Could you widen the SSH terminal, restart the service and do a status output again please
pi@emonpi:/var/log/mysql $ ls -la /var/run/my*
total 4
drwxr-xr-x 2 mysql root 60 May 1 19:09 .
drwxr-xr-x 29 root root 960 May 1 15:55 ..
-rw-rw---- 1 mysql mysql 6 May 1 19:09 mysqld.pid
[edit]
I note you are running as root. That can upset permissions if you run scripts etc as root rather than as pi and sudo. I wonder if that is the issue. But what particular permissions are wrong will be tricky to discover.