404 Not Found on Port change DOCKER

Hi,
I’m trying to run the docker from the link GitHub - frappe/frappe_docker: Docker images for production and development setups of the Frappe framework and ERPNext
I had changed my port from 80:80 and 443:443 to 1430:80 and 1431:443 in docker-compose.yml

whenever I visit my site example erpnxt.domain.com:1430 it gives me 404 not found

Please help me to fix this problem… on my server port 80 and 443 is being used by apache

Can’t change ports in production.

Letsencrypt needs 80 and 443. There were similar posts on GitHub issues and forum

hi revant
I dont want https to be enabled as of now… im trying to get the work flow of erpnxt. How can i run with a different port?

edit

When i tried the same in the local host it worked
i.e. http://mysite.localhost:1430/#login

but its not working on my vps

try to publish ports of erpnext-nginx container directly. frappe_docker/docker-compose.yml at 1b942753ee3d734648e62d58fcbb4f4949325a94 · frappe/frappe_docker · GitHub

        ports:
          - "1430:80"

Thank you soo much!
That really worked :slight_smile:

when I tried this docker GitHub - pipech/erpnext-docker-debian: Self-contained ERPNext Docker Image base on Debian
it loads perfectly i.e, http://erpnxt.domain.com directly without any modification of ports

but when i try the official docker i get this error
ERROR: for traefik Cannot start service traefik: driver failed programming external connectivity on endpoint demo_traefik_1 (db603586de815b9a301689c3cc795ae539a9a5d58a18f52d66d6eddd238ee4b8): Error starting userland proxy: listen tcp 0.0.0.0:443: bind: address already in use

For this case where erpnext-nginx container is used directly without https, remove ports section from traefik container or remove the traefik service itself.

Thanks revant I get it

But what if I want SSL support?

right now I’m using a VPS that has Cpanel so ports 80 and 443 will be used by it…
is there any workaround? so that when I type http://erpnxt.domain.com/ I directly get the erpnxt
instead of http://erpnxt.domain.com:1430

when I use this image GitHub - pipech/erpnext-docker-debian: Self-contained ERPNext Docker Image base on Debian it directly loads from http://erpnxt.domain.com

I’ve not used cpanel

If at all cpanel can reverse proxy localhost:1430 when user tries to reach your erpnext site domain, try that?

Hi revant,

after doing this the chat is not working I get Request Timed Out every time I initiate a chat

console.log

jquery.min.js:4 POST https://erpnxt.domain.com/api/method/frappe.chat.doctype.chat_message.chat_message.send 504 (Gateway Time-out)

Reset all the configuration. Use traefik.

Try the following changes for traefik service:

image: "traefik:v2.2"
command:
  - "--log.level=DEBUG"
  - "--providers.docker=true"
  - "--providers.docker.exposedbydefault=false"
  - "--entrypoints.web.address=:1430"
labels:
  # enable traefik
  - "traefik.enable=true"
ports:
  - "1430:1430"
volumes:
  - /var/run/docker.sock:/var/run/docker.sock:ro

If you’re blindly trying any custom configuration, also refer traefik documentation for more complex configuration.

Traefik has label for custom headers that can be used. frappe_docker/pwd.yml at 29e727491b85d2753c697bf6b3cb7a59cf4f8b05 · frappe/frappe_docker · GitHub

Socketio/chat works for sites available under sites directory, you can pass host header to override any hostname.

CPanel + No https + frappe_docker, I’ve not installed.

Just for reference I recently installed Letsencrypt with containerized Traefik for native frappe/bench

Hi revant I just did a fresh install on my VPS and disabled apache just to check the ERPnxt
everything is working but chat is not working! how can I debug it?

I checked the socket.io logs
frappe.chat: Dispatching demo@demo.com typing to room erpnxt.domain.com:room:CR00001

it’s working perfectly but the messages are not being sent… I get

console shows
Failed to load resource: the server responded with a status of 504 (Gateway Timeout)
https://erpnxt.domain.com/api/method/frappe.chat.doctype.chat_message.chat_message.send

nginx log
2020/08/22 21:48:25 [error] 31#31: *345 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.20.0.14, server: $http_host, request: “POST /api/method/frappe.chat.doctype.chat_message.chat_message.send HTTP/1.1”, upstream: “http://172.20.0.11:8000/api/method/frappe.chat.doctype.chat_message.chat_message.send”, host: “erpnxt.domain.com”, referrer: “https://erpnxt.domain.com/desk

erpnxt-python log

[2020-08-22 21:56:57 +0000] [27] [ERROR] Error handling request /api/method/frappe.chat.doctype.chat_message.chat_message.send

Traceback (most recent call last):

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 713, in _write_bytes

self._sock.sendall(data)

ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/gunicorn/workers/gthread.py”, line 280, in handle

keepalive = self.handle_request(req, conn)

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/gunicorn/workers/gthread.py”, line 329, in handle_request

respiter = self.wsgi(environ, resp.start_response)

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/werkzeug/local.py”, line 231, in application

return ClosingIterator(app(environ, start_response), self.cleanup)

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/werkzeug/wrappers/base_request.py”, line 237, in application

resp = f(*args[:-2] + (request,))

File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 92, in application

frappe.db.rollback()

File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 772, in rollback

self.sql("rollback")

File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 153, in sql

self._cursor.execute(query)

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py”, line 170, in execute

result = self._query(query)

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/cursors.py”, line 328, in _query

conn.query(q)

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 516, in query

self._execute_command(COMMAND.COM_QUERY, sql)

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 771, in _execute_command

self._write_bytes(packet)

File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/pymysql/connections.py”, line 718, in _write_bytes

"MySQL server has gone away (%r)" % (e,))

pymysql.err.OperationalError: (2006, “MySQL server has gone away (ConnectionResetError(104, ‘Connection reset by peer’))”)

Mariadb seems to be off? Is Mariadb container running?

Maria db is running

here are the logs

2020-08-22 21:29:56 946 [Warning] Aborted connection 946 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got an error reading communication packets)

2020-08-22 21:29:56 944 [Warning] Aborted connection 944 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got an error reading communication packets)

2020-08-22 21:43:50 1156 [Warning] Aborted connection 1156 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got timeout reading communication packets)

2020-08-22 21:47:21 1327 [Warning] Aborted connection 1327 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got timeout reading communication packets)

2020-08-22 21:49:59 1384 [Warning] Aborted connection 1384 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got timeout reading communication packets)

2020-08-22 21:56:25 1492 [Warning] Aborted connection 1492 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got timeout reading communication packets)

2020-08-22 22:17:10 1750 [Warning] Aborted connection 1750 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got timeout reading communication packets)

2020-08-22 22:17:11 1751 [Warning] Aborted connection 1751 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got timeout reading communication packets)

2020-08-22 22:17:12 1752 [Warning] Aborted connection 1752 to db: ‘_69928f0f6369849a’ user: ‘_69928f0f6369849a’ host: ‘172.20.0.11’ (Got timeout reading communication packets)

I’m not able to reproduce the issue.

Hi @revant_one

Needed your help on one thing! I’ve currently ERPNext production with public IP and DNS records set. Its running perfect on local network but to make it accessible over internet, I need to change the port from 80 & 443 to 8080 & 4443 since on the external 443, our exchange server is running and that port can’t be freed up.

Please help how can I change the port from 443 to 4443!