AlistGo/alist · error

hash_type %q requires meta_format=simplejson

Error message

hash_type %q requires meta_format=simplejson

What it means

Cross-field validation in Chunker.validateOptions. Hash values are persisted inside the simplejson metadata files; with meta_format=none there is nowhere to store a hash, so requesting any hash_type other than none together with meta_format=none is rejected at init time.

Source

Thrown at drivers/chunker/util.go:44

func (d *Chunker) validateOptions() error {
	if strings.TrimSpace(d.RemotePath) == "" {
		return errors.New("remote_path is required")
	}
	if d.ChunkSize <= 0 {
		return errors.New("chunk_size must be positive")
	}
	switch d.MetaFormat {
	case "simplejson", "none":
	default:
		return fmt.Errorf("unsupported meta_format: %s", d.MetaFormat)
	}
	switch d.HashType {
	case "none", "md5", "sha1":
	default:
		return fmt.Errorf("unsupported hash_type: %s", d.HashType)
	}
	if d.MetaFormat == "none" && d.HashType != "none" {
		return fmt.Errorf("hash_type %q requires meta_format=simplejson", d.HashType)
	}
	return nil
}

func (d *Chunker) configuredRemotePaths() []string {
	seen := map[string]struct{}{}
	paths := make([]string, 0, 1)
	addPath := func(p string) {
		p = strings.TrimSpace(p)
		if p == "" {
			return
		}
		p = utils.FixAndCleanPath(p)
		if _, ok := seen[p]; ok {
			return
		}
		seen[p] = struct{}{}
		paths = append(paths, p)

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Set hash_type to "none" when meta_format is "none"
  2. Or switch meta_format to "simplejson" to keep hash verification

Example fix

// before
"meta_format": "none",
"hash_type": "md5"

// after
"meta_format": "none",
"hash_type": "none"
Defensive patterns

Strategy: validation

Validate before calling

if cfg.MetaFormat == "none" && cfg.HashType != "none" {
    return errors.New("hash_type requires meta_format=simplejson; set hash_type to none")
}

Type guard

func hashConfigConsistent(metaFormat, hashType string) bool {
    return metaFormat != "none" || hashType == "none"
}

Prevention

When it happens

Trigger: Configuring a Chunker storage with meta_format: "none" while hash_type is "md5" or "sha1" — including the case where hash_type has a non-empty default left over from a previous configuration.

Common situations: Toggling meta_format from simplejson to none to avoid metadata sidecar files but forgetting to reset hash_type; importing a config template that mixes the two options.

Related errors


AI-assisted analysis of AlistGo/alist@843d9dc814 (2026-08-15). Data as JSON: /api/errors/fbfcd7478bffc321. Report an issue: GitHub.