Gitea 1.20.2 doesn't seem to use the DB HOST in app.ini #11366

Closed
opened 2025-11-02 09:35:38 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @Epy on GitHub (Jul 29, 2023).

Description

Hi
I'm currently moving from one server with a simple setup (gitea + db + reverse proxy on the same host) to a more complicated setup where each one is on a different server on the same local network.

All are/were on Debian stable, installed with official packages and Gitea from binary (v1.20.1 updated on the former server without any hiccups) I followed this: https://discourse.gitea.io/t/move-gitea-to-another-server/1513/2

My original problem was Gitea didn't listen on http when it starts; then I found something when incrementing the log level:

2023/07/29 22:58:31 cmd/web.go:175:serveInstalled() [I] PING DATABASE mysql
2023/07/29 22:58:31 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: Error 1045 (28000): Accès refusé pour l'utilisateur: user@host.home.arpa

In french it says access denied for user@host. The problem is, in my app.ini file I set:

[database]
HOST = dbhost.home.arpa
USER = user
...

As in: https://docs.gitea.com/administration/config-cheat-sheet#database-database

The USER is the right one, it's also a mysql server but the DB host is not. It uses its own hostname which I'm not sure where it found it. Maybe in another parameter, I tried hiding the following parameter to try make it connect to the right DB host

[server] 
; HOST = host.home.arpa

I don't think it got the database name from the DB it self and locked itself out as I imported everything for the migration, because it would have said "localhost" from the previous server, not the FQDN of the new one.

I think it will be able to listen on http://host.home.arpa:3000 once this DB problem will be solved ?

Thanks for your help

Gitea Version

1.20.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian bookworm

How are you running Gitea?

Binary download from https://dl.gitea.io
Started as a service by systemd

Database

MySQL

Originally created by @Epy on GitHub (Jul 29, 2023). ### Description Hi I'm currently moving from one server with a simple setup (gitea + db + reverse proxy on the same host) to a more complicated setup where each one is on a different server on the same local network. All are/were on Debian stable, installed with official packages and Gitea from binary (v1.20.1 updated on the former server without any hiccups) I followed this: https://discourse.gitea.io/t/move-gitea-to-another-server/1513/2 My original problem was Gitea didn't listen on http when it starts; then I found something when incrementing the log level: ``` 2023/07/29 22:58:31 cmd/web.go:175:serveInstalled() [I] PING DATABASE mysql 2023/07/29 22:58:31 routers/common/db.go:34:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: Error 1045 (28000): Accès refusé pour l'utilisateur: user@host.home.arpa ``` In french it says access denied for user@host. The problem is, in my app.ini file I set: ``` [database] HOST = dbhost.home.arpa USER = user ... ``` As in: https://docs.gitea.com/administration/config-cheat-sheet#database-database The USER is the right one, it's also a mysql server but the DB host is not. It uses its own hostname which I'm not sure where it found it. Maybe in another parameter, I tried hiding the following parameter to try make it connect to the right DB host ``` [server] ; HOST = host.home.arpa ``` I don't think it got the database name from the DB it self and locked itself out as I imported everything for the migration, because it would have said "localhost" from the previous server, not the FQDN of the new one. I think it will be able to listen on `http://host.home.arpa:3000` once this DB problem will be solved ? Thanks for your help ### Gitea Version 1.20.1 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Debian bookworm ### How are you running Gitea? Binary download from https://dl.gitea.io Started as a service by systemd ### Database MySQL
GiteaMirror added the issue/needs-feedback label 2025-11-02 09:35:38 -06:00
Author
Owner

@lunny commented on GitHub (Jul 30, 2023):

I cannot reproduce it. Could you check your app.ini whether you have duplicated database settings?

@lunny commented on GitHub (Jul 30, 2023): I cannot reproduce it. Could you check your app.ini whether you have duplicated database settings?
Author
Owner

@Epy commented on GitHub (Jul 30, 2023):

I just checked, I dont' have duplicated parameters.

And I'm sure it does read this app.ini because it's in the status and other changes were taken (with a restart)
Could it have read this parameter somewhere else ? It's not in Environnement= variable in the gitea.service file

@Epy commented on GitHub (Jul 30, 2023): I just checked, I dont' have duplicated parameters. And I'm sure it does read this app.ini because it's in the status and other changes were taken (with a restart) Could it have read this parameter somewhere else ? It's not in `Environnement=` variable in the `gitea.service` file
Author
Owner

@Epy commented on GitHub (Jul 30, 2023):

I made other tries, with the mysql CLI client directly.
The error I see in Gitea logs comes from it, it's exactly the same (I thought Gitea had it's own mysql client in Go ?)

So there is a problem with my mysql client it seems, I'll look for it ..

Gitea is not guilty it seems

Sorry for the noise

@Epy commented on GitHub (Jul 30, 2023): I made other tries, with the mysql CLI client directly. The error I see in Gitea logs comes from it, it's exactly the same (I thought Gitea had it's own mysql client in Go ?) So there is a problem with my mysql client it seems, I'll look for it .. Gitea is not guilty it seems Sorry for the noise
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11366