loud warning on EIO (HDD/FS trouble) (#851)

This commit is contained in:
ed 2025-09-25 23:18:09 +00:00
parent 80ca78516e
commit 6912e86747
2 changed files with 17 additions and 3 deletions

View file

@ -18,13 +18,15 @@ from copy import deepcopy
from queue import Queue from queue import Queue
from .__init__ import ANYWIN, PY2, TYPE_CHECKING, WINDOWS, E from .__init__ import ANYWIN, MACOS, PY2, TYPE_CHECKING, WINDOWS, E
from .authsrv import LEELOO_DALLAS, SEESLOG, VFS, AuthSrv from .authsrv import LEELOO_DALLAS, SEESLOG, VFS, AuthSrv
from .bos import bos from .bos import bos
from .cfg import vf_bmap, vf_cmap, vf_vmap from .cfg import vf_bmap, vf_cmap, vf_vmap
from .fsutil import Fstab from .fsutil import Fstab
from .mtag import MParser, MTag from .mtag import MParser, MTag
from .util import ( from .util import (
E_FS_CRIT,
E_FS_MEH,
HAVE_SQLITE3, HAVE_SQLITE3,
SYMTIME, SYMTIME,
VF_CAREFUL, VF_CAREFUL,
@ -1720,7 +1722,7 @@ class Up2k(object):
abspath, "a{}, ".format(self.pp.n) abspath, "a{}, ".format(self.pp.n)
) )
except Exception as ex: except Exception as ex:
self.log("hash: %r @ %r" % (ex, abspath)) self._ex_hash(ex, abspath)
continue continue
if not hashes: if not hashes:
@ -1981,7 +1983,7 @@ class Up2k(object):
try: try:
hashes, _ = self._hashlist_from_file(abspath, pf) hashes, _ = self._hashlist_from_file(abspath, pf)
except Exception as ex: except Exception as ex:
self.log("hash: %r @ %r" % (ex, abspath)) self._ex_hash(ex, abspath)
continue continue
if not hashes: if not hashes:
@ -5087,6 +5089,16 @@ class Up2k(object):
return ret, st return ret, st
def _ex_hash(self, ex: Exception, ap: str) -> None:
eno = getattr(ex, "errno", 0)
if eno in E_FS_MEH:
return self.log("hashing failed; %r @ %r" % (ex, ap))
if eno not in E_FS_CRIT:
return self.log("hashing failed; %r @ %r\n%s" % (ex, ap, min_ex()), 3)
t = "hashing failed; %r @ %r\n%s\nWARNING: This MAY indicate a serious issue with your harddisk or filesystem! Please investigate %sOS-logs\n"
t2 = "" if ANYWIN or MACOS else "dmesg and "
return self.log(t % (ex, ap, min_ex(), t2), 1)
def _new_upload(self, job: dict[str, Any], vfs: VFS, depth: int) -> dict[str, str]: def _new_upload(self, job: dict[str, Any], vfs: VFS, depth: int) -> dict[str, str]:
pdir = djoin(job["ptop"], job["prel"]) pdir = djoin(job["ptop"], job["prel"])
if not job["size"]: if not job["size"]:

View file

@ -111,6 +111,8 @@ E_ADDR_NOT_AVAIL = _ens("EADDRNOTAVAIL WSAEADDRNOTAVAIL")
E_ADDR_IN_USE = _ens("EADDRINUSE WSAEADDRINUSE") E_ADDR_IN_USE = _ens("EADDRINUSE WSAEADDRINUSE")
E_ACCESS = _ens("EACCES WSAEACCES") E_ACCESS = _ens("EACCES WSAEACCES")
E_UNREACH = _ens("EHOSTUNREACH WSAEHOSTUNREACH ENETUNREACH WSAENETUNREACH") E_UNREACH = _ens("EHOSTUNREACH WSAEHOSTUNREACH ENETUNREACH WSAENETUNREACH")
E_FS_MEH = _ens("EPERM EACCES ENOENT ENOTCAPABLE")
E_FS_CRIT = _ens("EIO EFAULT EUCLEAN ENOTBLK")
IP6ALL = "0:0:0:0:0:0:0:0" IP6ALL = "0:0:0:0:0:0:0:0"
IP6_LL = ("fe8", "fe9", "fea", "feb") IP6_LL = ("fe8", "fe9", "fea", "feb")