[BUG] wrong migration in v1.17.3 #9861

Closed
opened 2025-11-02 08:51:38 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @wolflu05 on GitHub (Nov 20, 2022).

Description

after upgrading from v1.16.7 to v1.17.3 Gitea logs these warnings.

gitea    | 2022/11/20 16:29:55 routers/init.go:135:GlobalInitInstalled() [W] Table push_mirror has column sync_on_commit but struct has not related field
gitea    | 2022/11/20 16:29:56 routers/init.go:135:GlobalInitInstalled() [W] Table gpg_key column content db type is TEXT(65535), struct type is MEDIUMTEXT
gitea    | 2022/11/20 16:29:56 routers/init.go:135:GlobalInitInstalled() [W] Table public_key column content db type is TEXT(65535), struct type is MEDIUMTEXT

These fields are added through a wrongly back ported migration, see migrations.go .

Discussion started on discord

Gitea Version

v1.17.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

docker via gitea/gitea:1.17.3

Database

MySQL

Originally created by @wolflu05 on GitHub (Nov 20, 2022). ### Description after upgrading from v1.16.7 to v1.17.3 Gitea logs these warnings. ``` gitea | 2022/11/20 16:29:55 routers/init.go:135:GlobalInitInstalled() [W] Table push_mirror has column sync_on_commit but struct has not related field gitea | 2022/11/20 16:29:56 routers/init.go:135:GlobalInitInstalled() [W] Table gpg_key column content db type is TEXT(65535), struct type is MEDIUMTEXT gitea | 2022/11/20 16:29:56 routers/init.go:135:GlobalInitInstalled() [W] Table public_key column content db type is TEXT(65535), struct type is MEDIUMTEXT ``` These fields are added through a wrongly back ported migration, see [migrations.go](https://github.com/go-gitea/gitea/blob/f48fda8eefa4d47e335f01ac92366b9373950e0e/models/migrations/migrations.go#L400) . Discussion started on [discord](https://discord.com/channels/322538954119184384/322538954119184384/1043926537356976188) ### Gitea Version v1.17.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? docker via `gitea/gitea:1.17.3` ### Database MySQL
GiteaMirror added the type/miscellaneous label 2025-11-02 08:51:38 -06:00
Author
Owner

@zeripath commented on GitHub (Nov 20, 2022):

I'm not sure they're wrong exactly - the empty values shouldn't cause any problem as far as I can see.

Potentially we should backport a "fix" that adds the empty fields to the schemas.

@zeripath commented on GitHub (Nov 20, 2022): I'm not sure they're wrong exactly - the empty values shouldn't cause any problem as far as I can see. Potentially we should backport a "fix" that adds the empty fields to the schemas.
Author
Owner

@lunny commented on GitHub (Nov 21, 2022):

Maybe it's a bug of xorm's detection?

@lunny commented on GitHub (Nov 21, 2022): Maybe it's a bug of xorm's detection?
Author
Owner

@zeripath commented on GitHub (Nov 21, 2022):

Xorm is right to moan here the structs aren't matching what the migration has done, we should probably update the structs to match the migration

@zeripath commented on GitHub (Nov 21, 2022): Xorm is right to moan here the structs aren't matching what the migration has done, we should probably update the structs to match the migration
Author
Owner

@4oo4 commented on GitHub (Dec 1, 2022):

I'm getting the same warning messages and found that this is also preventing me from adding any commits in the web editor because I have CRUD_ACTIONS set to always sign, which is probably to be expected.

[repository.signing]
SIGNING_KEY = XXXXXXXXXXXXXXX
SIGNING_NAME = Some Key Name
SIGNING_EMAIL = user@example.com
INITIAL_COMMIT = pubkey
CRUD_ACTIONS = always

gitea.log:

2022/11/30 19:31:26 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [638803ee] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git429096436) Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
	
2022/11/30 19:31:26 .../api/v1/repo/file.go:601:handleCreateOrUpdateFileError() [E] [638803ee] UpdateFile: Unable to commit-tree in temporary repo: user/repo Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
	
2022/11/30 19:31:39 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [638803fb-2] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git4244920609) Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
	
2022/11/30 19:31:39 .../api/v1/repo/file.go:601:handleCreateOrUpdateFileError() [E] [638803fb-2] UpdateFile: Unable to commit-tree in temporary repo: user/repo Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
	
2022/11/30 20:02:11 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [63880b23] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git3654155080) Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
@4oo4 commented on GitHub (Dec 1, 2022): I'm getting the same warning messages and found that this is also preventing me from adding any commits in the web editor because I have `CRUD_ACTIONS` set to always sign, which is probably to be expected. ``` [repository.signing] SIGNING_KEY = XXXXXXXXXXXXXXX SIGNING_NAME = Some Key Name SIGNING_EMAIL = user@example.com INITIAL_COMMIT = pubkey CRUD_ACTIONS = always ``` gitea.log: ``` 2022/11/30 19:31:26 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [638803ee] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git429096436) Error: exit status 1 Stdout: Stderr: error: gpg failed to sign the data 2022/11/30 19:31:26 .../api/v1/repo/file.go:601:handleCreateOrUpdateFileError() [E] [638803ee] UpdateFile: Unable to commit-tree in temporary repo: user/repo Error: exit status 1 Stdout: Stderr: error: gpg failed to sign the data 2022/11/30 19:31:39 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [638803fb-2] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git4244920609) Error: exit status 1 Stdout: Stderr: error: gpg failed to sign the data 2022/11/30 19:31:39 .../api/v1/repo/file.go:601:handleCreateOrUpdateFileError() [E] [638803fb-2] UpdateFile: Unable to commit-tree in temporary repo: user/repo Error: exit status 1 Stdout: Stderr: error: gpg failed to sign the data 2022/11/30 20:02:11 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [63880b23] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git3654155080) Error: exit status 1 Stdout: Stderr: error: gpg failed to sign the data ```
Author
Owner

