{"record":{"id":"81a94fc9ea2fd09d","repo":"router-for-me/CLIProxyAPI","slug":"config-update-failed","errorCode":"config_update_failed","errorMessage":"decode plugin config: %w","messagePattern":"decode plugin config: %w","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"internal/api/handlers/management/plugin_store.go","lineNumber":484,"sourceCode":"\t\treturn strings.TrimSpace(version[1:])\n\t}\n\treturn version\n}\n\n// enablePluginConfigLocked sets plugins.configs.<id>.enabled and store while\n// preserving the rest of the plugin's raw configuration. Callers must hold h.mu.\nfunc (h *Handler) enablePluginConfigLocked(id string, storeManifest pluginstore.Manifest) error {\n\tensurePluginConfigMap(h.cfg)\n\tnode := pluginConfigNode(h.cfg.Plugins.Configs[id])\n\tstoreNode, errStoreNode := pluginStoreManifestYAMLNode(storeManifest)\n\tif errStoreNode != nil {\n\t\treturn errStoreNode\n\t}\n\tsetYAMLMappingValue(node, \"enabled\", boolYAMLNode(true))\n\tsetYAMLMappingValue(node, \"store\", storeNode)\n\tupdated, errConfig := pluginInstanceConfigFromNode(node)\n\tif errConfig != nil {\n\t\treturn fmt.Errorf(\"decode plugin config: %w\", errConfig)\n\t}\n\th.cfg.Plugins.Configs[id] = updated\n\treturn nil\n}\n\nfunc pluginStoreManifestYAMLNode(manifest pluginstore.Manifest) (*yaml.Node, error) {\n\tvar node yaml.Node\n\tif errEncode := node.Encode(manifest); errEncode != nil {\n\t\treturn nil, fmt.Errorf(\"encode store manifest: %w\", errEncode)\n\t}\n\treturn &node, nil\n}\n\nfunc (h *Handler) pluginStoreSnapshot() (bool, string, string, []string, []pluginstore.AuthConfig, map[string]config.PluginInstanceConfig, *pluginhost.Host) {\n\tif h == nil {\n\t\treturn false, \"plugins\", \"\", nil, nil, map[string]config.PluginInstanceConfig{}, nil\n\t}\n\th.mu.Lock()","sourceCodeStart":466,"sourceCodeEnd":502,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/api/handlers/management/plugin_store.go#L466-L502","documentation":"Error \"decode plugin config: %w\" thrown in router-for-me/CLIProxyAPI.","triggerScenarios":"Thrown at internal/api/handlers/management/plugin_store.go:484 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the plugin configuration payload is valid JSON/YAML matching the plugin store schema.","Check the wrapped error for the exact decode failure and fix the malformed field in the plugin config."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}