Mintplex-Labs/anything-llm · error
[Gitea Loader]: Unauthorized request for ${endpoint}. Skippi
Error message
[Gitea Loader]: Unauthorized request for ${endpoint}. Skipping. What it means
fetchJson received 401 or 403 from the Gitea API, so the loader logs this and returns null for that endpoint — the affected items (branches, file pages) are silently omitted from the collected workspace. 401 means the token is missing/bad; 403 means the token is valid but its owner cannot read the repository.
Source
Thrown at collector/utils/extensions/RepoLoader/GiteaRepo/RepoLoader/index.js:388
return null;
}
const retryAfter = Number(response.headers.get("retry-after")) || 60;
console.warn(
`[Gitea Loader]: Rate limit hit for ${endpoint}. Waiting ${retryAfter}s before retrying...`
);
await this.#wait(retryAfter * 1000);
return this.fetchJson(endpoint, retries + 1);
}
if (response.status === 401 || response.status === 403) {
console.warn(
`[Gitea Loader]: Unauthorized request for ${endpoint}. Skipping.`
);
return null;
}
if (!response.ok) {
console.warn(
`[Gitea Loader]: Unexpected status ${response.status} for ${endpoint}. Skipping.`
);
return null;
}
return await response.json();
} catch (e) {
console.error(`GiteaRepoLoader.fetchJson`, e);
return null;
}
}
}
module.exports = GiteaRepoLoader;
View on GitHub (pinned to 3aec848f28)
Solutions
- Regenerate the Gitea personal access token and re-enter it in the data connector settings.
- Confirm the token's scopes include read access to the target repository.
- Verify the token owner can open the repo in a browser while logged in.
- Check the token was pasted without quotes, spaces, or newlines.
Defensive patterns
Strategy: validation
Validate before calling
// Preflight the token before starting a Gitea sync:
const resp = await fetch(`${giteaBase}/api/v1/user`, {
headers: { Authorization: `token ${accessToken}` },
});
if (resp.status === 401 || resp.status === 403) {
throw new Error(`Gitea token rejected (${resp.status}) — fix credentials before syncing`);
} Try / catch
const result = await loader.fetchJson(endpoint);
if (result === null) console.warn(`endpoint ${endpoint} skipped — check token/permissions`); Prevention
- Validate the access token against /api/v1/user before launching the loader.
- Store tokens in a trimmed state (strip whitespace/newlines) when saving connector config.
- Rotate tokens on a calendar and update the connector immediately.
- Prefer machine accounts that own the repos they read.
When it happens
Trigger: Expired or revoked Gitea access token; token without read scope on the target repo; repo made private or transferred away from the token owner; token pasted with whitespace/typos; loading a private repo anonymously.
Common situations: Tokens rotated on a policy but not updated in the data connector; organization repos where the token user is not a member; SSO-enforced Gitea rejecting plain PATs.
Understand the failure class
- Authentication and authorization failures — expired tokens, bad credentials, and missing scopes.
Related errors
- [Gitlab Loader]: Unauthorized request for ${endpoint}. Skipp
- [Gitea Loader]: Rate limit hit for ${endpoint}. Waiting ${re
- Unauthorized
- Unauthorized
- Personalization is disabled.
AI-assisted analysis of Mintplex-Labs/anything-llm@3aec848f28 (2026-08-18).
Data as JSON: /api/errors/d7394a5556522f3a.
Report an issue: GitHub.