8 months ago
Good afternoon,
I’ve deployed my project which includes a Backend (Entity Framework 8), Frontend (Angular 19), and MySQL database — all hosted on Railway.
Everything works correctly when tested locally:
The backend is functioning as expected when tested via Postman.
The frontend also works fine when I run it locally and point it to the published backend.
However, when I try to access the backend from the deployed frontend, I receive an error. Could you please help me understand what might be causing this issue?
Thank you in advance.
Attachments
8 Replies
8 months ago
I'm seeing the following error in your backend service: Exception occurred: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
Status changed to Awaiting User Response Railway • 8 months ago
8 months ago
You can see this in the logs for the backend deployment
8 months ago
This is my backend application. I created a JobScheduler (using AddHostedService) that runs every 1 minute, checking if there are students with the status "ProcurandoAgendamento" (SearchingForAppointment). If there are, it calls an endpoint and continues the process. That’s why you’re seeing these requests.
Is this not allowed? Do I need to increase the execution interval?
Status changed to Awaiting Railway Response Railway • 8 months ago
8 months ago
Another detail: I tested it locally (using VS Code) pointing to the published backend, and it worked fine. I also tested it via Postman and it worked as expected.
8 months ago
i can help you out in this case as i also faced the same issue once if you can add me as collaborator for a while in repo i can fix the issue
8 months ago
What you need to do is to check the frontend configurations from railway. Since you can access the backend locally and from postman, then the backend is accessible. Just make sure that the angular frontend is configured to point to the right backend url. Which since both the frontend and backend is deployed on railway, I assume you should be able to use the backend's private railway url to access the backend from the frontend.
8 months ago
"Is this not allowed? Do I need to increase the execution interval?"
100 seconds is already a lot. Make sure your credentials are correct - where are you storing them? Also correct endpoints are configured. Do these timeouts occur when the ProcurandoAgendamento is true or every minute as per schedule?
8 months ago
The image you attached is saying to check the deploy logs, can you share with us what those are?