{"record":{"id":"c6cef19be0267380","repo":"router-for-me/CLIProxyAPI","slug":"unsupported-plugin-sync-schema-version-d","errorCode":null,"errorMessage":"unsupported plugin sync schema_version %d","messagePattern":"unsupported plugin sync schema_version (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginstore/home_sync.go","lineNumber":52,"sourceCode":"\t\treturn\n\t}\n\tClearResolvedAuthConfigs(i.Auth)\n\ti.Auth = nil\n\ti.Manifest = Manifest{}\n}\n\ntype PluginSyncResponse struct {\n\tSchemaVersion int              `json:\"schema_version\"`\n\tExpiresAt     time.Time        `json:\"expires_at\"`\n\tItems         []PluginSyncItem `json:\"items\"`\n}\n\nfunc (r *PluginSyncResponse) Validate(now time.Time) error {\n\tif r == nil {\n\t\treturn fmt.Errorf(\"plugin sync response is nil\")\n\t}\n\tif r.SchemaVersion != PluginSyncSchemaVersion {\n\t\treturn fmt.Errorf(\"unsupported plugin sync schema_version %d\", r.SchemaVersion)\n\t}\n\tif r.ExpiresAt.IsZero() {\n\t\treturn fmt.Errorf(\"plugin sync response missing expires_at\")\n\t}\n\tif !now.Before(r.ExpiresAt) {\n\t\treturn fmt.Errorf(\"plugin sync response expired\")\n\t}\n\tseen := make(map[string]struct{}, len(r.Items))\n\tfor index := range r.Items {\n\t\titem := &r.Items[index]\n\t\tif errManifest := item.Manifest.Validate(); errManifest != nil {\n\t\t\treturn fmt.Errorf(\"plugin sync item %d: %w\", index, errManifest)\n\t\t}\n\t\tif errURLs := validatePluginSyncManifestURLs(item.Manifest); errURLs != nil {\n\t\t\treturn fmt.Errorf(\"plugin sync item %d: %w\", index, errURLs)\n\t\t}\n\t\tid := strings.TrimSpace(item.Manifest.ID)\n\t\tif _, exists := seen[id]; exists {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginstore/home_sync.go#L34-L70","documentation":"The plugin sync response's schema_version field does not equal PluginSyncSchemaVersion (currently 1). The sync protocol is versioned so that clients and the plugin index server agree on the payload shape; any other value is rejected before further parsing. This appears when the server is newer (or older) than the client understands.","triggerScenarios":"PluginSyncResponse.Validate on a payload whose schema_version is 0 (missing field, old server) or >= 2 (newer server format), i.e. after a client/server version skew.","commonSituations":"Upgraded CLIProxyAPI talks to an old cached sync index; downgraded binary reads a cache written by a newer schema; sync endpoint URL pointed at an incompatible service.","solutions":["Upgrade the client binary to the version matching the sync server's schema","Delete the cached sync response (it will be re-fetched with a compatible schema once versions align)","If you operate the sync server, pin it to schema_version 1 until all clients upgrade","Verify the sync endpoint URL points at the official plugin index"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if resp.SchemaVersion != pluginstore.PluginSyncSchemaVersion {\n    return fmt.Errorf(\"cache schema %d unsupported, refetch\", resp.SchemaVersion)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"unsupported plugin sync schema_version\") {\n    // drop cache, refetch; if it persists, upgrade/downgrade client to match server\n}","preventionTips":["Check schema_version against PluginSyncSchemaVersion before deep use","Invalidate cached sync payloads on client upgrade","Server operators: gate schema bumps on client adoption"],"tags":["version-skew","schema","sync","validation","go"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}