Merge: * stats: handle "invalid argument" error from "bbolt"

Close #1188

Squashed commit of the following:

commit 70355154bb49ae7df57e79ed1405754682f5d57f
Merge: 331650e6 d1c47c0d
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Dec 9 14:09:59 2019 +0300

    Merge remote-tracking branch 'origin/master' into 1188-bolt-err

commit 331650e60d5869b7c706b539f04c1a856cd9f254
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Mon Dec 9 13:57:14 2019 +0300

    minor

commit 07130a0f1f2e88cab30a88d899e8d817096ac35f
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Wed Dec 4 13:50:29 2019 +0300

    * stats: handle "invalid argument" error from "bbolt"
This commit is contained in:
Simon Zolin 2019-12-09 14:13:39 +03:00
parent d1c47c0dbb
commit 40763c903b
1 changed files with 3 additions and 0 deletions

View File

@ -133,6 +133,9 @@ func (s *statsCtx) dbOpen() bool {
s.db, err = bolt.Open(s.conf.Filename, 0644, nil)
if err != nil {
log.Error("Stats: open DB: %s: %s", s.conf.Filename, err)
if err.Error() == "invalid argument" {
log.Error("AdGuard Home cannot be initialized due to an incompatible file system.\nPlease read the explanation here: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#limitations")
}
return false
}
log.Tracef("db.Open")