Skip to content
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 issue names can be too long and make migrations fail (Postgres/MySQL) #28846

Closed
TristanWasTaken opened this issue Jan 18, 2024 · 4 comments · Fixed by #28902
Closed

GitHub issue names can be too long and make migrations fail (Postgres/MySQL) #28846

TristanWasTaken opened this issue Jan 18, 2024 · 4 comments · Fixed by #28902
Labels

Comments

@TristanWasTaken
Copy link

TristanWasTaken commented Jan 18, 2024

Description

I tried to migrate the repository https://github.com/tachiyomiorg/tachiyomi with all migration options
The migration always failed at one of the issues with one of these errors:

  • Postgres: pq: value too long for type character varying(255)
  • MySQL (MariaDB): Error 1406 (22001): Data too long for column 'name' at row 1

Logs from console:

postgres-test  | 2024-01-14 11:57:36.882 UTC [88] ERROR:  value too long for type character varying(255)
postgres-test  | 2024-01-14 11:57:36.882 UTC [88] STATEMENT:  INSERT INTO "issue" ("repo_id","index","poster_id","original_author","original_author_id","name","content","milestone_id","priority","is_closed","is_pull","num_comments","ref","pin_order","deadline_unix","created_unix","updated_unix","closed_unix","is_locked") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19) RETURNING "id"
gitea-test     | 2024/01/14 11:57:36 ...ices/task/migrate.go:61:func1() [E] runMigrateTask[1] by DoerID[1] to RepoID[1] for OwnerID[1] failed: pq: value too long for type character varying(255)
gitea-test     | 2024/01/14 11:57:36 ...ervices/task/task.go:53:handler() [E] Run task failed: pq: value too long for type character varying(255)

After changing the name field type from character varying(250) NULL to character varying(1200) NULL, the migration succeeded.

Here is a dump of the issue table with the query SELECT * FROM issue WHERE LENGTH(name) > 250;
https://gist.github.com/TristanWasTaken/7cb2c9b2a5c537822796ccb4fc25f513
Issues: tachiyomiorg/tachiyomi#3495, tachiyomiorg/tachiyomi#2337, tachiyomiorg/tachiyomi#4321, tachiyomiorg/tachiyomi#4379, tachiyomiorg/tachiyomi#3897, tachiyomiorg/tachiyomi#4898, tachiyomiorg/tachiyomi#4978, tachiyomiorg/tachiyomi#5066

The migration is still ongoing on the Gitea demo site: https://try.gitea.io/TristanWasTaken/tachiyomi
It'll take ~8h to do a full migration. Or at least that's how long it took on my instance.

Gitea Version

1.21.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

gitea_issue_mysql

Git Version

No response

Operating System

No response

How are you running Gitea?

docker gitea/gitea:1.21.3 image, with postgres and redis
Please note that I also tried with memory instead of redis, mysql (MariaDB) as database and pretty much every variation except sqlite

Database

PostgreSQL

@yp05327
Copy link
Contributor

yp05327 commented Jan 19, 2024

image
The max length in GitHub is 256 characters.

@TristanWasTaken
Copy link
Author

image The max length in GitHub is 256 characters.

tachiyomiorg/tachiyomi#5066 has 1004 characters

@yp05327
Copy link
Contributor

yp05327 commented Jan 23, 2024

Maybe GitHub changed it?

Copy link

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants