[GH-ISSUE #1545] Knex: Timeout acquiring a connection. #1175

Closed
opened 2026-02-26 06:36:04 +03:00 by kerem · 11 comments
Owner

Originally created by @TheSamDickey on GitHub (Nov 2, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1545

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you're not using someone else's docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Hello! I was doing my regular docker updates, and updated using the :latest tag. After updating, I have been unable to log into the admin panel.

In the admin panel, there is red text that says: Bad Gateway.

The docker logs have this:

[11/1/2021] [8:46:40 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
[11/1/2021] [8:47:41 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
[11/1/2021] [8:48:42 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
[11/1/2021] [8:49:43 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
[11/1/2021] [8:50:44 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?

I found a thread that seems to have solved the same issue. It might be relevant with solving the bug, although I haven't ever looked at the code for this project to know if it's useful or not.

Nginx Proxy Manager Version

v2.9.11

Other information

The database I'm using is jc21/mariadb-aria:latest. There are no errors in the log of the database. It is up to date as of the time of writing this.

Please let me know if there is any other information I can provide, and thank you to anyone who helps!

Originally created by @TheSamDickey on GitHub (Nov 2, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1545 **Checklist** - Have you pulled and found the error with `jc21/nginx-proxy-manager:latest` docker image? - Yes - Are you sure you're not using someone else's docker image? - Yes - Have you searched for similar issues (both open and closed)? - Yes Hello! I was doing my regular docker updates, and updated using the `:latest` tag. After updating, I have been unable to log into the admin panel. In the admin panel, there is red text that says: `Bad Gateway`. The docker logs have this: ``` [11/1/2021] [8:46:40 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? [11/1/2021] [8:47:41 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? [11/1/2021] [8:48:42 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? [11/1/2021] [8:49:43 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? [11/1/2021] [8:50:44 PM] [Global ] › ✖ error Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call? ``` I found a [thread](https://stackoverflow.com/questions/62912115/knex-timeout-acquiring-a-connection) that seems to have solved the same issue. It might be relevant with solving the bug, although I haven't ever looked at the code for this project to know if it's useful or not. **Nginx Proxy Manager Version** v2.9.11 **Other information** The database I'm using is `jc21/mariadb-aria:latest`. There are no errors in the log of the database. It is up to date as of the time of writing this. Please let me know if there is any other information I can provide, and thank you to anyone who helps!
kerem 2026-02-26 06:36:04 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@chaptergy commented on GitHub (Nov 2, 2021):

Hm, it seems this knex issue occures mostly with the pg package. The pg package is indeed installed, though I'm not sure why as it shouldn't be used. You could connect into the container and run yarn remove pg, and see if that fixes your issue.

<!-- gh-comment-id:957182466 --> @chaptergy commented on GitHub (Nov 2, 2021): Hm, it seems this knex issue occures mostly with the `pg` package. The `pg` package is indeed installed, though I'm not sure why as it shouldn't be used. You could connect into the container and run `yarn remove pg`, and see if that fixes your issue.
Author
Owner

@TheSamDickey commented on GitHub (Nov 3, 2021):

@chaptergy I tried that with no luck unfortunately.

Below is a little more information about the request that returns 502 Bad Gateway

General:

Request URL: http://192.168.0.56:8082/api/tokens
Request Method: POST
Status Code: 502 Bad Gateway
Remote Address: 192.168.0.56:8082
Referrer Policy: strict-origin-when-cross-origin

Response Headers:

Connection: keep-alive
Content-Length: 556
Content-Type: text/html
Date: Wed, 03 Nov 2021 22:00:26 GMT
Server: openresty

Request Headers:

Accept: application/json, text/javascript, */*; q=0.01
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Authorization: Bearer null
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 71
Content-Type: application/json; charset=UTF-8
Host: 192.168.0.56:8082
Origin: http://192.168.0.56:8082
Pragma: no-cache
Referer: http://192.168.0.56:8082/login
sec-gpc: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36

Request Payload:

{"identity":"redacted@gmail.com","secret":"redacted"}
<!-- gh-comment-id:960204268 --> @TheSamDickey commented on GitHub (Nov 3, 2021): @chaptergy I tried that with no luck unfortunately. Below is a little more information about the request that returns `502 Bad Gateway` #### General: ``` Request URL: http://192.168.0.56:8082/api/tokens Request Method: POST Status Code: 502 Bad Gateway Remote Address: 192.168.0.56:8082 Referrer Policy: strict-origin-when-cross-origin ``` #### Response Headers: ``` Connection: keep-alive Content-Length: 556 Content-Type: text/html Date: Wed, 03 Nov 2021 22:00:26 GMT Server: openresty ``` #### Request Headers: ``` Accept: application/json, text/javascript, */*; q=0.01 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9 Authorization: Bearer null Cache-Control: no-cache Connection: keep-alive Content-Length: 71 Content-Type: application/json; charset=UTF-8 Host: 192.168.0.56:8082 Origin: http://192.168.0.56:8082 Pragma: no-cache Referer: http://192.168.0.56:8082/login sec-gpc: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36 ``` #### Request Payload: ``` {"identity":"redacted@gmail.com","secret":"redacted"} ```
Author
Owner

@Ecalose commented on GitHub (Nov 4, 2021):

I also did have the problem,even I reinstall it

<!-- gh-comment-id:960567702 --> @Ecalose commented on GitHub (Nov 4, 2021): I also did have the problem,even I reinstall it
Author
Owner

@chaptergy commented on GitHub (Nov 4, 2021):

How have you configured the connection to the database? Via environment variables? or a config file?

<!-- gh-comment-id:960661413 --> @chaptergy commented on GitHub (Nov 4, 2021): How have you configured the connection to the database? Via environment variables? or a config file?
Author
Owner

@TheSamDickey commented on GitHub (Nov 5, 2021):

@Ecalose I've already had to wipe and set it all up before, it seems very unstable if that's the only solution again. It seems like there has to be a better solution.

@chaptergy It is set up using environment variables. Do you have any thoughts of what might be going wrong?

<!-- gh-comment-id:961570526 --> @TheSamDickey commented on GitHub (Nov 5, 2021): @Ecalose I've already had to wipe and set it all up before, it seems very unstable if that's the only solution again. It seems like there has to be a better solution. @chaptergy It is set up using environment variables. Do you have any thoughts of what might be going wrong?
Author
Owner

@chaptergy commented on GitHub (Nov 5, 2021):

Hm, I really don't, it seems everything you can find online either has to do with pg being the wrong version (which it does not seem to be if you have removed pg) or with SQLite if there are way to many requests queuing up

<!-- gh-comment-id:961853383 --> @chaptergy commented on GitHub (Nov 5, 2021): Hm, I really don't, it seems everything you can find online either has to do with `pg` being the wrong version (which it does not seem to be if you have removed `pg`) or with SQLite if there are way to many requests queuing up
Author
Owner

@TheSamDickey commented on GitHub (Nov 5, 2021):

I appreciate the help! I can't find anything either. For now, I'm going to set up a second instance with a new database so I can get my sites back online.

I'll keep the old instance ready to spin up. If someone else runs into the same problem, we can use this thread to continue troubleshooting.

<!-- gh-comment-id:962279189 --> @TheSamDickey commented on GitHub (Nov 5, 2021): I appreciate the help! I can't find anything either. For now, I'm going to set up a second instance with a new database so I can get my sites back online. I'll keep the old instance ready to spin up. If someone else runs into the same problem, we can use this thread to continue troubleshooting.
Author
Owner

@AiPacino commented on GitHub (Nov 14, 2021):

+1

<!-- gh-comment-id:968183578 --> @AiPacino commented on GitHub (Nov 14, 2021): +1
Author
Owner

@paulhendricksen commented on GitHub (Nov 28, 2021):

Hi everyone. I just did a fresh install, logged in, change the username and password for the default login. Knowing full well not to stack all my eggs in one basket, I decided to reboot the server as if I was doing a system-wide update. The docker container spun up but upon login, I wasn't able to get in with my new login and password nor the default. Some suggestions was firewalls, I am running the minimal server install and have not installed ufw yet.

I errors I see streaming when follow the logs are:
[11/27/2021] [11:48:18 PM] [Global ] › ✖ error getaddrinfo EAI_AGAIN db

I am not quite sure what is going on, either. I have a fresh install of Ubuntu 20.10, docker, compose installed and the instance was running fine until after reboot.

Because my setup is not very important, I will hold what I have to assist in the troubleshooting.

Compose was:

version: '3'
services:
  app:
    image: 'jc21/nginx-proxy-manager:latest'
    restart: always
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    environment:
      DB_MYSQL_HOST: "db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: "npm"
      DB_MYSQL_NAME: "npm"
    volumes:
      - ./data:/data
      - ./letsencrypt:/etc/letsencrypt
  db:
    image: 'jc21/mariadb-aria:latest'
    environment:
      MYSQL_ROOT_PASSWORD: 'npm'
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: 'npm'
    volumes:
      - ./data/mysql:/var/lib/mysql
<!-- gh-comment-id:980809718 --> @paulhendricksen commented on GitHub (Nov 28, 2021): Hi everyone. I just did a fresh install, logged in, change the username and password for the default login. Knowing full well not to stack all my eggs in one basket, I decided to reboot the server as if I was doing a system-wide update. The docker container spun up but upon login, I wasn't able to get in with my new login and password nor the default. Some suggestions was firewalls, I am running the minimal server install and have not installed ufw yet. I errors I see streaming when follow the logs are: `[11/27/2021] [11:48:18 PM] [Global ] › ✖ error getaddrinfo EAI_AGAIN db` I am not quite sure what is going on, either. I have a fresh install of Ubuntu 20.10, docker, compose installed and the instance was running fine until after reboot. Because my setup is not very important, I will hold what I have to assist in the troubleshooting. Compose was: ``` version: '3' services: app: image: 'jc21/nginx-proxy-manager:latest' restart: always ports: - '80:80' - '81:81' - '443:443' environment: DB_MYSQL_HOST: "db" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: "npm" DB_MYSQL_NAME: "npm" volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt db: image: 'jc21/mariadb-aria:latest' environment: MYSQL_ROOT_PASSWORD: 'npm' MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: 'npm' volumes: - ./data/mysql:/var/lib/mysql ```
Author
Owner

@github-actions[bot] commented on GitHub (Mar 2, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1974181130 --> @github-actions[bot] commented on GitHub (Mar 2, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@github-actions[bot] commented on GitHub (Apr 15, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2803559535 --> @github-actions[bot] commented on GitHub (Apr 15, 2025): Issue was closed due to inactivity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#1175
No description provided.