go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.08k stars 5.49k forks source link

template: admin/config:285:24: executing "admin/configError at Adminstration Konfiguration " at <.SessionConfig.CookieLifeTime>: can't evaluate field CookieLifeTime in type interface {} #10073

Closed harald-luebeck closed 4 years ago

harald-luebeck commented 4 years ago

Description

Goto Administration -> Konfiguration and this occured ...

Screenshots

bagasme commented 4 years ago

@harald-luebeck error logs?

radiocity commented 4 years ago

@bagasme, fails in local mode

Google Chrome
Request URL: http://localhost:3000/admin/config
Request Method: GET
Status Code: 500 Internal Server Error (from ServiceWorker)
app.ini
APP_NAME = Gitea: Git with a cup of tea
RUN_MODE = prod
RUN_USER = git

[repository]
ROOT = /data/git/repositories

[repository.local]
LOCAL_COPY_PATH = /data/gitea/tmp/local-repo

[repository.upload]
TEMP_PATH = /data/gitea/uploads

[server]
APP_DATA_PATH    = /data/gitea
SSH_DOMAIN       = localhost
HTTP_PORT        = 3000
ROOT_URL         = http://localhost:3000/
DISABLE_SSH      = false
SSH_PORT         = 22
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
DOMAIN           = localhost
LFS_JWT_SECRET   = CSh4hiDQCPTEoAsezo3nIXVD465adLkU-MriX05cy2I
OFFLINE_MODE     = true

[database]
PATH     = /data/gitea/gitea.db
DB_TYPE  = mysql
HOST     = gitea-db:3306
NAME     = gitea
USER     = gitea
PASSWD   = gitea
SCHEMA   = 
SSL_MODE = disable
CHARSET  = utf8

[indexer]
ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

[session]
PROVIDER_CONFIG = /data/gitea/sessions
PROVIDER        = file

[picture]
AVATAR_UPLOAD_PATH            = /data/gitea/avatars
REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
DISABLE_GRAVATAR              = true
ENABLE_FEDERATED_AVATAR       = false

[attachment]
PATH = /data/gitea/attachments

[log]
ROOT_PATH = /data/gitea/log
MODE      = file
LEVEL     = info

[security]
INSTALL_LOCK   = true
SECRET_KEY     = J4llvF7bctY5WaFwzwnsKY2fLqWbvRzR3LDryC9tuOKK2jf3b9aKnsO6V43xN6R8
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE1ODAzODk1Njd9.LNjn45LOstozCcOvO7L_oyu_GU65A-C8e1VQHb0OmQI

[service]
DISABLE_REGISTRATION              = false
REQUIRE_SIGNIN_VIEW               = false
REGISTER_EMAIL_CONFIRM            = false
ENABLE_NOTIFY_MAIL                = false
ALLOW_ONLY_EXTERNAL_REGISTRATION  = false
ENABLE_CAPTCHA                    = false
DEFAULT_KEEP_EMAIL_PRIVATE        = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING       = true
NO_REPLY_ADDRESS                  = noreply.localhost

[oauth2]
JWT_SECRET = JfaQZRGB7-lEvtHfskJACjICg5mcRyqDhmiJhGEzx_Y

[mailer]
ENABLED = false

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

