spicetify/cli · error

cannot enable devtools safely: %q marker not found in offlin

Error message

cannot enable devtools safely: %q marker not found in offline.bnk

What it means

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.

Source

Thrown at src/cmd/devtools.go:20

import (
	"bytes"
	"fmt"
	"log"
	"os"
	"path/filepath"
	"runtime"
	"strings"

	"github.com/spicetify/cli/src/utils"
)

const offlineBnkDeveloperMarker = "app-developer"

func findOfflineBnkDeveloperFlagOffsets(content string) (int64, int64, error) {
	firstLocation := strings.Index(content, offlineBnkDeveloperMarker)
	if firstLocation == -1 {
		return 0, 0, fmt.Errorf("cannot enable devtools safely: %q marker not found in offline.bnk", offlineBnkDeveloperMarker)
	}

	secondLocation := strings.LastIndex(content, offlineBnkDeveloperMarker)
	if secondLocation == -1 {
		return 0, 0, fmt.Errorf("cannot enable devtools safely: %q marker not found in offline.bnk", offlineBnkDeveloperMarker)
	}

	firstPatchLocation := int64(firstLocation + 14)
	secondPatchLocation := int64(secondLocation + 15)

	return firstPatchLocation, secondPatchLocation, nil
}

// EnableDevTools enables the developer tools in the Spotify client
func EnableDevTools() {
	var filePath string

	switch runtime.GOOS {

View on GitHub (pinned to 1f13f73616)

Solutions

  1. Update Spotify to a version whose offline.bnk still contains the app-developer marker, or update spicetify to a version supporting your Spotify build.
  2. Verify you are patching the correct offline.bnk for the active Spotify installation/profile.
  3. Check offline.bnk is not empty/corrupted; reinstall Spotify if it is.
  4. Re-run `spicetify backup restore` then retry enable devtools on a clean state.
Defensive patterns

Strategy: validation

Validate before calling

content, err := os.ReadFile(bnkPath)
if err == nil && !strings.Contains(string(content), "app-developer") {
    return fmt.Errorf("offline.bnk lacks devtools marker; spicetify/Spotify version mismatch")
}

Try / catch

if err := EnableDevTools(); err != nil {
    if strings.Contains(err.Error(), "marker not found") {
        // restore backup or update spicetify, don't patch manually
    }
    return err
}

Prevention

When it happens

Trigger: EnableDevTools -> findOfflineBnkDeveloperFlagOffsets called on an offline.bnk whose content does not contain the literal "app-developer" string (firstIndex == -1).

Common situations: 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.

Related errors


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