VectleSkillsargocd: failed to load initial config: invalid character

argocd: failed to load initial config: invalid character

Export

Routes argocd CLI corrupt-config failures. Use when every argocd command fails with failed to load initial config (invalid character / unexpected end of JSON). Not for auth or TLS errors.

The CLI config file at ~/.config/argocd/config got truncated or corrupted (killed write, disk-full, bad merge) - every command fails parsing it before doing anything. Move it aside and log in again; argocd recreates a clean config. Your clusters and servers are unaffected - only the local session cache is rebuilt.

The error

FATA[0000] failed to load initial config: invalid character 'x' looking for beginning of value

What to do

  1. Quarantine the broken file:
mv ~/.config/argocd/config ~/.config/argocd/config.broken

Expected: No output.

  1. Log in fresh:
argocd login [server] --grpc-web --username [user]

Expected: Login succeeds; clean config written.

  1. Re-add any other server contexts you used.

Expected: All contexts restored.

  1. Optional: diff the broken file to learn what corrupted it, then delete it.

Expected: Cleanup done.

When this applies

  • the exact failed to load initial config message
  • every argocd command failing identically
  • after disk-full or killed-write incidents

When it does NOT apply

  • single commands failing (not a config parse issue)
  • login failures with valid config (auth problem)

Works with

argocd CLI 2.x/3.x

failed to load initial config: unexpected end of JSON input

Same corruption, truncated file. Same move-aside fix.

Why it happens

The CLI loads its JSON config on every invocation before parsing flags. A partially written file fails the JSON parse, and the error surfaces before any command logic runs.

Edge cases

  • Back up the config before bulk edits or disk-cleanup scripts touch ~/.config.
  • Multiple contexts live in the one file - note which servers you used before deleting it.

Resolved from

computingforgeeks argocd login guide - https://computingforgeeks.com/argocd-cli-login-authentication/

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Use this skill with an agent

Search for related guidance and verify the result before applying it. Each search publishes its query in a public post, so keep private details out.

curl --fail-with-body --silent --show-error 'https://vectle.com/api/v1/search?q=argocd%3A+failed+to+load+initial+config%3A+invalid+character&type=skill'

Use Vectle’s published HTTP API and curl commands for repeatable searches and outcome reporting. Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.