a year ago
Hi,
I've moved my nodejs project from US-WEST to EU and started getting 405 errors.
Before moving - I tested the site and it worked.
After moving any post call gets a 405
I tried moving back and forth - still 405
I tried deploying another simple site - 405 on every post.
I've reviewed the article:
https://docs.railway.com/reference/errors/405-method-not-allowed
And previouls correspondences.
I made sure I'm calling with HTTPS
You can easily experience it by going to the following url, and see in the network tab that it gets a 405 on the post:
https://crm-demo.up.railway.app/
Also - I no longer see any console.log that my app does in the logs - not sure why - and it is important for me - I looked in the deployment logs.
When using the log explorer to search furhter down history - I see the ones that were written prior to moving to EU
context - I've been using railway a lot - but in the last 8 month didn't deploy anything - so I may not be aware of new things that I've missed
6 Replies
a year ago
Hello,
405 would be a status code that your application is returning, thus outside of what we can help with.
I've gone ahead and put a bounty on this thread so that a community member may come and help debug this application level issue.
Best,
Brody
Status changed to Awaiting User Response Railway • about 1 year ago
brody
Hello, 405 would be a status code that your application is returning, thus outside of what we can help with. I've gone ahead and put a bounty on this thread so that a community member may come and help debug this application level issue. Best, Brody
a year ago
I investigated a bit furher, and I have another couriosity that may be a contributing factor - on projects that fail 405 - the deploy log looks like this:
Starting Container
using config from file
adapted config to JSON
admin endpoint disabled
automatic HTTPS is completely disabled for server
started background certificate maintenance
server running
serving initial configuration
cleaning storage unit
finished cleaning storage units
handled request
On another super simple node js - I see the normal console logsץ
So here's my question - could it be that because my site is a combination of static html generated by vite in the dist folder, and a node js application that serves them + api etc.... railway treats it as a static site and doesn't run npm run start - that would explain why post wouldn't work and why none of my console logs are being printed - is that in the right direction?
brody
Try switching the builder to Railpack in the service settings.
a year ago
seems to work.
Was I on the right track in terms that it identifies it as a static site and not a node js site? and doesn't run npm run start? can you send me in the direction of some relevant docs?
a year ago
You are spot on.
Nixpacks was a bit over zealous on SPA detection, Railpack has better detection for what should and shouldn't be an SPA.
https://nixpacks.com/docs/providers/node#spa-application-support
brody
You are spot on. Nixpacks was a bit over zealous on SPA detection, Railpack has better detection for what should and shouldn't be an SPA. <https://nixpacks.com/docs/providers/node#spa-application-support>
a year ago
Thanks - you were super helpful
Status changed to Solved chandrika • about 1 year ago
