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

[BUG] wrong migration in v1.17.3 #21880

Closed
wolflu05 opened this issue Nov 20, 2022 · 9 comments
Closed

[BUG] wrong migration in v1.17.3 #21880

wolflu05 opened this issue Nov 20, 2022 · 9 comments

Comments

@wolflu05
Copy link

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

@zeripath
Copy link
Contributor

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.

@lunny
Copy link
Member

lunny commented Nov 21, 2022

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

@zeripath
Copy link
Contributor

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

@4oo4
Copy link

4oo4 commented 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

@lunny
Copy link
Member

lunny commented 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
Copy link
Member

lunny commented 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 lunny added this to the 1.17.4 milestone Dec 12, 2022
@lunny lunny reopened this Dec 12, 2022
@lunny
Copy link
Member

lunny commented 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.

@wolflu05
Copy link
Author

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

@lunny
Copy link
Member

lunny commented 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 added a commit that referenced this issue Dec 13, 2022
@lunny lunny closed this as completed Dec 20, 2022
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants