go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.07k stars 5.49k forks source link

UserSignIn: Error 1040: Too many connections #10898

Closed gsantner closed 4 years ago

gsantner commented 4 years ago

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

techknowlogick commented 4 years ago

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.

gsantner commented 4 years ago

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. )

techknowlogick commented 4 years ago

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?

gsantner commented 4 years ago

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

techknowlogick commented 4 years ago

Here is the diff between those two commits: https://github.com/go-gitea/gitea/compare/1737fca22...bf847b93

gsantner commented 4 years ago

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 4 years ago

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

lunny commented 4 years ago

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