@lunny commented on GitHub (Dec 12, 2022):

sync_on_commit was added in v1.18 and never in v1.17, so I think maybe you ever downgrade from 1.18, so there is a [W] Table push_mirror has column sync_on_commit but struct has not related field there.

@lunny commented on GitHub (Dec 12, 2022): `sync_on_commit` was added in v1.18 and never in v1.17, so I think maybe you ever downgrade from 1.18, so there is a `[W] Table push_mirror has column sync_on_commit but struct has not related field` there.
Author
Owner

@lunny commented on GitHub (Dec 12, 2022):

I'm getting the same warning messages and found that this is also preventing me from adding any commits in the web editor because I have CRUD_ACTIONS set to always sign, which is probably to be expected.

[repository.signing]
SIGNING_KEY = XXXXXXXXXXXXXXX
SIGNING_NAME = Some Key Name
SIGNING_EMAIL = user@example.com
INITIAL_COMMIT = pubkey
CRUD_ACTIONS = always

gitea.log:

2022/11/30 19:31:26 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [638803ee] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git429096436) Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
	
2022/11/30 19:31:26 .../api/v1/repo/file.go:601:handleCreateOrUpdateFileError() [E] [638803ee] UpdateFile: Unable to commit-tree in temporary repo: user/repo Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
	
2022/11/30 19:31:39 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [638803fb-2] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git4244920609) Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
	
2022/11/30 19:31:39 .../api/v1/repo/file.go:601:handleCreateOrUpdateFileError() [E] [638803fb-2] UpdateFile: Unable to commit-tree in temporary repo: user/repo Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data
	
2022/11/30 20:02:11 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [63880b23] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git3654155080) Error: exit status 1
	Stdout: 
	Stderr: error: gpg failed to sign the data

This is a different issue.

@lunny commented on GitHub (Dec 12, 2022): > I'm getting the same warning messages and found that this is also preventing me from adding any commits in the web editor because I have `CRUD_ACTIONS` set to always sign, which is probably to be expected. > > ``` > [repository.signing] > SIGNING_KEY = XXXXXXXXXXXXXXX > SIGNING_NAME = Some Key Name > SIGNING_EMAIL = user@example.com > INITIAL_COMMIT = pubkey > CRUD_ACTIONS = always > ``` > > gitea.log: > > ``` > 2022/11/30 19:31:26 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [638803ee] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git429096436) Error: exit status 1 > Stdout: > Stderr: error: gpg failed to sign the data > > 2022/11/30 19:31:26 .../api/v1/repo/file.go:601:handleCreateOrUpdateFileError() [E] [638803ee] UpdateFile: Unable to commit-tree in temporary repo: user/repo Error: exit status 1 > Stdout: > Stderr: error: gpg failed to sign the data > > 2022/11/30 19:31:39 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [638803fb-2] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git4244920609) Error: exit status 1 > Stdout: > Stderr: error: gpg failed to sign the data > > 2022/11/30 19:31:39 .../api/v1/repo/file.go:601:handleCreateOrUpdateFileError() [E] [638803fb-2] UpdateFile: Unable to commit-tree in temporary repo: user/repo Error: exit status 1 > Stdout: > Stderr: error: gpg failed to sign the data > > 2022/11/30 20:02:11 ...y/files/temp_repo.go:300:CommitTreeWithDate() [E] [63880b23] Unable to commit-tree in temporary repo: user/repo (/home/git/gitea/data/tmp/local-repo/upload.git3654155080) Error: exit status 1 > Stdout: > Stderr: error: gpg failed to sign the data > ``` This is a different issue.
Author
Owner

@lunny commented on GitHub (Dec 12, 2022):

#20556 backport the migration but not the feature. I think it's safe to add the struct into the struct with nothing else.

@lunny commented on GitHub (Dec 12, 2022): #20556 backport the migration but not the feature. I think it's safe to add the struct into the struct with nothing else.
Author
Owner

@wolflu05 commented on GitHub (Dec 12, 2022):

I saw this PR only backported one field. Are the other two already backported?

@wolflu05 commented on GitHub (Dec 12, 2022): I saw this PR only backported one field. Are the other two already backported?
Author
Owner

@lunny commented on GitHub (Dec 13, 2022):

Another two fields are TEXT before v1.17 but MEDIUMTEXT from v1.17. And the migration has been added in v1.18 from #20896

@lunny commented on GitHub (Dec 13, 2022): Another two fields are `TEXT` before v1.17 but `MEDIUMTEXT` from v1.17. And the migration has been added in v1.18 from #20896
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#9861