Skip to content

gitea doctor doesn't work on mssql #23064

Closed
@suntsu42

Description

@suntsu42

Description

I'm currently trying to solve an issue where some users don't see repositories on their landing page.
The problem i have is very similar to the one described in #13843

Based on the answers there, i've run the following command:

gitea doctor --run check-db-consistency

This command end with the following error:

[1] Check consistency of database
 - [C] Error: mssql: Incorrect syntax near the keyword 'user'. whilst counting Orphaned Labels without existing repository or organisation
ERROR

I've then traced the queries on the database, and the following query gets executed:

SELECT count(*) FROM [label] WHERE org_id>0 AND org_id NOT IN (SELECT id FROM user)

image

Since user is a keyword in mssql, this is not a valid query.
The query should be written like this:

SELECT count(*) FROM [label] WHERE org_id>0 AND org_id NOT IN (SELECT id FROM [user])

Gitea Version

1.85

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?

I run gittea as a standalone .exe

Database

MSSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions