{"record":{"id":"752ec78f542b4462","repo":"spicetify/cli","slug":"cannot-enable-devtools-safely-q-marker-not-found","errorCode":null,"errorMessage":"cannot enable devtools safely: %q marker not found in offline.bnk","messagePattern":"cannot enable devtools safely: %q marker not found in offline\\.bnk","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/devtools.go","lineNumber":20,"sourceCode":"\nimport (\n\t\"bytes\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"runtime\"\n\t\"strings\"\n\n\t\"github.com/spicetify/cli/src/utils\"\n)\n\nconst offlineBnkDeveloperMarker = \"app-developer\"\n\nfunc findOfflineBnkDeveloperFlagOffsets(content string) (int64, int64, error) {\n\tfirstLocation := strings.Index(content, offlineBnkDeveloperMarker)\n\tif firstLocation == -1 {\n\t\treturn 0, 0, fmt.Errorf(\"cannot enable devtools safely: %q marker not found in offline.bnk\", offlineBnkDeveloperMarker)\n\t}\n\n\tsecondLocation := strings.LastIndex(content, offlineBnkDeveloperMarker)\n\tif secondLocation == -1 {\n\t\treturn 0, 0, fmt.Errorf(\"cannot enable devtools safely: %q marker not found in offline.bnk\", offlineBnkDeveloperMarker)\n\t}\n\n\tfirstPatchLocation := int64(firstLocation + 14)\n\tsecondPatchLocation := int64(secondLocation + 15)\n\n\treturn firstPatchLocation, secondPatchLocation, nil\n}\n\n// EnableDevTools enables the developer tools in the Spotify client\nfunc EnableDevTools() {\n\tvar filePath string\n\n\tswitch runtime.GOOS {","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/spicetify/cli/blob/1f13f736163165234eef4fb792a03f9b5b732aa4/src/cmd/devtools.go#L2-L38","documentation":"findOfflineBnkDeveloperFlagOffsets locates the \"app-developer\" marker inside Spotify's offline.bnk to compute byte offsets for the devtools patch. This first error fires when strings.Index cannot find the marker at all in the file content. Without the marker, enabling devtools would corrupt unknown bytes, so the library refuses to patch.","triggerScenarios":"EnableDevTools -> findOfflineBnkDeveloperFlagOffsets called on an offline.bnk whose content does not contain the literal \"app-developer\" string (firstIndex == -1).","commonSituations":"Spotify updated and rewrote offline.bnk without the marker; offline.bnk is empty, zero-length or corrupted; patching the wrong file path (wrong profile/install dir); a Spotify variant (e.g. web-player based builds) that never contained the flag.","solutions":["Update Spotify to a version whose offline.bnk still contains the app-developer marker, or update spicetify to a version supporting your Spotify build.","Verify you are patching the correct offline.bnk for the active Spotify installation/profile.","Check offline.bnk is not empty/corrupted; reinstall Spotify if it is.","Re-run `spicetify backup restore` then retry enable devtools on a clean state."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"content, err := os.ReadFile(bnkPath)\nif err == nil && !strings.Contains(string(content), \"app-developer\") {\n    return fmt.Errorf(\"offline.bnk lacks devtools marker; spicetify/Spotify version mismatch\")\n}","typeGuard":null,"tryCatchPattern":"if err := EnableDevTools(); err != nil {\n    if strings.Contains(err.Error(), \"marker not found\") {\n        // restore backup or update spicetify, don't patch manually\n    }\n    return err\n}","preventionTips":["Keep spicetify and Spotify versions compatible; check release notes after Spotify updates.","Always keep a spicetify backup of offline.bnk before patching.","Verify file size/content of offline.bnk before patching to catch corruption."],"tags":["binary-patching","devtools","spotify"],"backgroundTag":"marker-not-found","analyzedSha":"1f13f736163165234eef4fb792a03f9b5b732aa4","analyzedAt":"2026-08-31T18:57:59.754Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}