spicetify/cli · error

start marker not found: %s

Error message

start marker not found: %s

What it means

After confirming UTF-16LE, ReadStringFromUTF16Binary encodes the start/end markers to UTF-16LE and searches for them with bytes.Index. If the start marker is absent (startIdx == -1) it returns this error naming the marker string. The delimited value cannot be located, so extraction fails.

Source

Thrown at src/utils/file-utils.go:40

	if !isUTF16LE && len(fileContent) > 100 && fileContent[1] == 0x00 {
		isUTF16LE = true
	}

	var startIdx, endIdx int
	var contentToSearch []byte
	var searchStartMarker, searchEndMarker []byte

	if !isUTF16LE {
		return "", -1, -1, fmt.Errorf("file is not in UTF-16LE format: %s", inputFile)
	}

	contentToSearch = fileContent[2:]
	searchStartMarker = encodeUTF16LE(startMarker)
	searchEndMarker = encodeUTF16LE(endMarker)

	startIdx = bytes.Index(contentToSearch, searchStartMarker)
	if startIdx == -1 {
		return "", -1, -1, fmt.Errorf("start marker not found: %s", string(startMarker))
	}

	searchSpace := contentToSearch[startIdx+len(searchStartMarker):]
	endIdx = bytes.Index(searchSpace, searchEndMarker)
	if endIdx == -1 {
		return "", -1, -1, fmt.Errorf("end marker not found after start index %d: %s", startIdx+len(searchStartMarker), string(endMarker))
	}

	stringContentBytes := contentToSearch[startIdx : startIdx+len(searchStartMarker)+endIdx+len(searchEndMarker)]

	decodedStringBytes, err := decodeUTF16LE(stringContentBytes)
	if err != nil {
		return "", -1, -1, fmt.Errorf("error decoding UTF-16LE content: %w", err)
	}

	// Adjust indices to be byte offsets in the original file
	originalStartIdx := 2 + startIdx
	originalEndIdx := 2 + endIdx + len(stringContentBytes)

View on GitHub (pinned to 1f13f73616)

Solutions

  1. Check the marker string matches exactly what Spotify stores (key name changes between versions).
  2. Update spicetify so its markers match the current Spotify version.
  3. Search the file manually (hex editor) for the UTF-16LE encoding of your marker to confirm it exists.
  4. Ensure you are reading the correct bnk/file for the active Spotify profile.

Example fix

// before
val, _, _, err := utils.ReadStringFromUTF16Binary(bnkPath, []byte("old-key"), []byte("\x00"))
// after
val, _, _, err := utils.ReadStringFromUTF16Binary(bnkPath, []byte("current-key"), []byte("\x00"))
Defensive patterns

Strategy: validation

Validate before calling

content, _ := os.ReadFile(bnkPath)
marker := encodeUTF16LE([]byte("current-key"))
if !bytes.Contains(content, marker) {
    return fmt.Errorf("start marker not present in %s", bnkPath)
}

Try / catch

val, _, _, err := utils.ReadStringFromUTF16Binary(path, start, end)
if err != nil && strings.Contains(err.Error(), "start marker not found") {
    // update marker strings for current Spotify version
    return err
}

Prevention

When it happens

Trigger: Calling ReadStringFromUTF16Binary with a startMarker whose UTF-16LE byte sequence does not appear in the file body — wrong marker string, marker removed by a Spotify update, or wrong file/version scanned.

Common situations: Hardcoded marker from an older spicetify version no longer present in the updated Spotify binary; passing an ASCII marker but the file stores a different key name; scanning the wrong .bnk/profile file for that key.

Related errors


AI-assisted analysis of spicetify/cli@1f13f73616 (2026-08-31). Data as JSON: /api/errors/88e46247c1dad2ab. Report an issue: GitHub.