gitea: Migration stuck for some repos
- Gitea version (or commit ref): 1.11.0+dev-155-gdce22efbe
- Git version: whatever runs on try.gitea.io
- Operating system: whatever runs on try.gitea.io
- Database (use
[x]): whatever runs on try.gitea.io- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (provide example URL) : https://try.gitea.io/pcsv/Pix-Art-Messenger
- No
- Not relevant
- Log gist:
Description
Trying to migrate https://github.com/kriztan/Pix-Art-Messenger with issues, wiki, pull requests and releases to Gitea, the migration is stuck, and the repo inaccessible.
No Settings tab either, so it is impossible to cancel the migration or delete the broken repo.
Screenshots

About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 40 (32 by maintainers)
I think we can add a
cancelbutton here.I started to debug this a bit and ran out of time but if it is helpful for you @lunny what is happening is that at some point inserting a batch of releases from this repo is throwing the error:
And then it goes into rollback but never comes out. It seems to get here:
https://github.com/go-gitea/gitea/blob/45f219239e420f707a2452b99b27a68f45d5d4ca/vendor/xorm.io/xorm/session_delete.go#L211
And then the it hits this code and seems to never really do anything after that:
https://github.com/go-gitea/gitea/blob/45f219239e420f707a2452b99b27a68f45d5d4ca/vendor/xorm.io/xorm/session_raw.go#L177-L179
That runs some code in the specific driver for the database, but I’m able to reproduce on sqlite3 and assume try.gitea.io and codeberg are using something else so I wonder if it just isn’t returning an error where it should at some point. Not familiar with xorm at all though 😕
I tried with lafriks patch too but seems unrelated in this case (though helpful in general)
Imho problem is that if Gitea is restarted while migration is running it will be left unfinished
@6543 No it does not work when migration with issues and pr, please read the original issue description:
EDIT: This also has nothing to do with space restrictions, happens on all gitea instances, always. I think above repository is perfect for testing and fixing the problem.
Maybe it was not wise to create a 2-in-1 issue, actually these should be two:
@lunny Sure, but that does not fix the underlying problem. The migrations fails somehow, always, reproducible with the repo mentioned above https://github.com/kriztan/Pix-Art-Messenger
ok since Pix-Art-Messenger can be migrated (tested) I think it’s time to close this issue
@1byte2bytes if gitea v1.12.5 has ben released and it still does not work, feel free to create an issue 😃 and for cancel suggestions: (#12845)
Currently Gitea is version
1.12.4heading towards1.13.I encounter the issue of migration getting stuck while trying to mirror https://github.com/apache/spamassassin to my Gitea instance, using Gitea 1.14.8 on Debian 10. Restarting the Gitea server did not fix the importing for me.
There is no link to that settings page if it is stuck migrating (though visiting the URL directly works). So it is good but could be better.
I think the general bug still exists that it shouldn’t be possible for it to get stuck at all (it should work or fail), but now this example will not trigger it so perhaps harder to reproduce. @lunny maybe if you have time to look at the xorm code from above, if not then I’m not sure : ) Glad that this example helped fix the bug causing it anyway so thanks!
Yes, it is specifically the releases that are causing the initial migration of this particular repo to fail and then there is a separate (and much worse) problem of the rollback not finishing properly after the migration fails.
@ashimokawa I will try that repository.