elastic / elastic/cli

fix: auth failures should point at status and config edit

Open
#636 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
41
Forks
24
Avg merge
1d 3h
Merged PRs (30d)
56

Description

TLS errors already append a hint (`src/es/errors.ts`). 401/403 from ES, Kibana, or Cloud usually dump the transport body.

On 401/403 (and expired API key if we can detect it), append one hint:

- `elastic status --json` to see which service failed
- `elastic config context edit` (or the Cloud reset-credentials command when the context is a Serverless project)

Keep the original server message. Hint goes on stderr after it. `--json` puts the hint in `error.hint` so agents can parse it.

Acceptance: mock 401 on `elastic stack es ping --json` includes `error.hint` naming `elastic status`.

Contributor guide

Open the contributing guide

Research direction

Start in src/es/errors.ts, where TLS errors already append hints, and trace how 401/403 responses from the ES, Kibana, and Cloud commands are rendered. Run or add the mock-401 coverage for elastic stack es ping --json; done means the original server message remains and error.hint names elastic status, with the corresponding stderr guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, typescript
Domain
api, authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.