Skip to content

Let the Copernicus client say why a download failed - #18

Merged
chross22 merged 1 commit into
masterfrom
explain-out-of-range
Aug 7, 2026
Merged

Let the Copernicus client say why a download failed#18
chross22 merged 1 commit into
masterfrom
explain-out-of-range

Conversation

@chross22

@chross22 chross22 commented Aug 7, 2026

Copy link
Copy Markdown
Owner

The symptom

A 52-day fetch failed on 11 days with an error that had the cause removed from it:

Error: 11 of 52 day(s) could not be downloaded:
  2026-07-15: Copernicus download failed after 3 attempt(s).
  ...
Client output:

Client output: followed by nothing.

Two causes, one mine

The dates were outside the dataset. cmems_mod_glo_phy_my_0.083deg_P1D-m covers 1993-01-01 → 2026-06-23. Every failing date was past that: a reanalysis runs months behind the present.

The reason was suppressed. Downloads ran at --log-level QUIET, which silences the client's explanation along with its chatter. The client says this at ERROR, and now does:

Some of your subset selection [2026-07-15, 2026-07-15] for the time dimension
exceed the dataset coordinates [1993-01-01, 2026-06-23]

Normal runs stay quiet — ERROR suppresses the INFO lines that made QUIET attractive.

Plus an explanation, not just a report

Out-of-range dates are the common cause, will fail on every retry, and the remedy is not obvious from a date range. When the client reports that, the error now adds:

Some dates are outside what this dataset covers. A reanalysis (_my_ in the dataset id) runs behind the present by months, so recent dates are not in it yet. Use mode = "forecast" for dates near or slightly ahead of today; note that the forecast reaches about ten days ahead, so dates beyond that are in no product.

Verification

Reproduced against the live API before and after — the same fetch now names the cutoff and the remedy.

  • 2 regression tests: the default log level is ERROR and never QUIET; the hint fires when the client reports exceeded coordinates.
  • R CMD checkStatus: OK. Full suite green. Installed into both R 4.6.1 and 4.3.2.

🤖 Generated with Claude Code

Downloads ran the client at --log-level QUIET, which suppresses its
explanation along with its chatter. A date past the end of a reanalysis
then exits non-zero with no output at all, so the error reported
"Client output:" followed by nothing - a failure with the cause removed
from it.

The client says this at ERROR level, and now does:

  Some of your subset selection [2026-07-15, 2026-07-15] for the time
  dimension exceed the dataset coordinates [1993-01-01, 2026-06-23]

Normal runs stay quiet, since ERROR suppresses the INFO lines that made
QUIET attractive in the first place.

Out-of-range dates also now get an explanation rather than only a
report. It is the common cause, it will fail on every retry, and the
remedy is not obvious from a date range: the reanalysis runs months
behind the present, the forecast covers dates near today, and dates more
than about ten days ahead are in no product at all.

Found from a real 52-day fetch where 11 days failed silently, all of
them past the reanalysis cutoff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@chross22
chross22 merged commit 1559165 into master Aug 7, 2026
5 checks passed
@chross22
chross22 deleted the explain-out-of-range branch August 7, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant