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

Warning "Table session has column created_unix but struct has not related field" after migrating release/v1.13 to release/v1.14 #15123

Closed
pboguslawski opened this issue Mar 23, 2021 · 1 comment
Labels

Comments

@pboguslawski
Copy link
Contributor

After upgrading gitea in test environment from release/v1.13 do release/v1.14 message appears on gitea startup (mariadb):

2021/03/23 13:39:47 ...rm/session_schema.go:431:Sync2() [W] Table session has column created_unix but struct has not related field

Session table after upgrade:

$ mysql -e 'show create table session' gitea
[...]
CREATE TABLE `session` (
  `key` char(16) NOT NULL,
  `data` blob DEFAULT NULL,
  `created_unix` bigint(20) DEFAULT NULL,
  `expiry` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC
[...]

No such message when same gitea release/v1.14 initializes empty db; session table after db initialization:

$ mysql -e 'show create table session' gitea
[...]
CREATE TABLE `session` (
  `key` char(16) NOT NULL,
  `data` blob DEFAULT NULL,
  `expiry` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC
[...]

This table was not present in release/v1.13; this error is probably caused by:

https://github.com/go-gitea/gitea/blob/master/models/session.go#L14
https://github.com/go-gitea/gitea/blob/master/models/session.go#L120

Regards,
Paweł

@lunny lunny added the type/bug label Mar 23, 2021
@zeripath
Copy link
Contributor

If you're still experiencing this you should be able to run: gitea doctor recreate-table session to make this go away.

The migration that causes this was fixed by #15180

@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants