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

Overview and Favourites returns 500 error #13788

Closed
2 of 6 tasks
vonAlenberg opened this issue Dec 2, 2020 · 4 comments · Fixed by #13796
Closed
2 of 6 tasks

Overview and Favourites returns 500 error #13788

vonAlenberg opened this issue Dec 2, 2020 · 4 comments · Fixed by #13796
Labels

Comments

@vonAlenberg
Copy link

  • 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

@zeripath
Copy link
Contributor

zeripath commented 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
Copy link
Contributor

zeripath commented 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.

@6543 6543 added the type/bug label Dec 2, 2020
@vonAlenberg
Copy link
Author

vonAlenberg commented 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
Copy link
Author

Okay, nevermind - now it works.

I have absolutely no idea why.

zeripath added a commit to zeripath/gitea that referenced this issue Dec 2, 2020
One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix go-gitea#13788
Fix go-gitea#5480

Signed-off-by: Andrew Thornton <art27@cantab.net>
techknowlogick added a commit that referenced this issue Dec 3, 2020
One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix #13788
Fix #5480

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
zeripath added a commit to zeripath/gitea that referenced this issue Dec 3, 2020
…3796)

Backport go-gitea#13796

One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix go-gitea#13788
Fix go-gitea#5480

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
6543 pushed a commit that referenced this issue Dec 3, 2020
…13811)

Backport #13796

One perennial issue is users running the install page,
changing the database dialect and then suffering with issues

This PR simply resets all of the database.Use flags on
initDBConfig. This should prevent this issue from occuring.

Fix #13788
Fix #5480

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants