{"record":{"id":"88e46247c1dad2ab","repo":"spicetify/cli","slug":"start-marker-not-found-s","errorCode":null,"errorMessage":"start marker not found: %s","messagePattern":"start marker not found: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/utils/file-utils.go","lineNumber":40,"sourceCode":"\tif !isUTF16LE && len(fileContent) > 100 && fileContent[1] == 0x00 {\n\t\tisUTF16LE = true\n\t}\n\n\tvar startIdx, endIdx int\n\tvar contentToSearch []byte\n\tvar searchStartMarker, searchEndMarker []byte\n\n\tif !isUTF16LE {\n\t\treturn \"\", -1, -1, fmt.Errorf(\"file is not in UTF-16LE format: %s\", inputFile)\n\t}\n\n\tcontentToSearch = fileContent[2:]\n\tsearchStartMarker = encodeUTF16LE(startMarker)\n\tsearchEndMarker = encodeUTF16LE(endMarker)\n\n\tstartIdx = bytes.Index(contentToSearch, searchStartMarker)\n\tif startIdx == -1 {\n\t\treturn \"\", -1, -1, fmt.Errorf(\"start marker not found: %s\", string(startMarker))\n\t}\n\n\tsearchSpace := contentToSearch[startIdx+len(searchStartMarker):]\n\tendIdx = bytes.Index(searchSpace, searchEndMarker)\n\tif endIdx == -1 {\n\t\treturn \"\", -1, -1, fmt.Errorf(\"end marker not found after start index %d: %s\", startIdx+len(searchStartMarker), string(endMarker))\n\t}\n\n\tstringContentBytes := contentToSearch[startIdx : startIdx+len(searchStartMarker)+endIdx+len(searchEndMarker)]\n\n\tdecodedStringBytes, err := decodeUTF16LE(stringContentBytes)\n\tif err != nil {\n\t\treturn \"\", -1, -1, fmt.Errorf(\"error decoding UTF-16LE content: %w\", err)\n\t}\n\n\t// Adjust indices to be byte offsets in the original file\n\toriginalStartIdx := 2 + startIdx\n\toriginalEndIdx := 2 + endIdx + len(stringContentBytes)","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/spicetify/cli/blob/1f13f736163165234eef4fb792a03f9b5b732aa4/src/utils/file-utils.go#L22-L58","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the marker string matches exactly what Spotify stores (key name changes between versions).","Update spicetify so its markers match the current Spotify version.","Search the file manually (hex editor) for the UTF-16LE encoding of your marker to confirm it exists.","Ensure you are reading the correct bnk/file for the active Spotify profile."],"exampleFix":"// before\nval, _, _, err := utils.ReadStringFromUTF16Binary(bnkPath, []byte(\"old-key\"), []byte(\"\\x00\"))\n// after\nval, _, _, err := utils.ReadStringFromUTF16Binary(bnkPath, []byte(\"current-key\"), []byte(\"\\x00\"))","handlingStrategy":"validation","validationCode":"content, _ := os.ReadFile(bnkPath)\nmarker := encodeUTF16LE([]byte(\"current-key\"))\nif !bytes.Contains(content, marker) {\n    return fmt.Errorf(\"start marker not present in %s\", bnkPath)\n}","typeGuard":null,"tryCatchPattern":"val, _, _, err := utils.ReadStringFromUTF16Binary(path, start, end)\nif err != nil && strings.Contains(err.Error(), \"start marker not found\") {\n    // update marker strings for current Spotify version\n    return err\n}","preventionTips":["Keep marker key names in sync with the Spotify version you target.","Hex-search the target file for the UTF-16LE marker before extraction.","Centralize marker definitions so version bumps update them in one place."],"tags":["binary","utf16","marker"],"backgroundTag":"marker-not-found","analyzedSha":"1f13f736163165234eef4fb792a03f9b5b732aa4","analyzedAt":"2026-08-31T18:57:59.754Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}