-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github migration fails with error 500 when issue comment is too long #7905
Comments
Comment content have ~64KB size. Isn't it enough for almost all the situation? |
@lunny |
I agree. The 64K limit sounds reasonable. But whatever the limit, we should check the available size before inserting. A post-migration list of warnings explaining what compromises had to be made during migration would be ideal, so the admin will be aware of the problems and can take corrective/compensatory actions. |
Besides a warning in the log, We can maybe reserve a little space to insert a line like |
I'm pretty sure Github comment restriction is the same 65536 characters as a TEXT column, so it shouldn't be possible to fill it up when migrating. Perhaps some other bug is happening in this case and this is missing the bigger picture. I tried to migrate the example repo to see what comment might have been causing it but the migration was successful and I wasn't able to reproduce (on sqlite3). |
Perhaps this could be relevant:
I believe blob types (e.g. TEXT) are stored in a separate location and don't add up to row size. Also, character encoding could be set to an improper value and increase the size of the encoded values (e.g. UCS-2). |
OK, I think found out why this does not fail hard on try.gitea.io but on my test instance. Nevertheless, comment size is bigger on github, so we should somehow handle this. I added a quick hack to slice the string in go, and it worked. But doing this properly on a Rune boundary is the way to I assume. |
We need a PR to check comment size before insert it to database. |
@lunny |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Prevents invalid UTF-8 encoding for Description and Website. Refs go-gitea#7905
* Trim to 255 runes instead of bytes Prevents invalid UTF-8 encoding for Description and Website. Refs #7905 * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Trim to 255 runes instead of bytes Prevents invalid UTF-8 encoding for Description and Website. Refs #7905 * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Trim to 255 runes instead of bytes Prevents invalid UTF-8 encoding for Description and Website. Refs go-gitea#7905 * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
The issue comment problem has been fixed in 1.16 |
[x]
):Description
Trying to migrate https://github.com/Freeyourgadget/Gadgetbridge to codeberg-test.org running gitea master yields error 500 with the following in log:
2019/08/18 11:50:58 routers/repo/repo.go:320:MigratePost() [E] MigratePost: Error 1406: Data too long for column 'content' at row 1
The text was updated successfully, but these errors were encountered: