[GH-ISSUE #2838] Got an error reading communication packets #1950

Closed
opened 2026-02-26 07:33:23 +03:00 by kerem · 4 comments
Owner

Originally created by @radaniba on GitHub (Apr 18, 2023).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2838

Hi everyone
I am using npm deployed through a portainer stack. Everything worked fine until I had to upgrade my server for more resources.
On stack restarts, i lost connection to npm and it didn't want to start over. I rebuilt the stack hoping to still have access to my data.
The stack went up, docker images started fine, but when I login to my admin I have the "bad gateway" error message in the login screen
I checked the logs for the db and I have these messages

2023-04-18  3:44:48 5 [Warning] Aborted connection 5 to db: 'npm' user: 'npm' host: '172.21.0.3' (Got an error reading communication packets)

my docker compose is classic

version: "3.3"
services:
  npm-app:
    image: 'jc21/nginx-proxy-manager:2.9.18'
    container_name: npm-app
    restart: unless-stopped
    ports:
      - '8081:80' # Public HTTP Port
      - '443:443' # Public HTTPS Port
      - '81:81' # Admin Web Port
      # Add any other Stream port you want to expose
      # - '21:21' # FTP
    environment:
      DB_MYSQL_HOST: "npm-db"
      DB_MYSQL_PORT: 3306
      DB_MYSQL_USER: "npm"
      DB_MYSQL_PASSWORD: ${DB_MYSQL_PASSWORD}
      DB_MYSQL_NAME: "npm"
      LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL}
      # Uncomment the line below if IPv6 is not enabled on your host
      # DISABLE_IPV6: 'true'
    volumes:
      - ./npm-data:/data:Z
      - ./letsencrypt:/etc/letsencrypt:Z
    depends_on:
      - npm-db
    networks:
      - npm-network
      - npm-internal

  npm-db:
    image: 'mariadb:latest'
    container_name: npm-db
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_DATABASE: 'npm'
      MYSQL_USER: 'npm'
      MYSQL_PASSWORD: ${DB_MYSQL_PASSWORD}
    volumes:
      - ./npm-data/mysql:/var/lib/mysql:Z
    networks:
      - npm-internal

networks:
  npm-internal:
  npm-network:
    external: true

I am thinking maybe because of the restart, something went wrong with the db .

On the app side log I have some permission denied errors

[4/18/2023] [3:52:35 AM] [Global   ] › ✖  error     create table `migrations` (`id` int unsigned not null auto_increment primary key, `name` varchar(255), `batch` int, `migration_time` timestamp) - ER_CANT_CREATE_TABLE: Can't create table `npm`.`migrations` (errno: 13 "Permission denied")

Any idea on how to save my admin session without losing data ?

Thanks

