nodejs/node · error · Exception

Retried too often. Giving up. Reason: %s

Error message

Retried too often. Giving up. Reason: %s

What it means

Retry repeatedly calls cb, sleeping per the wait_plan backoff schedule, until either cb succeeds (and retry_on(result) is False) or wait_plan is exhausted. When the plan runs out while still failing/retrying, Retry raises a generic Exception whose message embeds the last failure as the Reason.

Source

Thrown at deps/v8/tools/release/common_includes.py:379

                True if the function should be retried. A function throwing an
                exception is always retried.
      wait_plan: A list of waiting delays between retries in seconds. The
                 maximum number of retries is len(wait_plan).
    """
    retry_on = retry_on or (lambda x: False)
    wait_plan = list(wait_plan or [])
    wait_plan.reverse()
    while True:
      got_exception = False
      try:
        result = cb()
      except NoRetryException as e:
        raise e
      except Exception as e:
        got_exception = e
      if got_exception or retry_on(result):
        if not wait_plan:  # pragma: no cover
          raise Exception("Retried too often. Giving up. Reason: %s" %
                          str(got_exception))
        wait_time = wait_plan.pop()
        print("Waiting for %f seconds." % wait_time)
        self._side_effect_handler.Sleep(wait_time)
        print("Retrying...")
      else:
        return result

  def ReadLine(self, default=None):
    # Don't prompt in forced mode.
    if self._options.force_readline_defaults and default is not None:
      print("%s (forced)" % default)
      return default
    else:
      return self._side_effect_handler.ReadLine()

  def Command(self, name, args, cwd=None):
    cmd = lambda: self._side_effect_handler.Command(

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Read str(got_exception) in the message — that is the real underlying failure to fix.
  2. Address the root cause (network, auth, remote availability).
  3. If the failure is genuinely transient, pass a longer wait_plan.
  4. For non-retryable failures, raise NoRetryException from cb to abort immediately instead of exhausting the plan.

Example fix

// before
self.Retry(cb, retry_on=lambda r: not r, [5])
// after (fail fast on permanent errors)
def safe_cb():
    try: return cb()
    except PermanentError as e: raise NoRetryException(e)
self.Retry(safe_cb, retry_on=lambda r: not r, [5, 30])
Defensive patterns

Strategy: try-catch

Try / catch

try:
    result = self.Retry(cb, retry_on, wait_plan)
except Exception as e:
    # The message embeds the last failure; surface it, don't mask it.
    log.error('Retry exhausted: %s', e)
    raise

Prevention

When it happens

Trigger: A transient operation (git, HTTP fetch, etc.) keeps failing across every slot in wait_plan.

Common situations: Network down for the whole retry window; git remote unreachable; trybot/buildbucket query consistently erroring; flaky endpoint that doesn't recover in time.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/7a5fff2f86007035. Report an issue: GitHub.