sipeed/picoclaw · error

deltachat: account %s is not configured in data_dir %s (%s)

Error message

deltachat: account %s is not configured in data_dir %s (%s)

What it means

passwordRequiredError: the email setting is a normal address (no '@server' marker), no already-Configured account with that addr exists in data_dir, and no password is set to create one (reason 'account not found'); or configureAccount ran against an unconfigured account with an empty password ('account is not configured'). Delta Chat accounts need IMAP credentials, and PicoClaw will not invent them.

Source

Thrown at pkg/channels/deltachat/deltachat.go:1119

}

func (c *DeltaChatChannel) getAccountConfigString(ctx context.Context, accountID int64, key string) (string, error) {
	raw, err := c.rpc.call(ctx, "get_config", accountID, key)
	if err != nil {
		return "", fmt.Errorf("get config %s: %w", key, err)
	}
	var value *string
	if err := json.Unmarshal(raw, &value); err != nil {
		return "", fmt.Errorf("decode config %s: %w", key, err)
	}
	if value == nil {
		return "", nil
	}
	return *value, nil
}

func (c *DeltaChatChannel) passwordRequiredError(reason string) error {
	return fmt.Errorf("deltachat: account %s is not configured in data_dir %s (%s)",
		c.config.Email, c.dataDir, reason)
}

func (c *DeltaChatChannel) applyProfileConfig(ctx context.Context, accountID int64) error {
	cfgMap := map[string]*string{}
	if name := strings.TrimSpace(c.config.DisplayName); name != "" {
		cfgMap["displayname"] = accountConfigString(name)
	}
	if avatar := strings.TrimSpace(c.config.AvatarImage); avatar != "" {
		avatar = expandHome(avatar)
		if !fileExists(avatar) {
			logger.WarnCF("deltachat", "avatar_image not found; leaving current avatar unchanged", map[string]any{
				"avatar_image": avatar,
			})
		} else {
			cfgMap["selfavatar"] = accountConfigString(avatar)
		}
	}

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. Set channel_list.deltachat.settings.password (or the secret/env it references)
  2. For chatmail providers, switch email to '@server' once, complete the bootstrap, then pin the generated address
  3. Verify data_dir actually holds your account db so the existing account is found

Example fix

# before (channel_list config)
email: "bot@example.org"
# no password

# after
email: "bot@example.org"
password: "app-specific-password"
Defensive patterns

Strategy: validation

Validate before calling

// Before enabling the channel
if cfg.Password == "" && !strings.HasPrefix(strings.TrimSpace(cfg.Email), "@") {
    return fmt.Errorf("deltachat: set a password or use the @server chatmail bootstrap for %s", cfg.Email)
}

Try / catch

if err := ch.ensureAccount(ctx); err != nil {
    if strings.Contains(err.Error(), "is not configured in data_dir") {
        // config problem: add password or fix data_dir, not a code problem
    }
    return err
}

Prevention

When it happens

Trigger: ensureAccount with c.config.Password empty and get_all_accounts showing no Configured account matching the email; or configureAccount reached with an empty Password.

Common situations: First run on a fresh data_dir with a plain email and no password in config; password removed/emptied later; data_dir pointing somewhere that does not contain the existing account database.

Related errors


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/be9999d0580d3339. Report an issue: GitHub.