Originally created by @radaniba on GitHub (Apr 18, 2023). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2838 Hi everyone I am using npm deployed through a portainer stack. Everything worked fine until I had to upgrade my server for more resources. On stack restarts, i lost connection to npm and it didn't want to start over. I rebuilt the stack hoping to still have access to my data. The stack went up, docker images started fine, but when I login to my admin I have the **"bad gateway"** error message in the login screen I checked the logs for the db and I have these messages ``` 2023-04-18 3:44:48 5 [Warning] Aborted connection 5 to db: 'npm' user: 'npm' host: '172.21.0.3' (Got an error reading communication packets) ``` my docker compose is classic ``` version: "3.3" services: npm-app: image: 'jc21/nginx-proxy-manager:2.9.18' container_name: npm-app restart: unless-stopped ports: - '8081:80' # Public HTTP Port - '443:443' # Public HTTPS Port - '81:81' # Admin Web Port # Add any other Stream port you want to expose # - '21:21' # FTP environment: DB_MYSQL_HOST: "npm-db" DB_MYSQL_PORT: 3306 DB_MYSQL_USER: "npm" DB_MYSQL_PASSWORD: ${DB_MYSQL_PASSWORD} DB_MYSQL_NAME: "npm" LETSENCRYPT_EMAIL: ${LETSENCRYPT_EMAIL} # Uncomment the line below if IPv6 is not enabled on your host # DISABLE_IPV6: 'true' volumes: - ./npm-data:/data:Z - ./letsencrypt:/etc/letsencrypt:Z depends_on: - npm-db networks: - npm-network - npm-internal npm-db: image: 'mariadb:latest' container_name: npm-db restart: unless-stopped environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_DATABASE: 'npm' MYSQL_USER: 'npm' MYSQL_PASSWORD: ${DB_MYSQL_PASSWORD} volumes: - ./npm-data/mysql:/var/lib/mysql:Z networks: - npm-internal networks: npm-internal: npm-network: external: true ``` I am thinking maybe because of the restart, something went wrong with the db . On the app side log I have some permission denied errors ``` [4/18/2023] [3:52:35 AM] [Global ] › ✖ error create table `migrations` (`id` int unsigned not null auto_increment primary key, `name` varchar(255), `batch` int, `migration_time` timestamp) - ER_CANT_CREATE_TABLE: Can't create table `npm`.`migrations` (errno: 13 "Permission denied") ``` Any idea on how to save my admin session without losing data ? Thanks
kerem 2026-02-26 07:33:23 +03:00
  • closed this issue
  • added the
    stale
    bug
    labels
Author
Owner

@radaniba commented on GitHub (Apr 18, 2023):

I investigated a bit further and managed to make it work by separating the folders for app and database in the volumes, so to realize that it is a new fresh mysql container that I have and it is not pointing to my old data.

I tried naively to copy the mysql folder on my host to the new mount point but I got this error

2023-04-18  5:41:08 185 [Warning] Access denied for user 'npm'@'172.25.0.3' (using password: YES)

I think the host changed from 172.25.0.3 to 172.25.0.2 and somehow it is still stored in the database tables (which ones I am not sure) so I have issues in the connections.

Do you guys have any ideas how I can safely restore my data stored in /data/compose/1/npm-data/mysql/ ?

<!-- gh-comment-id:1512467881 --> @radaniba commented on GitHub (Apr 18, 2023): I investigated a bit further and managed to make it work by separating the folders for app and database in the volumes, so to realize that it is a new fresh mysql container that I have and it is not pointing to my old data. I tried naively to copy the mysql folder on my host to the new mount point but I got this error ``` 2023-04-18 5:41:08 185 [Warning] Access denied for user 'npm'@'172.25.0.3' (using password: YES) ``` I think the host changed from 172.25.0.3 to 172.25.0.2 and somehow it is still stored in the database tables (which ones I am not sure) so I have issues in the connections. Do you guys have any ideas how I can safely restore my data stored in `/data/compose/1/npm-data/mysql/` ?
Author
Owner

@radaniba commented on GitHub (Apr 18, 2023):

Ok some updates on this in case you need similar solutions.
I was able to restore my data and proxies by following recommendation on other issues, and by changing permission level on the db image to mysql

This gave me access to all my proxies.

The problem that remains now is that I am not able to create new proxies anymore, especially when I ask for SSL certicates, I got internal problem issue that I am investigating now, any help would be welcome

[Express  ] › ⚠  warning   Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-21" --agree-tos --authenticator webroot --email "xxx@xxx.com" --preferred-challenges "dns,http" --domains "domain.name.masked"
<!-- gh-comment-id:1513239951 --> @radaniba commented on GitHub (Apr 18, 2023): Ok some updates on this in case you need similar solutions. I was able to restore my data and proxies by following recommendation on other issues, and by changing permission level on the db image to `mysql` This gave me access to all my proxies. The problem that remains now is that I am not able to create new proxies anymore, especially when I ask for SSL certicates, I got `internal problem` issue that I am investigating now, any help would be welcome ``` [Express ] › ⚠ warning Command failed: certbot certonly --config "/etc/letsencrypt.ini" --cert-name "npm-21" --agree-tos --authenticator webroot --email "xxx@xxx.com" --preferred-challenges "dns,http" --domains "domain.name.masked" ```
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2024):

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

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

@github-actions[bot] commented on GitHub (Mar 8, 2025):

Issue was closed due to inactivity.

<!-- gh-comment-id:2707881302 --> @github-actions[bot] commented on GitHub (Mar 8, 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#1950
No description provided.