frappe / frappe_docker

Docker images for production and development setups of the Frappe framework and ERPNext
MIT License
1.52k stars 1.4k forks source link

Got an error reading communication packets #1405

Closed neutralboy closed 5 months ago

neutralboy commented 5 months ago

Description of the issue

The docker compose pwd.yaml is broken. When the docker compose is run erpnext and frappe apps are successfully installed. This means that the frontend is also accessible on port 8080 as expected. Any action taken on it leads to an internal error. The frontend just logs that the upstream disconnected abruptly. However the DB logs as below:

db-1            | 2024-06-05  7:30:31 8 [Warning] Aborted connection 8 to db: '_5e5899d8398b5f7b' user: '_5e5899d8398b5f7b' host: '172.19.0.11' (Got an error reading communication packets)

Context information (for bug reports)

I am running the pwd.yaml found in the main branch of this repo. I have made no changes and I ran the command with

docker compose -f ./pwd.yaml up

I am on Ubuntu 22 with docker and compose plugin installed.

Steps to reproduce the issue

  1. Clone the repo onto the machine
  2. Run docker compose -f ./pwd.yaml

Observed result

image

2024/06/05 07:39:41 [error] 9#9: *37 upstream prematurely closed connection while reading response header from upstream, server: frontend, request: "POST /api/method/frappe.desk.page.setup_wizard.setup_wizard.load_languages HTTP/1.1", upstream: "http://localhost:8000/api/method/frappe.desk.page.setup_wizard.setup_wizard.load_languages", host: "localhost:8080", referrer: "http://localhost:8080"

Expected result

That I can login and make it work

neutralboy commented 5 months ago

So I investigated further to see what could be going on and the backend container does not have show any log when the event happens

[2024-06-05 16:44:54 +0000] [1] [INFO] Starting gunicorn 22.0.0
[2024-06-05 16:44:54 +0000] [1] [INFO] Listening at: http://0.0.0.0:8000 (1)
[2024-06-05 16:44:54 +0000] [1] [INFO] Using worker: gthread
[2024-06-05 16:44:54 +0000] [7] [INFO] Booting worker with pid: 7
[2024-06-05 16:44:54 +0000] [8] [INFO] Booting worker with pid: 8

I also checked frappe.web.log at /home/frappe/frappe-bench/sites/frontend/logs It is empty

neutralboy commented 5 months ago

So turns out I had memory limits turned on for container which abruptly caused the container process to exit and restart immediately. This meant that it would result in the above errors.