AlistGo/alist · error

unsupported hash_type: %s

Error message

unsupported hash_type: %s

What it means

Configuration validation error from Chunker.validateOptions. hash_type selects the checksum algorithm stored in chunk metadata for integrity verification; only none, md5, and sha1 are implemented. Any other value fails storage initialization.

Source

Thrown at drivers/chunker/util.go:41

	"github.com/alist-org/alist/v3/pkg/utils"
)

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

View on GitHub (pinned to 843d9dc814)

Solutions

  1. Set hash_type to one of "none", "md5", or "sha1" exactly
  2. If a stronger hash is required, use "none" and verify integrity at the application layer until the driver supports more algorithms

Example fix

// before
"hash_type": "sha256"

// after
"hash_type": "sha1"
Defensive patterns

Strategy: validation

Validate before calling

var validHashTypes = map[string]bool{"none": true, "md5": true, "sha1": true}

if !validHashTypes[strings.TrimSpace(cfg.HashType)] {
    return fmt.Errorf("reject config before init: bad hash_type %q", cfg.HashType)
}

Type guard

func isValidHashType(v string) bool {
    switch v {
    case "none", "md5", "sha1":
        return true
    }
    return false
}

Try / catch

if err := storage.Init(ctx); err != nil {
    if strings.Contains(err.Error(), "unsupported hash_type") {
        cfg.HashType = "none" // safe default, then re-init
    }
}

Prevention

When it happens

Trigger: Creating or updating a Chunker storage with hash_type set to anything other than "none", "md5", or "sha1" — e.g. "sha256", "crc32", "MD5", or empty string.

Common situations: Users assuming sha256/crc32 support because other parts of alist use them; copy-pasting config from tutorials with unsupported values; case-sensitive typos.

Related errors


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