{"record":{"id":"af46fd64b7b465cb","repo":"sipeed/picoclaw","slug":"decode-config-s-w","errorCode":null,"errorMessage":"decode config %s: %w","messagePattern":"decode config (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/deltachat/deltachat.go","lineNumber":1110,"sourceCode":"\t\treturn\n\t}\n\tstopCtx, cancel := context.WithTimeout(ctx, 10*time.Second)\n\t_, _ = c.rpc.call(stopCtx, \"stop_ongoing_process\", accountID)\n\tcancel()\n\n\tremoveCtx, cancel := context.WithTimeout(ctx, 10*time.Second)\n\t_, _ = c.rpc.call(removeCtx, \"remove_account\", accountID)\n\tcancel()\n}\n\nfunc (c *DeltaChatChannel) getAccountConfigString(ctx context.Context, accountID int64, key string) (string, error) {\n\traw, err := c.rpc.call(ctx, \"get_config\", accountID, key)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"get config %s: %w\", key, err)\n\t}\n\tvar value *string\n\tif err := json.Unmarshal(raw, &value); err != nil {\n\t\treturn \"\", fmt.Errorf(\"decode config %s: %w\", key, err)\n\t}\n\tif value == nil {\n\t\treturn \"\", nil\n\t}\n\treturn *value, nil\n}\n\nfunc (c *DeltaChatChannel) passwordRequiredError(reason string) error {\n\treturn fmt.Errorf(\"deltachat: account %s is not configured in data_dir %s (%s)\",\n\t\tc.config.Email, c.dataDir, reason)\n}\n\nfunc (c *DeltaChatChannel) applyProfileConfig(ctx context.Context, accountID int64) error {\n\tcfgMap := map[string]*string{}\n\tif name := strings.TrimSpace(c.config.DisplayName); name != \"\" {\n\t\tcfgMap[\"displayname\"] = accountConfigString(name)\n\t}\n\tif avatar := strings.TrimSpace(c.config.AvatarImage); avatar != \"\" {","sourceCodeStart":1092,"sourceCodeEnd":1128,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/deltachat.go#L1092-L1128","documentation":"The get_config result did not unmarshal into *string: the server returned JSON other than string or null for the requested key. This is a schema/shape mismatch between the installed deltachat-rpc-server and the shapes this client assumes.","triggerScenarios":"json.Unmarshal(raw, &value) fails because raw is a number, object, or array (e.g. a core returning numeric values for keys like ports).","commonSituations":"deltachat-rpc-server version skew after an upgrade/downgrade; a custom fork of the RPC server changing result encoding.","solutions":["Log the raw payload (json.RawMessage) to see the actual shape returned","Pin the deltachat-rpc-server version to one matching this PicoClaw build","Report the shape change upstream if a stock server produces it"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"raw, callErr := c.rpc.call(ctx, \"get_config\", id, key)\nif callErr != nil {\n    return \"\", fmt.Errorf(\"get config %s: %w\", key, callErr)\n}\nvar v any\nif err := json.Unmarshal(raw, &v); err != nil {\n    log.Warn(\"unexpected config shape\", \"key\", key, \"raw\", string(raw))\n    return \"\", fmt.Errorf(\"decode config %s: %w\", key, err)\n}","preventionTips":["Pin the deltachat-rpc-server version in deployment scripts","Log raw payloads on decode failures to catch schema drift early"],"tags":["deltachat","rpc","json","version-skew","go"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}