Du: cannot access '/var/mail/...,Sb': Bad message

:uk:/:us:

My YunoHost server

Hardware: Raspberry Pi at home
YunoHost version: 3.6.5.3
I have access to my server : yes
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : Yunohost installed on external disk

I’m getting Bad message error when accessing files

du: cannot access '/var/mail/someuser/cur/1578171086.M866478P28271.domain.tld,S=17098,W=17316:2,Sb': Bad message
du: cannot access '/var/mail/someuser/.INBOX.Yunohost - dyndns/cur/1578881661.M215535P32410.domain.tld,S=1841,W=1876:2,S': Bad message
du: cannot access '/var/mail/someuser/.INBOX.Yunohost - dyndns/cur/1578638900.M858631P27416.domain.tld,S=1851,W=1886:2,S': Bad message
Traceback (most recent call last):
  File "/usr/bin/yunohost", line 214, in <module>
    timeout=opts.timeout,
  File "/usr/lib/python2.7/dist-packages/moulinette/__init__.py", line 136, in cli
    moulinette.run(args, output_as=output_as, password=password, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/cli.py", line 425, in run
    ret = self.actionsmap.process(args, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 523, in process
    return func(**arguments)
  File "/usr/lib/moulinette/yunohost/backup.py", line 2086, in backup_create
    backup_manager.collect_files()
  File "/usr/lib/moulinette/yunohost/backup.py", line 536, in collect_files
    self._compute_backup_size()
  File "/usr/lib/moulinette/yunohost/backup.py", line 775, in _compute_backup_size
    size = disk_usage(row['source'])
  File "/usr/lib/moulinette/yunohost/backup.py", line 2399, in disk_usage
    du_output = subprocess.check_output(['du', '-sb', path])
  File "/usr/lib/python2.7/subprocess.py", line 219, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['du', '-sb', '/var/mail']' returned non-zero exit status 1

Therefore I cannot backup anymore. Last-time I tried a disk check but I lost a lot of system file and I had to reinstall everything from scratch. Now after a few weeks, this happen again :frowning:

The hard disk is less than 1 year old and has no bad sector.

Another example:

/etc/cron.daily/dpkg:
mv: failed to access './/dpkg.diversions.1.gz': Bad message
mv: failed to access './/dpkg.statoverride.1.gz': Bad message
/etc/cron.daily/logrotate:
error: error renaming /var/log/metronome/metronome.log.5.gz to /var/log/metronome/metronome.log.6.gz: Bad message
error: error renaming /var/log/metronome/metronome.err.14.gz to /var/log/metronome/metronome.err.15.gz: Bad message
error: error renaming /var/log/nginx/access.log.13.gz to /var/log/nginx/access.log.14.gz: Bad message
error: error renaming /var/log/nginx/error.log.12.gz to /var/log/nginx/error.log.13.gz: Bad message
error: error renaming /var/log/nginx/piwi.nohost.me-access.log.14.gz to /var/log/nginx/piwi.nohost.me-access.log.15.gz: Bad message
error: error renaming /var/log/redis/redis-server.log.2.gz to /var/log/redis/redis-server.log.3.gz: Bad message
error: error renaming /var/log/syslog.4.gz to /var/log/syslog.5.gz: Bad message
error: error renaming /var/log/mail.log.3.gz to /var/log/mail.log.4.gz: Bad message
error: error renaming /var/log/daemon.log.3.gz to /var/log/daemon.log.4.gz: Bad message
error: error renaming /var/log/kern.log.3.gz to /var/log/kern.log.4.gz: Bad message
error: error renaming /var/log/auth.log.3.gz to /var/log/auth.log.4.gz: Bad message
run-parts: /etc/cron.daily/logrotate exited with return code 1

1- How can I fix this ?
2- How can I prevent this ?

Thanks

Hi @Dams

What application is creating these messages ?

Some errors might be related to the files being inaccessible to the user that is running the command, and some of them might be “a file has been modified or remove between the time we start the du command and the time it gets to checking that file”.

Hi @arthurlutz

It’s a cron backup script. It’s basically calling yunohost backup commands. I have restarted the server and up to now I don’t have the messages anymore. But I still can’t figure out where it comes from.

Is the problem solved then ?

Unfortunately not ;-( it happened again. I can no more backup the system part of Yunohost. And now I also have it there :

/etc/cron.daily/dpkg:
mv: failed to access './/dpkg.status.0': Bad message
touch: cannot touch './/dpkg.status.0': Bad message

It looks like corrupted files that come again and again but I don’t know why. Even if I fix the files, it will happen again in a few weeks. Last time I tried to run fsck I could not even start anymore and I had to reinstall everything from scratch.

I can’t figure out what happens. I’m not a Debian expert I now think about giving up self-hosting. I really like Yunohost but I can’t spend my time restoring the system periodically.

I think it’s a hardware issue. I think even your harddrive has less than 1 year, it’s possible it is corrupted.

Have you checked it with smartmontools ?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.