{"record":{"id":"2d487e92db60066d","repo":"sipeed/picoclaw","slug":"deltachat-set-account-config-w","errorCode":null,"errorMessage":"deltachat set account config: %w","messagePattern":"deltachat set account config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/deltachat/deltachat.go","lineNumber":1156,"sourceCode":"\tif len(cfgMap) == 0 {\n\t\treturn nil\n\t}\n\tif _, err := c.rpc.call(ctx, \"batch_set_config\", accountID, cfgMap); err != nil {\n\t\treturn fmt.Errorf(\"deltachat set profile config: %w\", err)\n\t}\n\treturn nil\n}\n\n// configureAccount writes the managed account settings and runs the (network-bound)\n// provider auto-configuration.\nfunc (c *DeltaChatChannel) configureAccount(ctx context.Context, accountID int64) error {\n\tif c.config.Password.String() == \"\" {\n\t\treturn c.passwordRequiredError(\"account is not configured\")\n\t}\n\n\tcfgMap := accountConfigMap(c.config)\n\tif _, err := c.rpc.call(ctx, \"batch_set_config\", accountID, cfgMap); err != nil {\n\t\treturn fmt.Errorf(\"deltachat set account config: %w\", err)\n\t}\n\n\tlogger.InfoCF(\"deltachat\", \"Configuring account (validating credentials)\", map[string]any{\n\t\t\"email\": c.config.Email,\n\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 {","sourceCodeStart":1138,"sourceCodeEnd":1174,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/deltachat.go#L1138-L1174","documentation":"configureAccount's batch_set_config writing the managed settings (addr, mail_server/mail_port, send_server/send_port, mail_pw from accountConfigMap) failed at the transport level, before any credential validation happened.","triggerScenarios":"c.rpc.call(ctx, \"batch_set_config\", accountID, cfgMap) returns an error: dead/closed RPC connection, canceled context, or a server-side JSON-RPC error.","commonSituations":"deltachat-rpc-server crashed between account discovery and configuration; data_dir became unwritable; shutdown race.","solutions":["Check RPC server liveness (get_system_info) and its stderr logs","Verify data_dir is writable and not full","Restart PicoClaw to respawn the server and retry configuration"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := c.rpc.call(ctx, \"batch_set_config\", accountID, cfgMap); err != nil {\n    if strings.Contains(err.Error(), \"rpc closed\") {\n        // respawn server, then restart ensureAccount from listAccounts\n    }\n    return fmt.Errorf(\"deltachat set account config: %w\", err)\n}","preventionTips":["Keep data_dir writable and monitored for space","Restart the whole channel on transport-level batch_set_config failures rather than retrying one key"],"tags":["deltachat","rpc","config","account","go"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}