models.SetEngine: Failed to connect to database: Unknown database type #3616

Closed
opened 2025-11-02 05:19:38 -06:00 by GiteaMirror · 9 comments
Owner

Originally created by @plaidshirtakos on GitHub (Jul 18, 2019).

  • Gitea version (or commit ref): Gitea version 1.5.0 built with: bindata, sqlite
  • Git version: git version 2.17.1
  • Operating system: 18.04.2 LTS (Bionic Beaver)
  • Database (use [x]):
    • PostgreSQL
    • [x ] MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • [x ] No
    • Not relevant
  • Log gist:

Description

I get error message for command gitea admin change-password --username myusername --password asecurenewpassword and command gitea admin create-user --name newuser --password newpw --email mymail@mymail.com --admin 1 too .

Message:

models.SetEngine: Failed to connect to database: Unknown database type:
2019/07/18 06:27:50 [I] XORM Log Mode: Console(Info)

Screenshots

Not relevant.

Originally created by @plaidshirtakos on GitHub (Jul 18, 2019). - Gitea version (or commit ref): Gitea version 1.5.0 built with: bindata, sqlite - Git version: git version 2.17.1 - Operating system: 18.04.2 LTS (Bionic Beaver) - Database (use `[x]`): - [ ] PostgreSQL - [x ] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [x ] No - [ ] Not relevant - Log gist: ## Description I get error message for command gitea `admin change-password --username myusername --password asecurenewpassword` and command `gitea admin create-user --name newuser --password newpw --email mymail@mymail.com --admin 1` too . Message: > models.SetEngine: Failed to connect to database: Unknown database type: > 2019/07/18 06:27:50 [I] XORM Log Mode: Console(Info) ## Screenshots Not relevant.
GiteaMirror added the issue/stale label 2025-11-02 05:19:38 -06:00
Author
Owner

@lunny commented on GitHub (Jul 18, 2019):

Could you paste your database settings in app.ini

@lunny commented on GitHub (Jul 18, 2019): Could you paste your database settings in app.ini
Author
Owner

@plaidshirtakos commented on GitHub (Jul 18, 2019):

@lunny :

[database]
DB_TYPE  = mysql
HOST     = 127.0.0.1:3306
NAME     = gitea
USER     = gitea
PASSWD   = qwert
SSL_MODE = disable
PATH     = data/gitea.db
@plaidshirtakos commented on GitHub (Jul 18, 2019): @lunny : ``` [database] DB_TYPE = mysql HOST = 127.0.0.1:3306 NAME = gitea USER = gitea PASSWD = qwert SSL_MODE = disable PATH = data/gitea.db ```
Author
Owner

@zeripath commented on GitHub (Jul 18, 2019):

I suspect your Gitea admin command is not finding your config, the -c option should allow you to set it but it depends on your Gitea version.

Btw if you are genuinely using Gitea 1.5 I strongly recommend you update. There are multiple security issues in old versions of Gitea and you should update to at least 1.8 or one of the 1.9-rcs

@zeripath commented on GitHub (Jul 18, 2019): I suspect your Gitea admin command is not finding your config, the -c option should allow you to set it but it depends on your Gitea version. Btw if you are genuinely using Gitea 1.5 I strongly recommend you update. There are multiple security issues in old versions of Gitea and you should update to at least 1.8 or one of the 1.9-rcs
Author
Owner

@plaidshirtakos commented on GitHub (Jul 19, 2019):

@zeripath : I upgraded to gitea-1.8.3, but facing still the same issue.

models.SetEngine: Failed to connect to database: Unknown database type:

@plaidshirtakos commented on GitHub (Jul 19, 2019): @zeripath : I upgraded to `gitea-1.8.3`, but facing still the same issue. > models.SetEngine: Failed to connect to database: Unknown database type:
Author
Owner

@zeripath commented on GitHub (Jul 19, 2019):

The likely issue is that the Gitea admin command cannot find your config file. Either you have to set the -c option or environment variables as appropriate.

That is to be explicit you must:

gitea admin change-password -c ABSOLUTE_PATH_TO_CONFIG_FILE
@zeripath commented on GitHub (Jul 19, 2019): The likely issue is that the Gitea admin command cannot find your config file. Either you have to set the -c option or environment variables as appropriate. That is to be explicit you must: ``` gitea admin change-password -c ABSOLUTE_PATH_TO_CONFIG_FILE ```
Author
Owner

@plaidshirtakos commented on GitHub (Jul 29, 2019):

Is it about app.ini conf file?

@plaidshirtakos commented on GitHub (Jul 29, 2019): Is it about _app.ini_ conf file?
Author
Owner

@zeripath commented on GitHub (Jul 29, 2019):

Yes.

@zeripath commented on GitHub (Jul 29, 2019): Yes.
Author
Owner

@stale[bot] commented on GitHub (Sep 27, 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 (Sep 27, 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.
Author
Owner

@stale[bot] commented on GitHub (Oct 11, 2019):

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale[bot] commented on GitHub (Oct 11, 2019): This issue has been automatically closed because of inactivity. You can re-open it if needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#3616