Philip Mutua
Philip Mutua

Reputation: 6891

Aborted connection 3 to db: 'default_schema' user: 'root' host: 'X.X.X.X' (Got an error reading communication packets)

I am running Django in a docker container and also I have MYSQL container running as well when I try to make a GET request I get the following from the logs. I have tried to add --max_allowed_packet=1073741824 in my docker-compose file but I still get the same error.

.....
  db:
    restart: always
    image: mysql:5.7

    command: --max_allowed_packets=1073741824

    environment:
      MYSQL_ROOT_PASSWORD: ***
      MYSQL_DATABASE: default_schema
      MYSQL_USER: ****
      MYSQL_PASSWORD: ****
.....

Logs

    Aborted connection 3 to db: 'default_schema' user: 'root' host: 'X.X.0.X' (Got an error reading communication packets)

 How do i fix it?

Upvotes: 1

Views: 6879

Answers (3)

Marty
Marty

Reputation: 621

Regarding docker specifically, this may be of help:

First of all please change the root pw in the docker-compose yaml. Then try to create the volumes in another directory, for example /opt/monicahq or something like that. Docker can have problems with permissions in user based directorys.

https://github.com/monicahq/monica/issues/2989

Upvotes: 1

Philip Mutua
Philip Mutua

Reputation: 6891

I implemented pagination in the backend server and this problem was resolved.

Upvotes: 2

spike 王建
spike 王建

Reputation: 1714

aborted clients usually occured when connected to db but closed db improperly, such as:

  1. forget to close connection
  2. idle duration great than wait_timeout or interactive_timeout
  3. During the transmission of data, client shut down the connection
  4. clients received data length great than max_allowed_packet, and that your clients are not receiving a “packet too large” message

this article maybe help!

Upvotes: 2

Related Questions