syncthing/syncthing · error

File system type '%s' not recognized

Error message

File system type '%s' not recognized

What it means

fs.NewFilesystem was called with an fsType that has no registered factory, so a filesystem could not be constructed. Instead of returning a bare error, the library returns an errorFilesystem that fails on every subsequent operation with the same error — the failure surfaces later, at first use.

Source

Thrown at lib/fs/filesystem.go:246

		case *optionMtime:
			mtimeOpt = opt
		default:
			opts[i] = opt
			i++
		}
	}
	opts = opts[:i]

	// Construct file system using the registered factory function
	var fs Filesystem
	var err error
	filesystemFactoriesMutex.Lock()
	fsFactory, factoryFound := filesystemFactories[fsType]
	filesystemFactoriesMutex.Unlock()
	if factoryFound {
		fs, err = fsFactory(uri, opts...)
	} else {
		err = fmt.Errorf("File system type '%s' not recognized", fsType)
	}

	if err != nil {
		fs = &errorFilesystem{
			fsType: fsType,
			uri:    uri,
			err:    err,
		}
	}

	// mtime handling should happen inside walking, as filesystem calls while
	// walking should be mtime-resolved too
	if mtimeOpt != nil {
		fs = mtimeOpt.apply(fs)
	}

	fs = &metricsFS{next: fs}

View on GitHub (pinned to 058bcd7334)

Solutions

  1. Correct the filesystem type in the configuration; supported values are the fs.FilesystemType constants (basic, fake, walkfs, ...) — check the registry via the registered factories.
  2. If the type should exist, verify the build includes the package that registers it (import side effects).
  3. Handle errors on first use of the filesystem: errors.Is(err, ErrRecursive ...) / inspect errorFilesystem behavior rather than assuming NewFilesystem fails eagerly.

Example fix

// before
f := fs.NewFilesystem(fs.FilesystemType("basik"), uri)
// after
f := fs.NewFilesystem(fs.FilesystemTypeBasic, uri)
Defensive patterns

Strategy: validation

Validate before calling

validTypes := map[fs.FilesystemType]bool{fs.FilesystemTypeBasic: true /*, ...*/}
if !validTypes[fsType] { return nil, fmt.Errorf("unknown fs type %s", fsType) }

Try / catch

f := fs.NewFilesystem(fsType, uri)
if _, err := f.Lstat("."); err != nil {
    // errorFilesystem surfaces the construction error here
    return fmt.Errorf("filesystem %s unusable: %w", fsType, err)
}

Prevention

When it happens

Trigger: NewFilesystem with a misspelled or unregistered type string (e.g. 'basicc' instead of 'basic', or a type only available on other platforms, like 'fake' outside tests). The returned errorFilesystem yields this error on any Open/Stat/Create call.

Common situations: Downgrading/upgrading Syncthing where a folder config references an fs type no longer compiled in; typos in programmatic config; custom builds without certain backends.

Related errors


AI-assisted analysis of syncthing/syncthing@058bcd7334 (2026-08-15). Data as JSON: /api/errors/eab8978a7bccb1e5. Report an issue: GitHub.