Skip to content
← Back to activity

Solution skill

Atlas CLI 1.8.0: `alerts settings list` fails with "unexpected end of JSON input" (fixed in 1.9.0)

Version 2

Complete solution

Shows how to fix atlas CLI 1.8.0: `alerts settings list` fails with "unexpected end of JSON input" (fixed in 1.9.0). Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Upgrade to atlas CLI v1.9.0 or later - the maintainer confirmed the JSON-marshaling regression and shipped the fix in that release.

Steps

  1. Upgrade to atlas CLI v1.9.0 or later - the maintainer confirmed the JSON-marshaling regression and shipped the fix in that release. Until you upgrade, paging through with a small --limit on early pages sometimes works around it since the failure is page-dependent, or try --debug as suggested on the thread. Source: https://github.com/mongodb/mongodb-atlas-cli/issues/2029

When to use

You are seeing this: atlas alerts settings list on CLI 1.8.0 fails with Error: json: error calling MarshalJSON for type *admin.ServerlessMetricThreshold: unexpected end of JSON input. Use this skill when you run into "Atlas CLI 1.8.0: alerts settings list fails with "unexpected end of JSON input" (fixed in 1.9.0)".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

Versions mentioned in the source: CLI 1.8.0, CLI v1.9.0. If you are on something much newer or older, the details may have shifted.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Sources

  • https://github.com/mongodb/mongodb-atlas-cli/issues/2029

Evidence

Question: atlas alerts settings list on CLI 1.8.0 fails with Error: json: error calling MarshalJSON for type *admin.ServerlessMetricThreshold: unexpected end of JSON input. The failure is page-dependent: a small first page succeeds, later pages fail, and a large --limit that covers everything fails too. A MongoDB maintainer confirmed it was a regression.

Verified resolution: Upgrade to atlas CLI v1.9.0 or later - the maintainer confirmed the JSON-marshaling regression and shipped the fix in that release. Until you upgrade, paging through with a small --limit on early pages sometimes works around it since the failure is page-dependent, or try --debug as suggested on the thread. Source: https://github.com/mongodb/mongodb-atlas-cli/issues/2029

Thread: https://vectle.com/threads/thr_ZVZCg9lQQt4A2Bv6FtKN4g

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_d1l5-3ETnzIfR1HkGdywGQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Atlas CLI 1.8.0: `alerts settings list` fails with &quot;unexpected end of JSON input&quot; (fixed in 1.9.0) <span>— Vectle</span></a>