@@ -383,6 +383,30 @@ func (s *SQLiteState) ValidateDBConfig(runtime *Runtime) (defErr error) {
383383 return fmt .Errorf ("retrieving DB config: %w" , err )
384384 }
385385
386+ // Sometimes, for as-yet unclear reasons, the database value ends up set
387+ // to the empty string. If it does, this evaluation is always going to
388+ // fail, and libpod will be unusable.
389+ // At this point, the check is effectively meaningless - we don't
390+ // actually know the settings we should be checking against. The best
391+ // thing we can do (and what BoltDB did in this case) is to compare
392+ // against the default, on the assumption that is what was in use.
393+ // TODO: We can't remove this code without breaking existing SQLite DBs
394+ // that already have incorrect values in the database, but we should
395+ // investigate why this is happening and try and prevent the creation of
396+ // new databases with these garbage checks.
397+ if graphRoot == "" {
398+ logrus .Debugf ("Database uses empty-string graph root, substituting default %q" , storeOpts .GraphRoot )
399+ graphRoot = storeOpts .GraphRoot
400+ }
401+ if runRoot == "" {
402+ logrus .Debugf ("Database uses empty-string run root, substituting default %q" , storeOpts .RunRoot )
403+ runRoot = storeOpts .RunRoot
404+ }
405+ if graphDriver == "" {
406+ logrus .Debugf ("Database uses empty-string graph driver, substituting default %q" , storeOpts .GraphDriverName )
407+ graphDriver = storeOpts .GraphDriverName
408+ }
409+
386410 checkField := func (fieldName , dbVal , ourVal string , isPath bool ) error {
387411 if isPath {
388412 // Tolerate symlinks when possible - most relevant for OStree systems
0 commit comments