Overview and Favourites returns 500 error #6425

Closed
opened 2025-11-02 06:55:23 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @vonAlenberg on GitHub (Dec 2, 2020).

  • Gitea version: 1.14.0+dev-293-g4f5ff1ef0
  • Git version: 2.25.1
  • Operating system:
    • Ubuntu 20.04 on VPS
    • started and run by docker-compose
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:
    2020/12/02 12:39:14 routers/user/home.go:120:Dashboard() [E] GetUserHeatmapDataByUser: pq: function strftime(unknown, bigint, unknown) does not exist

Description

When I click on "Overview" or on "User->Favourites" I get a 500 Error and nothing else is displayed. So in fact I cannot see the repositories I created, but they are there ^^ When I visit "User->Settings->Repositories" I can select and view them.

The above error message comes from the container log and is the same in both cases.

Screenshots

grafik

Originally created by @vonAlenberg on GitHub (Dec 2, 2020). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version: 1.14.0+dev-293-g4f5ff1ef0 - Git version: 2.25.1 - Operating system: - Ubuntu 20.04 on VPS - started and run by docker-compose - Database: - [X] PostgreSQL - [ ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [X] No - Log gist: `2020/12/02 12:39:14 routers/user/home.go:120:Dashboard() [E] GetUserHeatmapDataByUser: pq: function strftime(unknown, bigint, unknown) does not exist` ## Description When I click on "Overview" or on "User->Favourites" I get a 500 Error and nothing else is displayed. So in fact I cannot see the repositories I created, but they are there ^^ When I visit "User->Settings->Repositories" I can select and view them. The above error message comes from the container log and is the same in both cases. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** --> ![grafik](https://user-images.githubusercontent.com/26161253/100874314-b02dbb00-34a4-11eb-9e02-6e3b7130f074.png)
GiteaMirror added the type/bug label 2025-11-02 06:55:23 -06:00
Author
Owner

@zeripath commented on GitHub (Dec 2, 2020):

This is very like a duplicate of #5480. You should restart the container if you change the dialect.

What is your app.ini?

I'm not certain why this still happens because when I separated out the install page xorm should be reinitialised completely preventing this issue.

@zeripath commented on GitHub (Dec 2, 2020): This is very like a duplicate of #5480. You should restart the container if you change the dialect. What is your app.ini? I'm not certain why this still happens because when I separated out the install page xorm should be reinitialised completely preventing this issue.
Author
Owner

@zeripath commented on GitHub (Dec 2, 2020):

Aha the reason this issue still occurs is that modules/setting/database.go:61:func InitDBConfig() { only sets database values - it doesn't unset the old ones.


	switch Database.Type {
	case "sqlite3":
		Database.UseSQLite3 = true
	case "mysql":
		Database.UseMySQL = true
		defaultCharset = "utf8mb4"
	case "postgres":
		Database.UsePostgreSQL = true
	case "mssql":
		Database.UseMSSQL = true
	}

needs to unset the other values.

@zeripath commented on GitHub (Dec 2, 2020): Aha the reason this issue still occurs is that `modules/setting/database.go:61:func InitDBConfig() {` only sets database values - it doesn't unset the old ones. ```go switch Database.Type { case "sqlite3": Database.UseSQLite3 = true case "mysql": Database.UseMySQL = true defaultCharset = "utf8mb4" case "postgres": Database.UsePostgreSQL = true case "mssql": Database.UseMSSQL = true } ``` needs to unset the other values.
Author
Owner

@vonAlenberg commented on GitHub (Dec 2, 2020):

You should restart the container if you change the dialect.

i didn't change the dialect at all, was like this from the start.

app.ini

APP_NAME = Code © 
RUN_MODE = prod
RUN_USER = root

[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
DOMAIN           = git.*****
SSH_DOMAIN       = git.*****
HTTP_PORT        = 3000
ROOT_URL         = https://git.*****/
DISABLE_SSH      = false
SSH_PORT         = 22
SSH_LISTEN_PORT  = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
LFS_JWT_SECRET   = *****
OFFLINE_MODE     = false

[database]
PATH     = /data/gitea/gitea.db
DB_TYPE  = postgres
HOST     = db
NAME     = gitea
USER     = gitea
PASSWD   = *****
LOG_SQL  = false
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]
MODE                 = console
LEVEL                = info
REDIRECT_MACARON_LOG = true
MACARON              = console
ROUTER               = console
ROOT_PATH            = /data/gitea/log

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

[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 = false
DEFAULT_ENABLE_TIMETRACKING       = false
NO_REPLY_ADDRESS                  = 

[oauth2]
JWT_SECRET = *****

[mailer]
ENABLED = false

[openid]
ENABLE_OPENID_SIGNIN = false
ENABLE_OPENID_SIGNUP = false

needs to unset the other values.

Well, it is a fresh install, so there should not be any values to reset...

PS I run gitea behind a Traefik v2 reverse proxy, but I don't think that's the cause of the issue.

@vonAlenberg commented on GitHub (Dec 2, 2020): > You should restart the container if you change the dialect. i didn't change the dialect at all, was like this from the start. app.ini ``` APP_NAME = Code © RUN_MODE = prod RUN_USER = root [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 DOMAIN = git.***** SSH_DOMAIN = git.***** HTTP_PORT = 3000 ROOT_URL = https://git.*****/ DISABLE_SSH = false SSH_PORT = 22 SSH_LISTEN_PORT = 22 LFS_START_SERVER = true LFS_CONTENT_PATH = /data/git/lfs LFS_JWT_SECRET = ***** OFFLINE_MODE = false [database] PATH = /data/gitea/gitea.db DB_TYPE = postgres HOST = db NAME = gitea USER = gitea PASSWD = ***** LOG_SQL = false 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] MODE = console LEVEL = info REDIRECT_MACARON_LOG = true MACARON = console ROUTER = console ROOT_PATH = /data/gitea/log [security] INSTALL_LOCK = true SECRET_KEY = ***** INTERNAL_TOKEN = ***** [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 = false DEFAULT_ENABLE_TIMETRACKING = false NO_REPLY_ADDRESS = [oauth2] JWT_SECRET = ***** [mailer] ENABLED = false [openid] ENABLE_OPENID_SIGNIN = false ENABLE_OPENID_SIGNUP = false ``` > needs to unset the other values. Well, it is a fresh install, so there should not be any values to reset... PS I run gitea behind a Traefik v2 reverse proxy, but I don't think that's the cause of the issue.
Author
Owner

@vonAlenberg commented on GitHub (Dec 2, 2020):

Okay, nevermind - now it works.

I have absolutely no idea why.

@vonAlenberg commented on GitHub (Dec 2, 2020): Okay, nevermind - now it works. I have absolutely no idea why.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6425