{"record":{"id":"b38d81c92b054db7","repo":"sipeed/picoclaw","slug":"deltachat-get-config-s-decode-w","errorCode":null,"errorMessage":"deltachat get config %s decode: %w","messagePattern":"deltachat get config (.+?) decode: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/channels/deltachat/deltachat.go","lineNumber":1179,"sourceCode":"\t})\n\tconfCtx, cancel := context.WithTimeout(ctx, configureTimeout)\n\tdefer cancel()\n\tif _, err := c.rpc.call(confCtx, \"configure\", accountID); err != nil {\n\t\treturn fmt.Errorf(\"deltachat configure (check email/password/server): %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (c *DeltaChatChannel) accountConfigChanged(ctx context.Context, accountID int64) (bool, error) {\n\twant := accountConfigMap(c.config)\n\tfor _, key := range managedAccountConfigKeys {\n\t\traw, err := c.rpc.call(ctx, \"get_config\", accountID, key)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"deltachat get config %s: %w\", key, err)\n\t\t}\n\t\tvar got *string\n\t\tif err := json.Unmarshal(raw, &got); err != nil {\n\t\t\treturn false, fmt.Errorf(\"deltachat get config %s decode: %w\", key, err)\n\t\t}\n\t\tif !accountConfigValueEqual(got, want[key]) {\n\t\t\tlogger.InfoCF(\"deltachat\", \"Account config changed; reconfiguring\", map[string]any{\n\t\t\t\t\"email\": c.config.Email,\n\t\t\t\t\"key\":   key,\n\t\t\t})\n\t\t\treturn true, nil\n\t\t}\n\t}\n\treturn false, nil\n}\n\nfunc accountConfigValueEqual(got, want *string) bool {\n\tif want == nil {\n\t\treturn got == nil || *got == \"\"\n\t}\n\tif got == nil {\n\t\treturn *want == \"\"","sourceCodeStart":1161,"sourceCodeEnd":1197,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/deltachat.go#L1161-L1197","documentation":"accountConfigChanged could not decode one managed key (managedAccountConfigKeys: addr, mail_server, mail_port, send_server, send_port, mail_pw) from JSON into *string. The direct caller degrades gracefully: deltachat.go:1002-1009 logs a warning and forces reconfiguration.","triggerScenarios":"json.Unmarshal(raw, &got) fails because get_config returned a non-string JSON value (number/object) for a managed key.","commonSituations":"Version skew where a deltachat-core release encodes ports as numbers or changes value shapes.","solutions":["Pin a deltachat-rpc-server version matching this client's assumptions","Log the raw response for the offending key to confirm the shape","Rely on the automatic reconfigure fallback and correct the mismatch in config if it loops"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"changed, err := c.accountConfigChanged(ctx, accountID)\nif err != nil {\n    // mirror deltachat.go:1002-1009: degrade to forced reconfigure instead of failing\n    logger.WarnCF(\"deltachat\", \"config check failed; reconfiguring\", map[string]any{\"error\": err.Error()})\n    changed = true\n}\nif changed {\n    return c.configureAccount(ctx, accountID)\n}","preventionTips":["Pin deltachat-rpc-server versions across the fleet to avoid schema drift","Treat decode failures in the config-diff path as 'changed' so the account self-heals"],"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"}