Remove ratelimits for migrating repositories #896
Labels
No labels
accessibility
bug
bug
infrastructure
Codeberg
contributions welcome
docs
duplicate
enhancement
infrastructure
legal
licence / ToS
please chill
we are volunteers
public relations
question
question
user support
s/Forgejo
s/Forgejo/migration
s/Pages
s/Weblate
s/Woodpecker
security
service
upstream
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Codeberg/Community#896
Loading…
Add table
Add a link
Reference in a new issue
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?
forgejo/forgejo#248 (comment)
I think you can use Forgejo's
dump-repocommand to export archives of the units individually. I have not tested if importing them individually works, however.So, I got it working, but you cannot just import each archive individually. The
dump-repocommand unfortunately always clones the git repository, which is by far the easiest thing to do externally, so perhaps the command could be adapted to skip that step. Other than that, after exporting the individual units, you have import archives that are good for a fresh repo with each individual unit. Merging these archives is pretty easy, you just need to combine all the respective yaml files from the dumps and adjust the repo.yml file to reflect which units are present in the dump. I also needed to specifically use the git dump from the pull requests archive, it seems the clone from the issues archive didn't contain the refs for the pull request for some reason.You can see what the repository looks like when it's all reassembled and imported here: https://forgejo.crystal.vg:3000/crystal/test-import
This done by using the method described above to export my test-forgejo-dump-repo repository here.
Rate limits should not apply on our side for incoming migrations, but happen per instance from external providers (e.g. GitHub applies rate-limiting for our IP, because many push / pull / migration / API access etc happens on our side).
I'll have a look if I can see why it fails.
@thatonecalculator I don't see any error messages that are related to this migration. Can you please share the exact timestamp if available, maybe for the next migration?
Ah sorrry, I think I only now understand your issue. You want to migrate the data out of Codeberg, right?
Hmm, from a computing perspective it's obvious that in the term of load issues, there is no way to guarantee that migrations to elsewhere are performant. But please retry now, the performance should be much better now.
Regarding rate limits, there is a limit indeed. Any software consuming it should just wait and retry, this should also be true for Forgejo (and I think it does, at least they seem to do for GitHub / GitLab).
If the issue persists, please let me know and we'll work something out.
Still persists, just tried again ~10 minutes ago.
it would be helpful to receive an exact log that indicates how rate limiting kicks in. Or if rate limiting kicks in at all or if there is a different kind of issue.
Please see forgejo/forgejo#398 - the migration is ongoing, but the number of API calls is just insane.
This migration is currently causing 54.5% of all requests to Codeberg. The idea of rate limiting is obviously to prevent a single actor from creating so much load. I'm very sorry that you run into this, but I hope we can work something out in order to allow letting you move out more seamless.
Thank you for your patience.
@Gusted @crystal Does anyone of you recall by chance if (and how) it was possible to dump repo archives via some admin command? I think I read about this. It's obviously not suited for day-to-day use as it doesn't allow self-service, but it could be an option to help this project move, given that they know the operator of their target instance.
Sorry for the ping, I just read it was mentioned before 🙈. If the migration doesn't complete next time I'm online, I'll try to dig through the docs.
gitea dump-repowould be the command, but I'm pretty sure that still uses the api...Yes, as mentioned in my previous comment on this issue, it is possible to individually export each unit from a repo using the API with the
dump-repocommand, but the git repository will be cloned each time. It is also possible to reassemble the various dumps into a single dump that can be imported, but it requires a lot of delicate effort.EDIT: If the
dump-repocommand targeted the API on localhost from the container running Forgejo, perhaps it could bypass the rate limits and allow the entire repository to be exported by Codeberg administrators for this project. The rate limit is imposed by HAProxy, right?The current running migration (10 hours + or something like this) is also bypassing the API rate limits and working locally (cross-LXC-container). It doesn't make a difference, then. Unfortunate.
@thatonecalculator Overnight, the migration has hung our staging instance 😞. My ideas how to workaround prior to optimizing migrations in the software are exhausted now. We can try the dump-repo thing, but if it just uses the API, chances aren't really high it helps ...
Since I really only need open issues, I wonder if there would be a way to do a migration with just the 300 or so open ones instead of the 5000+ closed ones...
I fear this is out of scope for Codeberg, but in theory you could provide a patch for either a migration code or the dump-repo part which filters this (could be easy). It would be no big deal to deploy the custom binary to our staging instance to do the migration to there.
Otherwise, my main problem is that the dump-repo command does not display any output. It's running, but hard to know what it does. Can the verbosity be toggled? I had no luck yet.
The migration failed in the end for some availability issues it seems (could have been an update):
Any update at all?
Cross-linking: forgejo/forgejo#398