UserSignIn: Error 1040: Too many connections #5156

Closed
opened 2025-11-02 06:16:15 -06:00 by GiteaMirror · 8 comments
Owner

Originally created by @gsantner on GitHub (Mar 30, 2020).

  • Gitea version (or commit ref): 1.12.0+dev-70-gbf847b93
  • Git version: gbf847b93
  • Operating system: U18.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

After updating gitea to latest state from https://dl.gitea.io/gitea/master/ (todays master, atm HEAD commit) I keep getting authentication errors (even though I do not even try to login i.e. in browser).

When go to frontpage, press F5 I get in log: (https://MYHOST/user/login?redirect_to=)

==> gitea.log <==
2020/03/31 00:24:37 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT `id`, `type`, `name`, `is_actived`, `is_sync_enabled`, `cfg`, `created_unix`, `updated_unix` FROM `login_source` WHERE (is_actived = ? and type = ?) [true 6] - 761.432µs
2020/03/31 00:24:37 routers/user/auth.go:131:SignIn() [E] UserSignIn: Error 1040: Too many connections

also I cannot push any commits:

Gitea: Internal Server Error
Unable to get repository: gsantner/myscripts Error 1040: Too many connections
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists

Note that I'm the only user of the server, service freshly started and it's not due fail2ban.

Screenshots

screenrecord

Originally created by @gsantner on GitHub (Mar 30, 2020). - Gitea version (or commit ref): 1.12.0+dev-70-gbf847b93 - Git version: gbf847b93 - Operating system: U18.04 - 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 After updating gitea to latest state from <https://dl.gitea.io/gitea/master/> (todays master, atm HEAD commit) I keep getting authentication errors (even though I do not even try to login i.e. in browser). When go to frontpage, press F5 I get in log: (https://MYHOST/user/login?redirect_to=) ``` ==> gitea.log <== 2020/03/31 00:24:37 ...m.io/xorm/core/db.go:154:QueryContext() [I] [SQL] SELECT `id`, `type`, `name`, `is_actived`, `is_sync_enabled`, `cfg`, `created_unix`, `updated_unix` FROM `login_source` WHERE (is_actived = ? and type = ?) [true 6] - 761.432µs 2020/03/31 00:24:37 routers/user/auth.go:131:SignIn() [E] UserSignIn: Error 1040: Too many connections ``` also I cannot push any commits: ``` Gitea: Internal Server Error Unable to get repository: gsantner/myscripts Error 1040: Too many connections fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists ``` Note that I'm the only user of the server, service freshly started and it's not due fail2ban. ## Screenshots ![screenrecord](https://user-images.githubusercontent.com/6735650/77968334-9f55f580-72d6-11ea-948b-21e0397e1aa6.gif)
Author
Owner

@techknowlogick commented on GitHub (Mar 30, 2020):

This is an error your DB server is providing, so even though Gitea may be newly installed you could have other services connecting to your DB. If you run the query SHOW FULL PROCESSLIST as root mysql/mariadb user you'll see a list of connections against your DB and their current state.

@techknowlogick commented on GitHub (Mar 30, 2020): This is an error your DB server is providing, so even though Gitea may be newly installed you could have other services connecting to your DB. If you run the query `SHOW FULL PROCESSLIST` as root mysql/mariadb user you'll see a list of connections against your DB and their current state.
Author
Owner

@gsantner commented on GitHub (Mar 30, 2020):

Hi, I'm using gitea since it's beginning, and updating to master build weekly. This is definitely no "new installation".
My previous version was gitea-2020-03-28 running fine, so there might be a merged change these days resulting this.
(Notice that when I change back from gitea-2020-03-31 to gitea-2020-03-28 it works again. )

@gsantner commented on GitHub (Mar 30, 2020): Hi, I'm using gitea since it's beginning, and updating to master build weekly. This is definitely no "new installation". My previous version was gitea-2020-03-28 running fine, so there might be a merged change these days resulting this. (Notice that when I change back from gitea-2020-03-31 to gitea-2020-03-28 it works again. )
Author
Owner

@techknowlogick commented on GitHub (Mar 30, 2020):

My apologies I understood service freshly started as a a new installation. Either way, what does your DB say? Both of those days have had multiple PRs merged and so it is hard to say what specifically changed between those two days, would you be able to provide the specific commit for each of the versions?

@techknowlogick commented on GitHub (Mar 30, 2020): My apologies I understood `service freshly started` as a a new installation. Either way, what does your DB say? Both of those days have had multiple PRs merged and so it is hard to say what specifically changed between those two days, would you be able to provide the specific commit for each of the versions?
Author
Owner

@gsantner commented on GitHub (Mar 30, 2020):

service freshly started

Sorry, I meant i.e. systemctl restart gitea

Working version: .12.0+dev-49-g1737fca22
Broken version from today: 1.12.0+dev-70-gbf847b93

@gsantner commented on GitHub (Mar 30, 2020): > service freshly started Sorry, I meant i.e. `systemctl restart gitea` Working version: .12.0+dev-49-g1737fca22 Broken version from today: 1.12.0+dev-70-gbf847b93
Author
Owner

@techknowlogick commented on GitHub (Mar 30, 2020):

Here is the diff between those two commits: 1737fca22...bf847b93

@techknowlogick commented on GitHub (Mar 30, 2020): Here is the diff between those two commits: https://github.com/go-gitea/gitea/compare/1737fca22...bf847b93
Author
Owner

@gsantner commented on GitHub (Mar 30, 2020):

Normal state, currently nothing doing on gitea:

grafik

logging in webui (with todays build)

grafik

hm somehow login worked now, but did not work 3x before I reported this issue. Is there maybe some rare deadlock/infinite loop trying connecting to db? not sure

Sorry that I cannot give much meaningful input on this. By the way, thanks for your fast response!

@gsantner commented on GitHub (Mar 30, 2020): Normal state, currently nothing doing on gitea: ![grafik](https://user-images.githubusercontent.com/6735650/77969101-7c2c4580-72d8-11ea-92ed-c9333219ded4.png) logging in webui (with todays build) ![grafik](https://user-images.githubusercontent.com/6735650/77969402-315efd80-72d9-11ea-8342-d061bceea752.png) hm somehow login worked now, but did not work 3x before I reported this issue. Is there maybe some rare deadlock/infinite loop trying connecting to db? not sure Sorry that I cannot give much meaningful input on this. By the way, thanks for your fast response!
Author
Owner

@gsantner commented on GitHub (Mar 31, 2020):

ok error is there again, so seems like it starts showing up after some time

@gsantner commented on GitHub (Mar 31, 2020): ok error is there again, so seems like it starts showing up after some time
Author
Owner

@lunny commented on GitHub (Mar 31, 2020):

When gitea started, some internal tasks may work. Maybe we should focus on that.

@lunny commented on GitHub (Mar 31, 2020): When gitea started, some internal tasks may work. Maybe we should focus on that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5156