daemon.log
should be in /var/log/daemon.log. You can copy say 200 lines with:
tail -f /var/log/daemon.log -n 200
daemon.log
should be in /var/log/daemon.log. You can copy say 200 lines with:
tail -f /var/log/daemon.log -n 200
it looks like the same message over and over again:
Dec 15 16:52:34 emonpi mariadbd[621]: 2022-12-15 16:52:34 45 [ERROR] mariadbd: Table 'input' is marked as crashed and should be repaired
Dec 15 16:52:34 emonpi mariadbd[621]: 2022-12-15 16:52:34 45 [Warning] Sort aborted, host: localhost, user: emoncms, thread: 45, query: SELECT id,userid,nodeid,name,description,processList FROM input WHERE `userid` = '1' ORDER BY nodeid,name asc
Dec 15 16:52:35 emonpi mariadbd[621]: 2022-12-15 16:52:35 45 [ERROR] mariadbd: Table 'input' is marked as crashed and should be repaired
Dec 15 16:52:35 emonpi mariadbd[621]: 2022-12-15 16:52:35 45 [Warning] Sort aborted, host: localhost, user: emoncms, thread: 45, query: SELECT id,userid,nodeid,name,description,processList FROM input WHERE `userid` = '1' ORDER BY nodeid,name asc
Dec 15 16:52:36 emonpi mariadbd[621]: 2022-12-15 16:52:36 45 [ERROR] mariadbd: Table 'input' is marked as crashed and should be repaired
Dec 15 ^C
Thanks @VincentR could you try:
mysqlcheck --auto-repair -u emoncms -p emoncms
password: emonpiemoncmsmysql2016
updated the above command with the auto-repair parameter
pi@emonpi:~ $ mysqlcheck --auto-repair -u emoncms -p emoncms
Enter password:
emoncms.app_config OK
emoncms.dashboard OK
emoncms.demandshaper OK
emoncms.device OK
emoncms.feeds OK
emoncms.graph OK
emoncms.input
error : Wrong bytesec: 0-0-0 at linkstart: 73648
error : Corrupt
emoncms.multigraph OK
emoncms.postprocess OK
emoncms.rememberme OK
emoncms.schedule OK
emoncms.setup OK
emoncms.sync OK
emoncms.users OK
Repairing tables
emoncms.input
info : Wrong bytesec: 0- 0- 0 at 73648; Skipped
status : OK
pi@emonpi:~ $
this is what the result looks like
It looks like it is working again.
Will check in the morning immediately
Is there anyway you can think of, which I did wrong?
Nothing in particular. I’ve had this after a power cut in the past, though not for sometime now. Possibly due to having installed surge protection but it might also be luck!
This app works like a champ for transferring files between Linux and Windows boxes:
Hi guys,
I think I got in the same trouble again. The webinterface is stalling, no reaction on the inputs menu and 95% (was 100% a couple of minutes ago) usage of /var/log
The
tail -f /var/log/daemon.log -n 10
command gives me exactly the same list as 5 days ago.
As I installed a 128G sd card, there should be plenty of room to increase the size of some directories, but I’ve no clue how to.
What can I do to fix this?
pi@emonpi:~ $ sudo truncate -s 0 /var/log/daemon.log
pi@emonpi:~ $ ls -la /var/log
total 16256
drwxr-xr-x 13 root root 1240 Dec 21 06:17 .
drwxr-xr-x 14 root root 4096 Nov 11 16:29 ..
-rw-r--r-- 1 root root 0 Nov 19 19:38 alternatives.log
drwxr-x--- 2 root adm 100 Nov 19 19:35 apache2
drwxr-xr-x 2 root root 140 Dec 10 19:00 apt
-rw-r----- 1 root adm 86098 Dec 21 06:21 auth.log
-rw-r----- 1 root adm 258481 Dec 14 15:17 auth.log.1
-rw-r----- 1 root adm 171 Dec 11 00:17 auth.log.2.gz
-rw-r----- 1 root adm 1496 Dec 11 00:00 auth.log.3.gz
-rw-r----- 1 root adm 172 Dec 10 19:17 auth.log.4.gz
-rw-r--r-- 1 root root 0 Sep 22 01:23 bootstrap.log
-rw-rw---- 1 root utmp 3456 Dec 16 06:23 btmp
-rw-rw---- 1 root utmp 0 Dec 10 19:00 btmp.1
-rw-r----- 1 root adm 0 Dec 21 06:21 daemon.log
-rw-r----- 1 root adm 5532919 Dec 15 16:17 daemon.log.1
-rw-r----- 1 root adm 71725 Dec 15 15:17 daemon.log.2.gz
-rw-r----- 1 root adm 27919 Dec 15 14:17 daemon.log.3.gz
-rw-r----- 1 root adm 22743 Dec 14 17:09 daemon.log.4.gz
-rw-r----- 1 root adm 2286 Dec 15 14:56 debug
-rw-r----- 1 root adm 1143 Dec 15 13:10 debug.1
-rw-r----- 1 root adm 430 Nov 26 20:23 debug.2.gz
-rw-r--r-- 1 root root 0 Nov 19 19:38 dpkg.log
drwxr-xr-x 2 pi root 120 Dec 10 19:46 emoncms
drwxr-xr-x 2 pi root 80 Dec 15 15:18 emonhub
drwxrwxr-x 2 root pi 60 Nov 19 19:33 emonpilcd
-rw-r--r-- 1 root root 0 Nov 11 18:16 faillog
-rw-r----- 1 root adm 234154 Dec 21 06:22 kern.log
-rw-r----- 1 root adm 269265 Dec 15 09:16 kern.log.1
-rw-r----- 1 root adm 31733 Dec 14 18:16 kern.log.2.gz
-rw-r----- 1 root adm 31802 Dec 14 03:16 kern.log.3.gz
-rw-r----- 1 root adm 31836 Dec 13 12:16 kern.log.4.gz
-rw-rw-r-- 1 root utmp 292292 Dec 21 05:58 lastlog
-rw-r--r-- 1 root root 8192 Dec 21 06:17 log2ram.log
-rw-r--r-- 1 root root 421 Dec 15 00:17 log2ram.log.1
-rw-r--r-- 1 root root 1056 Dec 14 23:17 log2ram.log.2.gz
-rw-r--r-- 1 root root 231 Dec 14 00:17 log2ram.log.3.gz
-rw-r--r-- 1 root root 1017 Dec 13 23:17 log2ram.log.4.gz
-rw-r--r-- 1 root root 257 Dec 13 00:17 log2ram.log.5.gz
-rw-r--r-- 1 root root 1012 Dec 12 23:17 log2ram.log.6.gz
-rw-r--r-- 1 root root 233 Dec 12 00:17 log2ram.log.7.gz
drwxr-xr-x 2 root adm 220 Dec 21 06:17 logrotate
-rw-r----- 1 root adm 229974 Dec 21 06:22 messages
-rw-r----- 1 root adm 269475 Dec 15 09:16 messages.1
-rw-r----- 1 root adm 32266 Dec 14 18:16 messages.2.gz
-rw-r----- 1 root adm 32025 Dec 14 03:16 messages.3.gz
-rw-r----- 1 root adm 32176 Dec 13 12:16 messages.4.gz
drwxr-xr-x 2 mosquitto root 60 Nov 10 16:26 mosquitto
drwxr-s--- 2 mysql adm 40 Nov 10 16:23 mysql
drwx------ 2 root root 40 Sep 22 01:23 private
drwxr-s--- 2 redis adm 140 Dec 17 00:00 redis
lrwxrwxrwx 1 root root 12 Nov 26 20:23 rotated_logs -> /var/log.old
drwxr-xr-x 3 root root 60 Sep 22 01:06 runit
-rw-r----- 1 root adm 3293866 Dec 21 06:22 syslog
-rw-r----- 1 root adm 5553127 Dec 15 16:17 syslog.1
-rw-r----- 1 root adm 91098 Dec 15 15:17 syslog.2.gz
-rw-r----- 1 root adm 49413 Dec 15 14:17 syslog.3.gz
-rw-r----- 1 root adm 32182 Dec 15 11:17 syslog.4.gz
-rw-r----- 1 root adm 380 Dec 15 14:56 user.log
-rw-r----- 1 root adm 190 Dec 15 13:10 user.log.1
-rw-r----- 1 root adm 149 Nov 26 20:23 user.log.2.gz
-rw-r--r-- 1 root root 299 Dec 15 14:56 wifiAP.log
-rw-rw-r-- 1 root utmp 12288 Dec 21 05:58 wtmp
pi@emonpi:~ $ sudo du -h /var/log/
0 /var/log/runit/ssh
0 /var/log/runit
20K /var/log/redis
0 /var/log/private
0 /var/log/mysql
0 /var/log/mosquitto
248K /var/log/logrotate
8.0K /var/log/emonpilcd
6.7M /var/log/emonhub
25M /var/log/emoncms
48K /var/log/apt
0 /var/log/apache2
48M /var/log/
pi@emonpi:~ $
It won’t help, just take longer to stall.
First clear the daemon.log file with
sudo truncate -s 0 /var/log/daemon.log
and
sudo rm daemon.log.*
All I can suggest is to try and fix the SQL error as you did before, so all is OK, then do an emoncms export, reflash the card and do an import and see if that gets rid of whatever is causing the error to occur.
Is the SD Card relatively new?
@TrystanLea any better suggestions?
I bought this new industrial sd card just 2 weeks ago
When trying to remove daemon.log.* I get the message there are no files/directories with that name. Tried it again with the directory /var/log/ prefix. No error message
Still 75% usage of /var/log/
Is that within the size it should be?
The “inputs” menu still stalls comes with this message window:
Sorry yes.
No that is too much taken up. I am also confused as to why you have rotated logs there as well.
As a short term solution, I suggest you dlete all the ‘rotated’ logs. These are any file xxx.log
that then has another extension, so xxx.log.1
for instance.
Ah OK, logrotate isn’t working correctly (just looked at the log file you posted) @TrystanLea
It is likely there has been an update to logrotate
itself that has broken something.
These are the errors when you tried to run it
pi@emonpi:~ $ /usr/sbin/logrotate -d /etc/logrotate.conf
WARNING: logrotate in debug mode does nothing except printing debug messages! Consider using verbose mode (-v) instead if this is not what you want.
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file 00_defaults
warning: 'size' overrides previously specified 'daily'
reading config file 00_olddir
olddir is now /var/log.old
error: 00_olddir:17 keyword 'renamecopy' not properly separated, found 0
error: found error in file 00_olddir, skipping
reading config file alternatives
reading config file apache2
reading config file apt
reading config file btmp
reading config file dpkg
reading config file emoncms
olddir is now /var/log.old/emoncms
error: emoncms:6 olddir /var/log.old/emoncms and log file /var/log/emoncms/apache2-error.log are on different devices
removing last 1 log configs
error: found error in file emoncms, skipping
reading config file emonhub
olddir is now /var/log.old/emonhub
error: emonhub:10 unknown group 'emonhub'
error: found error in /var/log/emonhub/emonhub.log , skipping
removing last 1 log configs
error: found error in file emonhub, skipping
reading config file log2ram
reading config file mariadb
reading config file mosquitto
warning: 'size' overrides previously specified 'daily'
reading config file ppp
reading config file redis-server
reading config file rsyslog
reading config file ufw
reading config file wtmp
Reading state from file: /var/lib/logrotate/status
error: error opening state file /var/lib/logrotate/status: Permission denied
Allocating hash table for state file, size 64 entries
I’ll try and find some time tonight to flash a new version of the EmonSD image and investigate.
Deleting these doesn’t give any extra space in that dir. There are also a lot of files with a increasing number in the extension, but don’t have a .log. in it. Do they need to be deleted too?
pi@emonpi:/var/log $ ls
alternatives.log auth.log.1 daemon.log dpkg.log faillog log2ram.log messages.1 mosquitto rotated_logs syslog.2.gz user.log.1
apache2 bootstrap.log debug emoncms kern.log log2ram.log.1 messages.2.gz mysql runit syslog.3.gz wifiAP.log
apt btmp debug.1 emonhub kern.log.1 logrotate messages.3.gz private syslog syslog.4.gz wtmp
auth.log btmp.1 debug.2.gz emonpilcd lastlog messages messages.4.gz redis syslog.1 user.log
pi@emonpi:/var/log $
Yes, they can all go. Just leave the files *.log
or with no extension.
[edit]
you may need to check the subfolders as well.
Is daemon.log full of the same MYSQL errors? that issue needs to be resolved first if that is the case.
Yep, that log file contains the same errors (with the same date of last week)
Ok thanks, does that error clear if you fix the tables as before?
mysqlcheck --auto-repair -u emoncms -p emoncms
You will probably need to clear daemon.log if the /var/log/ is still full so that you can see if the error has actually cleared…
Ah, OK, I thought this was new errors it is processing.
pi@emonpi:~ $ sudo du -h /var/log
0 /var/log/runit/ssh
0 /var/log/runit
20K /var/log/redis
0 /var/log/private
0 /var/log/mysql
0 /var/log/mosquitto
244K /var/log/logrotate
8.0K /var/log/emonpilcd
7.7M /var/log/emonhub
25M /var/log/emoncms
48K /var/log/apt
0 /var/log/apache2
34M /var/log
pi@emonpi:~ $