Reputation: 6891
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
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
Reputation: 6891
I implemented pagination in the backend server and this problem was resolved.
Upvotes: 2
Reputation: 1714
aborted clients usually occured when connected to db but closed db improperly, such as:
wait_timeout
or interactive_timeout
max_allowed_packet
, and that your clients are not receiving a “packet too large” messagethis article maybe help!
Upvotes: 2