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

Closed
opened 2025-11-02 07:14:34 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @pboguslawski on GitHub (Mar 23, 2021).

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ł

Originally created by @pboguslawski on GitHub (Mar 23, 2021). 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ł
GiteaMirror added the type/bug label 2025-11-02 07:14:34 -06:00
Author
Owner

@zeripath commented on GitHub (Jun 28, 2021):

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

@zeripath commented on GitHub (Jun 28, 2021): 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
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7055