Codeberg/Community
54
325
Fork
You've already forked Community
12

HTTP 429 for Luanti ContentDB polling repositories #2113

Closed
opened 2025年08月29日 11:34:48 +02:00 by rubenwardy · 7 comments

Comment

Hi, I'm the developer of ContentDB, a website for games, mods, and textures for Luanti. We hung out with Codeberg at FOSDEM.

ContentDB has a feature where it checks for new commits or tags on upstream repositories once per day, using git ls-remote. ContentDB does also support GitHub/GitLab compatible webhooks, this polling feature exists as a platform-independent way to automatically make new releases on ContentDB. ContentDB has 350 packages with codeberg repositories.

From reading the platform infrastructure file, it looks like the rate limit is 250 per 30 minutes.

I have given codeberg a dedicated task queue with a limit of 400/h. Celery task ratelimits work by dividing the time by the number of requests and using that as a minimum time between tasks. So for the 4 workers, each will wait 60*60/100=36 seconds between checking codeberg updates.

ContentDB is still hitting the ratelimit. I'd appreciate your guidance on this. Is 250/30mins correct? Is git ls-remote resulting in multiple git ops? Does every call require an auth op?

### Comment Hi, I'm the developer of [ContentDB](https://content.luanti.org), a website for games, mods, and textures for [Luanti](https://www.luanti.org). We hung out with Codeberg at FOSDEM. ContentDB has a [feature](https://content.luanti.org/help/update_config/) where it checks for new commits or tags on upstream repositories once per day, using `git ls-remote`. ContentDB does also support GitHub/GitLab compatible webhooks, this polling feature exists as a platform-independent way to automatically make new releases on ContentDB. ContentDB has 350 packages with codeberg repositories. From reading the [platform infrastructure](https://codeberg.org/Codeberg-Infrastructure/scripted-configuration/src/commit/c3d59d41f87d6a5e833f9d1bb14e06e2d988ccbc/hosts/_reverseproxy/etc/caddy/forgejo-prod.site#L55-L80) file, it looks like the rate limit is 250 per 30 minutes. I have given codeberg a dedicated task queue with a limit of 400/h. Celery task ratelimits work by dividing the time by the number of requests and using that as a minimum time between tasks. So for the 4 workers, each will wait `60*60/100=36` seconds between checking codeberg updates. ContentDB is still hitting the ratelimit. I'd appreciate your guidance on this. Is 250/30mins correct? Is `git ls-remote` resulting in multiple git ops? Does every call require an `auth` op?
Owner
Copy link

Hi! Sorry for this issue. We recently modified the rate-limiting on August 22 after Codeberg was heavily cloned from by some unknown actor, but the commit wasn't yet pushed to the public (now it is). It has also been adjusted from time to time after that.

The current config is about 150/30 mins. I think that some Git operations do multiple requests (around 2 or 3 IIRC).

Authentication currently does not matter.

Would this work for you (going down to about 50 updates per 30 min)? We're also slowly adjusting the limits (mostly into relaxing it) and appreciate your feedback. If your IP address is static and can be public, we can also put you on the allowlist if you prefer. It's not an issue and you would not need to do further adjustments.

Hi! Sorry for this issue. We recently [modified the rate-limiting on August 22](https://social.anoxinon.de/@Codeberg/115074265437710727) after Codeberg was heavily cloned from by some unknown actor, but the commit wasn't yet pushed to the public ([now it is](https://codeberg.org/Codeberg-Infrastructure/scripted-configuration/commit/3a49625f3440e9895f565f755a3008cced0f43a1)). It has also been adjusted from time to time after that. The current config is about 150/30 mins. I think that some Git operations do multiple requests (around 2 or 3 IIRC). Authentication currently does not matter. Would this work for you (going down to about 50 updates per 30 min)? We're also slowly adjusting the limits (mostly into relaxing it) and appreciate your feedback. If your IP address is static and can be public, we can also put you on the allowlist if you prefer. It's not an issue and you would not need to do further adjustments.

Okay, it looks like setting the limit to 100/h fixes the issue. It takes about 3.5 hours to check the 350 repos. It's not a hugely time sensitive operation as long as it's done once per day, but does put a limit of 2,000 codeberg repos.

One problem is that other tasks are currently being blocked whilst the codeberg checks are running, I'll need to work out if it is possible to get other tasks to run in between codeberg checks. Perhaps if there's a way to assign priorities so user-visible tasks run first. But this is very much a me problem, even if the codeberg limit was higher it would still be an issue (just less obvious)

Okay, it looks like setting the limit to 100/h fixes the issue. It takes about 3.5 hours to check the 350 repos. It's not a hugely time sensitive operation as long as it's done once per day, but does put a limit of 2,000 codeberg repos. One problem is that other tasks are currently being blocked whilst the codeberg checks are running, I'll need to work out if it is possible to get other tasks to run in between codeberg checks. Perhaps if there's a way to assign priorities so user-visible tasks run first. But this is very much a me problem, even if the codeberg limit was higher it would still be an issue (just less obvious)
Owner
Copy link

The allowlist of IP addresses is public at https://codeberg.org/Codeberg-Infrastructure/scripted-configuration/src/branch/main/hosts/_reverseproxy/srv/ceph/data/production/caddy/allowed.acl. I'll repeat my offer to add you to that list.

Given the current status of the web, being generous about the allowlist seems like a better strategy then being more generous about default limits. It's sad, but feels like the better procedure going forward.

The allowlist of IP addresses is public at https://codeberg.org/Codeberg-Infrastructure/scripted-configuration/src/branch/main/hosts/_reverseproxy/srv/ceph/data/production/caddy/allowed.acl. I'll repeat my offer to add you to that list. Given the current status of the web, being generous about the allowlist seems like a better strategy then being more generous about default limits. It's sad, but feels like the better procedure going forward.

Okay well that would allow ContentDB to run a bit more efficiently so I would gladly accept that. The fixed ip addresses are:

194.36.147.174
2a03:4000:4d:b58:58ba:a4ff:fe58:ede
144.91.102.58
2a02:c207:2245:7375::1
Okay well that would allow ContentDB to run a bit more efficiently so I would gladly accept that. The fixed ip addresses are: ``` 194.36.147.174 2a03:4000:4d:b58:58ba:a4ff:fe58:ede 144.91.102.58 2a02:c207:2245:7375::1 ```
Owner
Copy link

It should be live now. Could you check?

It should be live now. Could you check?
Member
Copy link

I now got yet another 429 for the (low-level) agent for Crow CI running only renovate (this is another agent than the one in Codeberg-Infrastructure/scripted-configuration#84).

While I also triggered some manual builds outside of the regular hourly interval, I think the current rate limit is too aggressive for "average" development.

I now got yet another 429 for the (low-level) agent for Crow CI running *only* `renovate` (this is another agent than the one in https://codeberg.org/Codeberg-Infrastructure/scripted-configuration/pulls/84). While I also triggered some manual builds outside of the regular hourly interval, I think the current rate limit is too aggressive for "average" development.

@fnetX wrote in #2113 (comment):

It should be live now. Could you check?

All appears to be working correctly, thank you

@fnetX wrote in https://codeberg.org/Codeberg/Community/issues/2113#issuecomment-6890533: > It should be live now. Could you check? All appears to be working correctly, thank you
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
accessibility

Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug

Something is not working the way it should. Does not concern outages.
bug
infrastructure

Errors evidently caused by infrastructure malfunctions or outages
Codeberg

This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome

Please join the discussion and consider contributing a PR!
docs

No bug, but an improvement to the docs or UI description will help
duplicate

This issue or pull request already exists
enhancement

New feature
infrastructure

Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal

An issue directly involving legal compliance
licence / ToS

involving questions about the ToS, especially licencing compliance
please chill
we are volunteers

Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations

Things related to Codeberg's external communication
question

More information is needed
question
user support

This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo

Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration

Migration related issues in Forgejo
s/Pages

Issues related to the Codeberg Pages feature
s/Weblate

Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker

Woodpecker CI related issue
security

involves improvements to the sites security
service

Add a new service to the Codeberg ecosystem (instead of implementing into Gitea)
upstream

An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Gitea, Forgejo, etc.)
wontfix

Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#2113
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?