Gitea v18.0 won't start on MSSQL 2019 #10032

Closed
opened 2025-11-02 08:56:19 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @achikhv on GitHub (Dec 31, 2022).

Description

After upgrade from v17.5 to v18.0 gitea can not connect to MSSQL Server 2019 Standard edition.

I see not very descriptive error in logs: "server misbehaving'. Here is log excrept:

2022/12/31 10:21:42 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization.
2022/12/31 10:21:42 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2022/12/31 10:21:42 cmd/web.go:163:runWeb() [I] PING DATABASE mssql
2022/12/31 10:21:42 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: lookup SERVER_DNS_NAME on SERVER_IP: server misbehaving
2022/12/31 10:21:42 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds

My db settings in app.ini:

[database]
DB_TYPE  = mssql
HOST     = SERVER_DNS_NAME
NAME     = gitea
USER     = gitea
PASSWD   = PASSWORD
SSL_MODE = disable
PATH     = data/gitea.db

Could you please help me to get v18 running on MSSQL?

Thanks in advance!

Gitea Version

1.18.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Windows Server 2019

How are you running Gitea?

Downloaded sources from dl.gitea.io. Running it as windows service.

Database

MSSQL

Originally created by @achikhv on GitHub (Dec 31, 2022). ### Description After upgrade from v17.5 to v18.0 gitea can not connect to MSSQL Server 2019 Standard edition. I see not very descriptive error in logs: "server misbehaving'. Here is log excrept: ``` 2022/12/31 10:21:42 routers/common/db.go:20:InitDBEngine() [I] Beginning ORM engine initialization. 2022/12/31 10:21:42 routers/common/db.go:27:InitDBEngine() [I] ORM engine initialization attempt #1/10... 2022/12/31 10:21:42 cmd/web.go:163:runWeb() [I] PING DATABASE mssql 2022/12/31 10:21:42 routers/common/db.go:33:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: lookup SERVER_DNS_NAME on SERVER_IP: server misbehaving 2022/12/31 10:21:42 routers/common/db.go:34:InitDBEngine() [I] Backing off for 3 seconds ``` My db settings in app.ini: ``` [database] DB_TYPE = mssql HOST = SERVER_DNS_NAME NAME = gitea USER = gitea PASSWD = PASSWORD SSL_MODE = disable PATH = data/gitea.db ``` Could you please help me to get v18 running on MSSQL? Thanks in advance! ### Gitea Version 1.18.0 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Windows Server 2019 ### How are you running Gitea? Downloaded sources from dl.gitea.io. Running it as windows service. ### Database MSSQL
GiteaMirror added the type/bug label 2025-11-02 08:56:19 -06:00
Author
Owner

@jrjake commented on GitHub (Dec 31, 2022):

Error: lookup SERVER_DNS_NAME on SERVER_IP: server misbehaving

This error means that Gitea is not able to resolve SERVER_DNS_NAME from DNS server SERVER_IP. Something is wrong with your DNS server or its configuration. You can try working around this by specifying HOST as the actual IP address or adding a record in C:\Windows\System32\Drivers\etc\hosts to override the DNS server.

@jrjake commented on GitHub (Dec 31, 2022): > Error: lookup SERVER_DNS_NAME on SERVER_IP: server misbehaving This error means that Gitea is not able to resolve `SERVER_DNS_NAME` from DNS server `SERVER_IP`. Something is wrong with your DNS server or its configuration. You can try working around this by specifying `HOST` as the actual IP address or adding a record in `C:\Windows\System32\Drivers\etc\hosts` to override the DNS server.
Author
Owner

@achikhv commented on GitHub (Dec 31, 2022):

Well, I edited out real values. SEERVER_DNS_NAME and SERVER_IP in my logs shows valid parameters. So I suppose that DNS lookup completed correctly. Besides, v1.17.4 successfuly starts without any changes.

PS: happy new year to all gitea community!

@achikhv commented on GitHub (Dec 31, 2022): Well, I edited out real values. SEERVER_DNS_NAME and SERVER_IP in my logs shows valid parameters. So I suppose that DNS lookup completed correctly. Besides, v1.17.4 successfuly starts without any changes. PS: happy new year to all gitea community!
Author
Owner

@eeyrjmr commented on GitHub (Jan 1, 2023):

Well, I edited out real values. SEERVER_DNS_NAME and SERVER_IP in my logs shows valid parameters. So I suppose that DNS lookup completed correctly. Besides, v1.17.4 successfuly starts without any changes.

PS: happy new year to all gitea community!

Could you try adding in the IP address "just in case". It might help narrow down where things are going wrong. Also is the hostname the fqdn or just the hostname?

@eeyrjmr commented on GitHub (Jan 1, 2023): > Well, I edited out real values. SEERVER_DNS_NAME and SERVER_IP in my logs shows valid parameters. So I suppose that DNS lookup completed correctly. Besides, v1.17.4 successfuly starts without any changes. > > PS: happy new year to all gitea community! Could you try adding in the IP address "just in case". It might help narrow down where things are going wrong. Also is the hostname the fqdn or just the hostname?
Author
Owner

@achikhv commented on GitHub (Jan 1, 2023):

@eeyrjmr , @wfjake, thank you for hints! SQL Server was specified as netbios name. After I changed it to FQDN, gitea started succesfully.

@achikhv commented on GitHub (Jan 1, 2023): @eeyrjmr , @wfjake, thank you for hints! SQL Server was specified as netbios name. After I changed it to FQDN, gitea started succesfully.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10032