plandex-ai/plandex · error

error writing accounts: %v

Error message

error writing accounts: %v

What it means

Fires in storeAccount when os.WriteFile cannot persist the marshalled accounts JSON to fs.HomeAccountsPath. Indicates filesystem-level trouble: bad permissions, missing parent dir, disk full, or a read-only home.

Source

Thrown at app/cli/auth/state.go:83

			found = true
			break
		}
	}

	if !found {
		accounts = append(accounts, toStore)
	}

	bytes, err := json.Marshal(accounts)

	if err != nil {
		return fmt.Errorf("error marshalling accounts: %v", err)
	}

	err = os.WriteFile(fs.HomeAccountsPath, bytes, os.ModePerm)

	if err != nil {
		return fmt.Errorf("error writing accounts: %v", err)
	}

	return nil
}

func writeCurrentAuth() error {
	if Current == nil {
		return fmt.Errorf("error writing auth: auth not loaded")
	}

	bytes, err := json.Marshal(Current)

	if err != nil {
		return fmt.Errorf("error marshalling auth: %v", err)
	}

	err = os.WriteFile(fs.HomeAuthPath, bytes, os.ModePerm)

View on GitHub (pinned to e2d772072e)

Solutions

  1. Check the wrapped error for permission or path issues
  2. Ensure the config/home directory exists before writing
  3. Verify disk space and that the path is writable by the current user
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at app/cli/auth/state.go:83 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05). Data as JSON: /api/errors/698a9f08415c43ed. Report an issue: GitHub.