5 months ago
I am encountering a persistent httpx.ConnectError: [Errno -3] Temporary failure in name resolution error when deploying my Python Telegram bot application on Railway using a Dockerfile.
Problem Description:
My application uses the httpx library to make outbound HTTP requests, specifically to access the Google Sheets API. When deployed via Dockerfile on Railway, the application fails with the following error during runtime:
httpx.ConnectError: [Errno -3] Temporary failure in name resolution
This error indicates a DNS resolution problem, suggesting that the Docker container is unable to resolve domain names (e.g., googleapis.com).
Deployment Methods and Errors Encountered:
Dockerfile Deployment: Using a standard Dockerfile (provided below), I encounter the httpx.ConnectError.
Procfile Deployment: When deploying using a Procfile, I encounter a MemoryError during Google Sheets initialization, which seems to be a separate issue related to memory limits.
Dockerfile Content:
FROM python:3.9-slim-buster
WORKDIR /app
COPY requirements.txt ./
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "main.py"]
I reviewed the "Public Networking" documentation but did not find specific settings related to Docker DNS configuration.
I have a few questions:
What is the recommended way to configure DNS settings for Docker containers deployed on Railway? Is using Docker run arguments (--dns) the correct approach, or is there a different method specific to Railway?
Are there any known DNS resolution issues or network restrictions within the Railway Docker environment that could be causing this error?
Could you please provide guidance on how to diagnose and resolve this httpx.ConnectError: [Errno -3] Temporary failure in name resolution error in my Railway Docker deployment?
Are there any specific Railway configurations or settings I need to adjust to ensure proper outbound network access and DNS resolution for my Docker containers?
ⓘ Deployment information is only viewable by project members and Railway employees.
0 Replies