Mintplex-Labs/anything-llm · warning

[Gitlab Loader]: Rate limit hit fetching ${sourceFilePath}.

Error message

[Gitlab Loader]: Rate limit hit fetching ${sourceFilePath}. Waiting ${retryAfter}s...

What it means

Transient warning from fetchSingleFileContents: GitLab answered 429 for one raw-file request. The loader reads Retry-After (default 60s), waits, and retries with an incremented retry counter; this is normal back-off, not a failure by itself.

Source

Thrown at collector/utils/extensions/RepoLoader/GitlabRepo/RepoLoader/index.js:352

      const url = `${this.apiBase}/api/v4/projects/${
        this.projectId
      }/repository/files/${encodeURIComponent(sourceFilePath)}/raw?ref=${
        this.branch
      }`;
      const response = await fetch(url, {
        method: "GET",
        headers: this.accessToken ? { "PRIVATE-TOKEN": this.accessToken } : {},
      });

      if (response.status === 429) {
        if (retries >= MAX_RETRIES) {
          console.warn(
            `[Gitlab Loader]: Rate limit persists for ${sourceFilePath} after ${retries} retries. Skipping.`
          );
          return null;
        }
        const retryAfter = Number(response.headers.get("retry-after")) || 60;
        console.warn(
          `[Gitlab Loader]: Rate limit hit fetching ${sourceFilePath}. Waiting ${retryAfter}s...`
        );
        await this.#wait(retryAfter * 1000);
        return this.fetchSingleFileContents(sourceFilePath, retries + 1);
      }

      if (!response.ok)
        throw new Error(`Failed to fetch single file ${sourceFilePath}`);

      return await response.text();
    } catch (e) {
      console.error(`RepoLoader.fetchSingleFileContents`, e);
      return null;
    }
  }

  /**
   * Fetches the next page of data from the API.

View on GitHub (pinned to 3aec848f28)

Solutions

  1. No action needed for an occasional occurrence — the built-in retry recovers.
  2. Frequent occurrences: reduce files per run via path filters or schedule syncs further apart.
  3. Move to a token/host with a higher quota if the pattern repeats.
Defensive patterns

Strategy: retry

Prevention

When it happens

Trigger: A burst of raw file fetches tripping GitLab's rate limit mid-sync; shared quota exhausted by other clients using the same token or IP.

Common situations: Large repo syncs on GitLab.com free tiers; automated pipelines running collectors back-to-back.

Related errors


AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18). Data as JSON: /api/errors/cb7a57c5afd7bc4b. Report an issue: GitHub.