Reece
Reece
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
You should be using a start script for your app. You should not be running alembic in the docker file since it will only perform migrations when the container builds and not when the container is run. The startup script may look something like:
#!/bin/sh
set -e

PORT=${PORT:-8001}

alembic upgrade head

uvicorn app.main:app --host "::" --port "$PORT"
#!/bin/sh
set -e

PORT=${PORT:-8001}

alembic upgrade head

uvicorn app.main:app --host "::" --port "$PORT"
Then update the dockerfile to look something like:
FROM python:3.11

WORKDIR /app

COPY . /app

RUN pip install --no-cache -r requirements.txt

CMD ["/bin/sh", "/app/start.sh"]
FROM python:3.11

WORKDIR /app

COPY . /app

RUN pip install --no-cache -r requirements.txt

CMD ["/bin/sh", "/app/start.sh"]
As for why your app won't start, there are a few possible causes: - Does your app have an app module? If it does then in your source code root directory you will have a directory called app with a file called __init__.py in it. - If you have any life cycle hooks (on startup, on shutdown) make sure that you are not stopping the server - It is possible that you are doing something in your code that causes the worker process to be killed. This can happen if you allocate too much memory or use bugged python APIs. For example, I had an issue a couple years ago where using Thread and ThreadPoolExecutor in the same process caused python to silently shutdown like you are experiencing now. - If your asgi config is invalid, for example you have workers set to 0.
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
Or threads?
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
Are you using multiprocessing or async or both?
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
It uses xmlrpc.server.SimpleXMLRPCServer. When they construct the server they use a ipv4-style tuple (len = 2) and not a ipv6-style tuple (len = 4) https://stackoverflow.com/questions/5358021/establishing-an-ipv6-connection-using-sockets-in-python https://github.com/unoconv/unoserver/blob/master/src/unoserver/server.py#L88
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
Thanks for the help gang. Got it to work. Unfortunately unoserver only supports ipv4 address binding so I had to use socat to create a dual-stack proxy in the docker container, but it works now! Appreciate the help!
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
neato
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
ah interesting did not know that private networking requires ipv6 address binding. Let me try that. Here is a link to unoserver. It is a document conversion service. https://github.com/unoconv/unoserver
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
That error was when I used the private URL. (unoserver.railway.internal)
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
Long after the worker starts
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
The connection is established only when a job is sent to the worker
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
Frontend + Backend API + Backend Worker + Redis + Postgres + Custom Dockerfile
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
Yeah
44 replies
RRailway
Created by Reece on 2/11/2024 in #✋|help
Private Networking XMLRPC Server Connection Refused
46739752-566e-4538-85f5-d14c35ae1073
44 replies