gitea.log
2020/01/30 12:38:05 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `email_notifications_preference`, `passwd`, `passwd_hash_algo`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `is_restricted`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `repo_admin_change_team_access`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} - took: 4.5083ms
2020/01/30 12:38:05 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} - took: 1.4334ms
2020/01/30 12:38:07 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT `id`, `lower_name`, `name`, `full_name`, `email`, `keep_email_private`, `email_notifications_preference`, `passwd`, `passwd_hash_algo`, `must_change_password`, `login_type`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `language`, `description`, `created_unix`, `updated_unix`, `last_login_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `is_restricted`, `allow_git_hook`, `allow_import_local`, `allow_create_organization`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `num_teams`, `num_members`, `visibility`, `repo_admin_change_team_access`, `diff_view_style`, `theme` FROM `user` WHERE `id`=? LIMIT 1 []interface {}{1} - took: 782.5µs
2020/01/30 12:38:07 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count(*) FROM `notification` WHERE (user_id = ?) AND (status = ?) []interface {}{1, 0x1} - took: 1.091ms
harald-luebeck commented 4 years ago

Which error logs do you mean ? In the /data/gitea/logs/gitea.log are only SQL Selects which indicate no Error. I have also changed the ROOT_URL = http://localhost:3000/ in the app.ini to the Host on which i am running (Inside a Kubernetes Deployment).

app.ini:

APP_NAME = Gitea: Git with a cup of tea RUN_MODE = prod RUN_USER = git

[repository] ROOT = /data/git/repositories

[repository.local] LOCAL_COPY_PATH = /data/gitea/tmp/local-repo

[repository.upload] TEMP_PATH = /data/gitea/uploads

[server] APP_DATA_PATH = /data/gitea SSH_DOMAIN = localhost HTTP_PORT = 3000 ROOT_URL = http://gitea.svc.cluster.local:3000 DISABLE_SSH = false SSH_PORT = 22 SSH_LISTEN_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = /data/git/lfs DOMAIN = localhost LFS_JWT_SECRET = XXX OFFLINE_MODE = false

[database] PATH = /data/gitea/gitea.db DB_TYPE = postgres HOST = 10.10.10.115:5432 NAME = gitea USER = gitea PASSWD = XXX SCHEMA = SSL_MODE = disable CHARSET = utf8

[indexer] ISSUE_INDEXER_PATH = /data/gitea/indexers/issues.bleve

[session] PROVIDER_CONFIG = /data/gitea/sessions PROVIDER = file

[picture] AVATAR_UPLOAD_PATH = /data/gitea/avatars REPOSITORY_AVATAR_UPLOAD_PATH = /data/gitea/repo-avatars
DISABLE_GRAVATAR = false
ENABLE_FEDERATED_AVATAR = true

[attachment]
PATH = /data/gitea/attachments

[log]
ROOT_PATH = /data/gitea/log
MODE = file
LEVEL = debug

[security]
INSTALL_LOCK = true
SECRET_KEY = XXX INTERNAL_TOKEN = XXX

[service]
DISABLE_REGISTRATION = false
REQUIRE_SIGNIN_VIEW = false
REGISTER_EMAIL_CONFIRM = false
ENABLE_NOTIFY_MAIL = false
ALLOW_ONLY_EXTERNAL_REGISTRATION = false
ENABLE_CAPTCHA = false
DEFAULT_KEEP_EMAIL_PRIVATE = false
DEFAULT_ALLOW_CREATE_ORGANIZATION = true
DEFAULT_ENABLE_TIMETRACKING = true
NO_REPLY_ADDRESS = noreply.localhost

[oauth2]
JWT_SECRET = XXX
[mailer]
ENABLED = false

[openid]
ENABLE_OPENID_SIGNIN = true
ENABLE_OPENID_SIGNUP = true

Tail of logs:

2020/01/30 16:44:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count() FROM "milestone" - took: 637.577..s
2020/01/30 16:44:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count(
) FROM "label" - took: 412.99..s
2020/01/30 16:44:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count() FROM "hook_task" - took: 346.642..s
2020/01/30 16:44:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count(
) FROM "team" - took: 679.946..s
2020/01/30 16:44:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count() FROM "attachment" - took: 794.244..s
2020/01/30 16:44:34 ...s/context/context.go:139:HTML() [D] Template: admin/dashboard
2020/01/30 16:44:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_pref 2020/01/30 16:44:34 ...s/context/context.go:330:func1() [D] Session ID: fe59e8f69486bebf
2020/01/30 16:44:34 ...s/context/context.go:331:func1() [D] CSRF Token: TCMSIm80h8m49V3s4rAb-TnODFs6MTU4MDM5OTA2ODc3MDQ4NzMzNg
2020/01/30 16:44:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count(
) FROM "notification" WHERE (user_id = $1) AND (status = $2) []interface {}{1, 0x1} - took 2020/01/30 16:44:34 ...uters/user/avatar.go:25:Avatar() [D] Asked avatar for user harald.luebeck and size -1
2020/01/30 16:44:34 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_pref 2020/01/30 16:44:35 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT "id", "lower_name", "name", "full_name", "email", "keep_email_private", "email_notifications_pref 2020/01/30 16:44:35 ...s/context/context.go:330:func1() [D] Session ID: fe59e8f69486bebf
2020/01/30 16:44:35 ...s/context/context.go:331:func1() [D] CSRF Token: TCMSIm80h8m49V3s4rAb-TnODFs6MTU4MDM5OTA2ODc3MDQ4NzMzNg
2020/01/30 16:44:35 .../xorm/session_raw.go:78:queryRows() [I] [SQL] SELECT count(*) FROM "notification" WHERE (user_id = $1) AND (status = $2) []interface {}{1, 0x1} - took 2020/01/30 16:44:35 ...s/context/context.go:139:HTML() [D] Template: admin/config

What can i do get an error log for that ?

Best Regards

techknowlogick commented 4 years ago

As this is a template rendering issue, the logs may not prove to be helpful.

As you are using docker latest, that gets updated daily could you provide the exact version of gitea in use (generally it is in the footer in bottom left of page)

Edit: Are you using any customized templates?

harald-luebeck commented 4 years ago

Powered by Gitea Version: 1.12.0+dev-220-gd7f4f87aa No customized templates !

techknowlogick commented 4 years ago

@harald-luebeck that is helpful. Thank you :) let me collect some of my thoughts and get back to you on this.

NiTRoeSE commented 4 years ago

I can confirm this issue.. docker:latest —> 1.12.0+dev-221-geac5142ac

LindezaGrey commented 4 years ago

@NiTRoeSE same goes for me!

techknowlogick commented 4 years ago

Ah yes, I have confirmed this at try.gitea.io. Could be a recent PR that introduced this bug then.