Gitea-1.16.0: Issues related to login_source/is_active?

I’ve tried to upgrade my gitea instance from 1.15.11 to 1.16.0.
In the past, I’ve used many previous versions of gitea and never had any issues related to the upgrade.
Not so this time.

When executing

  • gitea admin auth add-ldap --name DPLDAP ...

I’m getting an error message related to the database column “is_active”:

2022/01/30 21:57:35 ...d/admin_auth_ldap.go:135:func1() [I] [SQL] SELECT `id`, `type`, `name`, `is_active`, `is_sync_enabled`, `cfg`, `created_unix`, `updated_unix` FROM `login_source` WHERE (name=?) LIMIT 1 [DPLDAP] - 511.28µs
2022/01/30 21:57:35 main.go:117:main() [F] Failed to run app with [/srv/gitea/gitea admin auth add-ldap --name DPLDAP --security-protocol LDAPS --host XXX --port YYY --user-search-base ou=People,dc=daemons-point,dc=com --user-filter (&(objectClass=posixAccount)(uid=%s)(memberOf=CN=gitea,ou=group,dc=daemons-point,dc=com)) --admin-filter (memberOf=CN=gitea-admin,ou=group,dc=daemons-point,dc=com) --username-attribute uid --firstname-attribute givenName --surname-attribute sn --email-attribute mail --bind-dn ou=People,dc=daemons-point,dc=com]: Error 1054: Unknown column 'is_active' in 'field list'

Any idea? Maybe a missing database migration? Shall I fix login_source manually by renaming “is_actived” to “is_active”?

Thx for your help, Uli

Answering to myself: I think the issue is this:

  • I’m using 1.15.11 at the beginning
  • I’m upgrading to 1.16.0
  • The first start of GITEA is gitea admin auth add-ldap ...
  • For this, the database migrations aren’t executed, so the command fails

Does this sound reasonable? Introducing a regular start of gitea before executing “gitea admin …” seems to work OK

You should run gitea web to start the web service or you can run gitea migrate before other sub commands. Most of other sub commands will not migrate database automatically.

2 Likes

Thx, I’ll update my ansible scripts accordingly!

1 Like