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

1.21.11 MSSQL upgrade not working #31529

Closed
katit opened this issue Jun 30, 2024 · 6 comments
Closed

1.21.11 MSSQL upgrade not working #31529

katit opened this issue Jun 30, 2024 · 6 comments
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail

Comments

@katit
Copy link

katit commented Jun 30, 2024

Description

Upgrading by stopping service, replacing .exe with gitea-1.22.0-gogit-windows-4.0-amd64, restarting service.
Gitea wouldn't start.
DB - preexisting SQL Server 2019

Logs from start to end for failed start attempt. I feel like config options changes? Or maybe how MSSQL connection happens changed?

[database]
DB_TYPE = mssql
HOST = 192.168.3.3\SQLSERVER2019:1433
NAME = Gitea
USER = Gitea
PASSWD = Gitea
SSL_MODE = disable
LOG_SQL = true

Logs:

2024/06/29 19:23:48 ...s/setting/session.go:77:loadSessionFrom() [I] Session Service Enabled
2024/06/29 19:23:48 ...es/setting/mailer.go:237:loadMailerFrom() [I] Mail Service Enabled
2024/06/29 19:23:48 ...es/setting/mailer.go:259:loadNotifyMailFrom() [I] Notify Mail Service Enabled
2024/06/29 19:23:48 ...s/storage/storage.go:176:initAttachments() [I] Initialising Attachment storage with type: local
2024/06/29 19:23:48 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at C:\Program Files\Gitea\data\attachments
2024/06/29 19:23:48 ...s/storage/storage.go:166:initAvatars() [I] Initialising Avatar storage with type: local
2024/06/29 19:23:48 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at C:\Program Files\Gitea\data\avatars
2024/06/29 19:23:48 ...s/storage/storage.go:192:initRepoAvatars() [I] Initialising Repository Avatar storage with type: local
2024/06/29 19:23:48 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at C:\Program Files\Gitea\data\repo-avatars
2024/06/29 19:23:48 ...s/storage/storage.go:186:initLFS() [I] Initialising LFS storage with type: local
2024/06/29 19:23:48 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at C:\Program Files\Gitea\data\lfs
2024/06/29 19:23:48 ...s/storage/storage.go:198:initRepoArchives() [I] Initialising Repository Archive storage with type: local
2024/06/29 19:23:48 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at C:\Program Files\Gitea\data\repo-archive
2024/06/29 19:23:48 ...s/storage/storage.go:208:initPackages() [I] Initialising Packages storage with type: local
2024/06/29 19:23:48 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at C:\Program Files\Gitea\data\packages
2024/06/29 19:23:48 ...s/storage/storage.go:219:initActions() [I] Initialising Actions storage with type: local
2024/06/29 19:23:48 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at C:\Program Files\Gitea\data\actions_log
2024/06/29 19:23:48 ...s/storage/storage.go:223:initActions() [I] Initialising ActionsArtifacts storage with type: local
2024/06/29 19:23:48 ...les/storage/local.go:33:NewLocalStorage() [I] Creating new Local Storage at C:\Program Files\Gitea\data\actions_artifacts
2024/06/29 19:23:48 ...queue/workergroup.go:271:doRun() [D] Queue "mail" starts running
2024/06/29 19:23:48 ...queue/workergroup.go:271:doRun() [D] Queue "notification-service" starts running
2024/06/29 19:23:48 ...queue/workergroup.go:271:doRun() [D] Queue "repo-archive" starts running
2024/06/29 19:23:48 routers/init.go:138:InitWebInstalled() [I] SQLite3 support is enabled
2024/06/29 19:23:48 routers/common/db.go:23:InitDBEngine() [I] Beginning ORM engine initialization.
2024/06/29 19:23:48 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #1/10...
2024/06/29 19:23:48 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:23:48 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:23:48 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:23:51 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #2/10...
2024/06/29 19:23:51 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:23:51 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #2/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:23:51 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:23:54 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #3/10...
2024/06/29 19:23:54 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:23:54 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #3/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:23:54 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:23:57 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #4/10...
2024/06/29 19:23:57 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:23:57 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #4/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:23:57 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:24:00 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #5/10...
2024/06/29 19:24:00 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:24:00 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #5/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:24:00 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:24:03 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #6/10...
2024/06/29 19:24:03 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:24:03 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #6/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:24:03 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:24:06 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #7/10...
2024/06/29 19:24:06 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:24:06 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #7/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:24:06 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:24:09 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #8/10...
2024/06/29 19:24:09 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:24:09 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #8/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:24:09 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:24:12 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #9/10...
2024/06/29 19:24:12 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:24:12 routers/common/db.go:36:InitDBEngine() [E] ORM engine initialization attempt #9/10 failed. Error: mssql: login error: Login failed for user 'Gitea'.
2024/06/29 19:24:12 routers/common/db.go:37:InitDBEngine() [I] Backing off for 3 seconds
2024/06/29 19:24:15 routers/common/db.go:30:InitDBEngine() [I] ORM engine initialization attempt #10/10...
2024/06/29 19:24:15 cmd/web.go:194:serveInstalled() [I] PING DATABASE mssql
2024/06/29 19:24:15 routers/init.go:73:mustInitCtx() [F] code.gitea.io/gitea/routers/common.InitDBEngine(ctx) failed: mssql: login error: Login failed for user 'Gitea'.

Gitea Version

1.22

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 2022

How are you running Gitea?

Running via wrapping Gitea.exe into windows service per official instructions

Database

MSSQL

@katit katit added the type/bug label Jun 30, 2024
@lunny
Copy link
Member

lunny commented Jul 5, 2024

Looks like your login password is not right?

@lunny lunny added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Jul 5, 2024
@katit
Copy link
Author

katit commented Jul 6, 2024

No, I simply switch exe. This config works with 1.21.11 but doesn't work with 1.22

I "fixed" it by switching to "localhost" without named instance. So, the bug is in how sql connection string is parsed.

@lunny
Copy link
Member

lunny commented Jul 6, 2024

I don't know whether we have support the format of host.

HOST = 192.168.3.3\SQLSERVER2019:1433

@katit
Copy link
Author

katit commented Jul 7, 2024

Well, in 1.21 it supports it for sure, in 1.22 it doesn't. So something definitely changed. In my case I got lucky because I host on same machine so I was able to change port. If Gitea was on different machine it would not work. I guess it needs to be checked how parsing of HOST is done and what is changed since 1.21?

@techknowlogick
Copy link
Member

I think we upgraded the mssql lib we used between those two versions. We switched to the msft fork, and so probably that’s where we can start looking for debugging

@GiteaBot
Copy link
Contributor

GiteaBot commented Aug 9, 2024

We close issues that need feedback from the author if there were no new comments for a month. 🍵

@GiteaBot GiteaBot closed this as completed Aug 9, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Nov 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail
Projects
None yet
Development

No branches or pull requests

4 participants