6 months ago
Hello Railway team,
I am trying to deploy a Python script in a Railway project (service: airwallex-sandbox-test) that needs to connect to the Airwallex API in sandbox mode using the endpoint https://api.sandbox.airwallex.com/api/v1/pa/payment_links/create
However, every time the script tries to connect, I receive this error:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.sandbox.airwallex.com', port=443): Max retries exceeded with url: /api/v1/pa/payment_links/create (Caused by NameResolutionError("<urllib3.connection.HTTPSConnection object at 0x...>: Failed to resolve 'api.sandbox.airwallex.com' ([Errno -2] Name or service not known)"))
- I have confirmed that my API Key and Client ID are correct.
- The same code works on my local machine (with VPN or international internet) and in other cloud environments.
- The error appears to be a DNS or outbound network issue on Railway's end for this domain.
- I am using the standard Python requests library.
Question:
Is there any known restriction or DNS block to api.sandbox.airwallex.com from Railway deployments?
Is there any way to enable outbound connectivity to this endpoint for sandbox testing?
Thank you in advance!
GitHub repo (if needed):https://github.com/cases777/airwallex-sandbox-test
Service: airwallex-sandbox-test
Region: us-east4-eqdc4a
(Logs attached as screenshots)
6 Replies
6 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
6 months ago
hi, that error means the domain points correctly but your service isn't reachable. double-check that your service is actually deployed and listening on the correct port and path (`/farmer-api/api/health`). make sure you're binding to `0.0.0.0` (not `localhost`) in your app. check your deployment logs for startup errors or port mismatches, then redeploy so the domain becomes accessible.
6 months ago
The domain api.sandbox.airwallex.com doesnt seems to exist. Based on this 
https://www.airwallex.com/docs/developer-tools__sandbox-environment-overview
it should rather be https://api-demo.airwallex.com.
6 months ago
Cases777, please ensure that you are using a port number above 5000, as ports below that are reserved for internal routing and traffic management. So, follow these steps:
a. Select the desired service in Railway
b. Settings -> Public Networking
c. Edit the "already generated" public domain! And provide a PORT number > 5000, maybe 7171 (anything, it's up to you)
Do let me know if that works
6 months ago
Did that help, cases777
6 months ago
Hello! This is a frustrating networking issue, and your diagnosis is correct—it points directly to a DNS problem within the Railway environment.
In simple terms, the error Name or service not known means that when your app tried to look up the IP address for api.sandbox.airwallex.com, the network's "address book" (DNS) couldn't find an entry. Since your code works everywhere else, the problem isn't your code.
This is often a temporary network glitch within the specific data center region your service is running in. It's very unlikely that Railway is intentionally blocking this domain.
Here are the two most effective ways to fix this:
1. Trigger a Redeployment
The simplest fix is often just to redeploy your service. This can move your container to a different physical server within the same region, which might have a healthy connection to the DNS servers.
2. Change Your Service's Region
If redeploying doesn't work, the issue might be specific to the us-east4 region. Moving your service to a different region (like us-west) will use a completely different network path and will almost certainly resolve the problem.
Go to your service's settings in Railway.
Click on the General tab.
You will see an option to Change Region. Select a new one and redeploy.
This should establish a fresh, working connection and allow your app to resolve the Airwallex domain.
Helpful Articles
What is DNS? (Cloudflare): A great, simple explanation of what DNS is and why errors like this can happen. https://www.cloudflare.com/learning/dns/what-is-dns/
Railway Docs on Services: This will show you where to find the "Change Region" setting mentioned above. https://docs.railway.app/develop/services