Cannot install using MSSQL backend #2897

Closed
opened 2025-11-02 04:53:00 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @kirillkovalenko on GitHub (Feb 12, 2019).

  • Gitea version (or commit ref):
    Gitea version 1.7.1 built with go1.11.1 : bindata, sqlite, sqlite_unlock_notify

  • Git version:
    git version 2.20.0.windows.1

  • Operating system:
    Windows 10 x64, Linux Ubuntu 18.04

  • Database:

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:
    [Macaron] 2019-02-12 11:04:57: Started POST /install for [::1]
    2019/02/12 11:04:57 [I] [SQL] select name from sysobjects where xtype ='U'
    [Macaron] 2019-02-12 11:04:57: Completed POST /install 200 OK in 277.686ms
    [Macaron] 2019-02-12 11:04:58: Started GET /serviceworker.js for [::1]
    [Macaron] 2019-02-12 11:04:58: Completed GET /serviceworker.js 200 OK in 154.0083ms

Description

I cannot install gitea on both on both Ubuntu and Windows using MSSQL as a backend. I'm getting 'Login error' message. I triple checked database settings - host,db name, login and password - using native UI and command line tools, so I'm pretty sure that I'm using correct values.

Screenshots

screenshot_2019-02-12 gitea git with a cup of tea

Originally created by @kirillkovalenko on GitHub (Feb 12, 2019). - Gitea version (or commit ref): Gitea version 1.7.1 built with go1.11.1 : bindata, sqlite, sqlite_unlock_notify - Git version: git version 2.20.0.windows.1 - Operating system: Windows 10 x64, Linux Ubuntu 18.04 - Database: - [ ] PostgreSQL - [ ] MySQL - [x] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: [Macaron] 2019-02-12 11:04:57: Started POST /install for [::1] 2019/02/12 11:04:57 [I] [SQL] select name from sysobjects where xtype ='U' [Macaron] 2019-02-12 11:04:57: Completed POST /install 200 OK in 277.686ms [Macaron] 2019-02-12 11:04:58: Started GET /serviceworker.js for [::1] [Macaron] 2019-02-12 11:04:58: Completed GET /serviceworker.js 200 OK in 154.0083ms ## Description I cannot install gitea on both on both Ubuntu and Windows using MSSQL as a backend. I'm getting 'Login error' message. I triple checked database settings - host,db name, login and password - using native UI and command line tools, so I'm pretty sure that I'm using correct values. ## Screenshots ![screenshot_2019-02-12 gitea git with a cup of tea](https://user-images.githubusercontent.com/3592194/52628015-f0c6d980-2eb6-11e9-914c-2ce327b641b0.png)
GiteaMirror added the type/questionissue/stale labels 2025-11-02 04:53:00 -06:00
Author
Owner

@lafriks commented on GitHub (Feb 12, 2019):

Did you try to connect mssql cli from same machine where you are running Gitea?

@lafriks commented on GitHub (Feb 12, 2019): Did you try to connect mssql cli from same machine where you are running Gitea?
Author
Owner

@kirillkovalenko commented on GitHub (Feb 12, 2019):

Yes, I did. It works.

@kirillkovalenko commented on GitHub (Feb 12, 2019): Yes, I did. It works.
Author
Owner

@kirillkovalenko commented on GitHub (Feb 12, 2019):

for example

PS > .\SQLCMD.EXE -S sql01 -U gitea
Password:
1> select @@version
2> go
-------------------------------------------------------------------------------------------------------
Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)
        Jun 17 2011 00:54:03
        Copyright (c) Microsoft Corporation
        Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
(1 rows affected)
1>
@kirillkovalenko commented on GitHub (Feb 12, 2019): for example ```none PS > .\SQLCMD.EXE -S sql01 -U gitea Password: 1> select @@version 2> go ------------------------------------------------------------------------------------------------------- Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64) Jun 17 2011 00:54:03 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor) (1 rows affected) 1> ```
Author
Owner

@lafriks commented on GitHub (Feb 12, 2019):

can you try to check if it works:

.\SQLCMD.EXE -S sql01,1433 -U gitea -d gitea
@lafriks commented on GitHub (Feb 12, 2019): can you try to check if it works: ``` .\SQLCMD.EXE -S sql01,1433 -U gitea -d gitea ```
Author
Owner

@kirillkovalenko commented on GitHub (Feb 12, 2019):

@lafriks : It works:

PS C:\Program Files\Microsoft SQL Server\110\Tools\Binn> .\SQLCMD.EXE -S sql01,1433 -U gitea -d gitea
Password:
1> select DB_NAME()
2> go

-----------------------
Gitea

(1 rows affected)
1>
@kirillkovalenko commented on GitHub (Feb 12, 2019): @lafriks : It works: ```none PS C:\Program Files\Microsoft SQL Server\110\Tools\Binn> .\SQLCMD.EXE -S sql01,1433 -U gitea -d gitea Password: 1> select DB_NAME() 2> go ----------------------- Gitea (1 rows affected) 1> ```
Author
Owner

@achikhv commented on GitHub (Feb 19, 2019):

Had this error too with SQL 2008 R2. It seems that gitea's DB driver is subject to this issue.

In my case I moved to Sql Server 2014. Propably installing 2008R2 SP3 can help.

@achikhv commented on GitHub (Feb 19, 2019): Had this error too with SQL 2008 R2. It seems that gitea's DB driver is subject to [this issue](https://support.microsoft.com/en-us/help/2653857/fix-you-cannot-connect-to-sql-server-by-using-jdbc-driver-for-sql-serv). In my case I moved to Sql Server 2014. Propably installing 2008R2 SP3 can help.
Author
Owner

@lunny commented on GitHub (Feb 19, 2019):

see https://github.com/denisenkom/go-mssqldb#known-issues, you have to install SP3 if you are using 2008 R2

@lunny commented on GitHub (Feb 19, 2019): see https://github.com/denisenkom/go-mssqldb#known-issues, you have to install SP3 if you are using 2008 R2
Author
Owner

@stale[bot] commented on GitHub (Apr 20, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Apr 20, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2897