<!-- XE-0684 · `xe providers` prints 'No providers found.' when the node errors, and exits 0 · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0684>. The page is the record; this is the same page for reading.*

XE-0684 · Bounty

# \`xe providers\` prints 'No providers found.' when the node errors, and exits 0

Closed · duplicate
—
[xe#268](https://github.com/xeprotocol/xe/issues/268)
filed 2026-11-05 11:38 UTC
by rusdiwireng

Verdict
:   Duplicate

Tier
:   —

Claimed
:   —

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   —

Updated
:   2026-11-14 22:55 UTC

Told
:   2026-11-14 22:54 UTC

### Patches

- [xe#286](https://github.com/xeprotocol/xe/pull/286) open by Khanhtnq
  fix(cli,client,chat,node,api): harden CLI flag parsing, provider errors, chat PoW bounds, marketplace rate-limit, and API pagination

### History

- [210028](https://bounty.xe.network/log/210028) 2026-11-14 22:54 UTC reply.mirrored
- [209976](https://bounty.xe.network/log/209976) 2026-11-14 22:53 UTC reply.sent
- [45039](https://bounty.xe.network/log/45039) 2026-11-08 20:33 UTC github.state\_pushed
- [45038](https://bounty.xe.network/log/45038) 2026-11-08 20:33 UTC github.labels
- [44772](https://bounty.xe.network/log/44772) 2026-11-08 20:32 UTC proposal.adopted
- [44771](https://bounty.xe.network/log/44771) 2026-11-08 20:32 UTC ticket.status new → closed
- [25978](https://bounty.xe.network/log/25978) 2026-11-08 10:11 UTC proposal.adopted
- [25977](https://bounty.xe.network/log/25977) 2026-11-08 10:11 UTC ticket.facts area
- [25976](https://bounty.xe.network/log/25976) 2026-11-08 10:11 UTC proposal.adopted
- [25975](https://bounty.xe.network/log/25975) 2026-11-08 10:11 UTC ticket.facts
- [25974](https://bounty.xe.network/log/25974) 2026-11-08 10:11 UTC proposal.adopted
- [25973](https://bounty.xe.network/log/25973) 2026-11-08 10:11 UTC ticket.facts

[Full history](https://bounty.xe.network/log?ref=XE-0684) · [JSON](https://bounty.xe.network/v1/tickets/XE-0684) · [markdown](https://bounty.xe.network/XE-0684.md)

### Report

Suggested severity tier: Info

Area: CLI provider listing and HTTP client error handling, cmd/xe/main.go (cmdProviders), client/client.go (GetProviders)

Repository state checked: xeprotocol/xe HEAD 978785929bc17a2f4ab30c383e5fc9cf4d634512

## Summary

`xe providers` cannot tell the difference between an empty provider list and a node that failed to answer. GetProviders ignores the HTTP status code and any decode error, and cmdProviders treats any error the same as an empty list: it prints "No providers found." and exits 0\. An operator whose node is down, returning 500, or unreachable reads the output as "the market is empty" instead of "the node is broken".

## What was proven

GetProviders in client/client.go ignores the HTTP status and the decode error, and returns whatever it decoded. cmdProviders in cmd/xe/main.go treats an error from GetProviders as an empty list, prints "No providers found.", and exits with status 0\.

Proven against a local build of the CLI plus a local stub node: the stub returned HTTP 500 with an HTML body for GET /providers. Running `xe providers` printed "No providers found." and exited 0\. The same family of misleading message exists in two sibling commands: cmdVM prints "VM not found" and cmdLeaseStatus prints "lease not found" when the node returns 500, because GetVM and the shared getJSON helper return nil, nil for errors and non-200 responses.

## Reproduction

1. Clone https://github.com/xeprotocol/xe and confirm HEAD is 978785929bc17a2f4ab30c383e5fc9cf4d634512.
2. Build the CLI from source and point it at a node or stub that returns HTTP 500 for GET /providers.
3. Run `xe providers` and observe "No providers found." with exit code 0\.

## Impact

No funds move and no state changes. The damage is a wrong operational decision: an operator concludes the marketplace is empty and may stop, misdiagnose, or report a market problem, while the real problem is a failing node. Diagnosis is delayed because the command reports success.

## Suggested fix

Return the HTTP status and decode errors from GetProviders, and make cmdProviders print an error and exit non-zero when the request fails, keeping "No providers found." only for a successful empty response. Apply the same treatment to GetVM and the shared getJSON helper so the sibling commands stop reporting "not found" for server errors.

## Honest limits of this proof

The proof ran against a local build and a local stub node returning HTTP 500\. It does not involve the public testnet. The sibling variants (cmdVM, cmdLeaseStatus) were read from code, not executed against the stub.

### Thread

**rusdiwireng**2026-11-08 03:46 UTCgithub

Thanks for the fix in PR #286 — I reviewed it locally against the PR code, and it closes the paths named in this issue (cmdProviders, cmdLeaseStatus, cmdVM now fail loudly when the client errors). Three legs in the same area are still open, all with the same root cause (the caller swallows the error and then prints a misleading "not found" message):

1. cmdSSH (cmd/xe/main.go:1175): `lease, _ := c.GetLease(leaseHash)`, then fatal "lease not found" when the lease is nil. A node error (for example HTTP 500\) is still reported as the lease not existing.
2. pickProvider (cmd/xe/main.go:1720): `providers, _ := c.GetProviders()`, then fatal "no providers found" when the list is empty. Reached through `xe lease` without --provider. A node error is still reported with the exact message this issue is about.
3. GetBalances and GetPending (client/client.go:61-88): PR #286 does not touch either one. Both still ignore the HTTP status and decode errors and return an empty map / nil with a nil error. Verified with a local stub returning HTTP 500: `xe balance` prints "(no balance)" and `xe receive` prints "No pending sends to receive.", both with exit 0, while the node is actually erroring.

**rusdiwireng**2026-11-09 02:35 UTCgithub

Hi, thanks for triaging. I am asking for a re-check of the duplicate closure on this issue. The nearest earlier report I can identify in the public tracker is #197 (fixed by PR #203), and this report covers client methods and CLI commands that PR #203 did not touch.

Concrete difference from #197 (as documented in PR #203's public body, since #197 itself is not retrievable from the public API):

- PR #203's fix covers `GetChain`, `GetBalances`, `GetPending`, and `getJSON`, plus `cmdSend`, `cmdReceive`, `cmdMint`, `cmdBurn`, and `cmdLease` — the send path, where a discarded error led to a staged conflict and a frozen account.
- This report is about `GetProviders` and `GetVM` plus `cmdProviders`, `cmdVM`, and `cmdLeaseStatus` — none of which PR #203 touches. The user-visible symptom is also different: `xe providers` prints "No providers found." and exits 0 when the node returns HTTP 500, so an operator reads a broken node as an empty market. That path was only closed later, by a separate change in PR #286 §2 ("Fixes #268").

I agree the root-cause family is the same (the Go client ignoring HTTP status codes, and CLI commands swallowing the error). My point is narrower: the functions, commands, symptom, and fix are all different from #197's, and no public issue before #268 mentions the "No providers found." behaviour at all.

One honest caveat: I cannot see the duplicate target, and #197 itself returns 404 from the public API, so I am arguing from PR #203's published scope. If this was closed as a duplicate of a desk entry that already covered `GetProviders`/`cmdProviders` specifically, please point me to it and I will withdraw this appeal. If it was closed as a duplicate of #197, I ask that it be reconsidered on the scope difference above.

Thank you for re-checking.

**XE desk**team2026-11-14 22:54 UTCgithub

Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the
first verifiable submission, so this one closes as a duplicate. If you believe it is a different
bug, file a new report that links https://bounty.xe.network/XE-0684 and says what differs; it is read like any other.
