R
Railway14mo ago
shwld

upstream connect error or disconnect/reset before headers. reset reason: protocol error

I have deployed an API created in Node.js on Railway and am getting errors trying to call it from a desktop app created in Tauri. Can you please help? When I call the API from Tauri, I am getting the error 502 upstream connect error or disconnect/reset before headers. reset reason: protocol error in the preflight request. If I deploy the same application to Heroku, it works fine.
18 Replies
Percy
Percy14mo ago
Project ID: e62600cd-1d5d-43f5-a38b-69f1d9ca4d96
shwld
shwldOP14mo ago
e62600cd-1d5d-43f5-a38b-69f1d9ca4d96
Brody
Brody14mo ago
does it work fine if you call it via postman
shwld
shwldOP14mo ago
Yes, I tried with Postman, but I get a 502 upstream connect error or disconnect/reset before headers. reset reason: protocol error error
Brody
Brody14mo ago
what kind of api is this
shwld
shwldOP14mo ago
GraphQL API server built with fastify and graphql-yoga.
Brody
Brody14mo ago
what protocol does it use
shwld
shwldOP14mo ago
https. I just changed it to http and postman returned status200.
Brody
Brody14mo ago
perfect, yep you can only run an http app to access it externally from https
shwld
shwldOP14mo ago
I'm sorry, I'm a little confused. when I run it in postman on http it works fine, but on https I get a 502. I want to access it on https, does that mean I have to go to http? Also, I tried it with a non-postman client and got a 502 even with the http protocol!
Brody
Brody14mo ago
your app needs to run as http, railway does the https for you
shwld
shwldOP14mo ago
Yes, the API server itself is running at http and can also be connected to from the outside via https: https://revelup-noteapi-production.up.railway.app/ However, OPTIONS requests from postman to this API server result in a 502.
Brody
Brody14mo ago
what endpoint should i test to get a 502?
Brody
Brody14mo ago
that gives me a 301, i will use https using https gives me a 502, i will see if i can reproduce this if i cant reproduce this, that just means its an issue with your code (heroku would be monkey patching it, railway runs your code as is) will get back to you on this though
shwld
shwldOP14mo ago
Thank you. I will continue to check on the code here as well.
Brody
Brody14mo ago
@shwld i cant reproduce this, it would be an issue with your code, unfortunately I have no idea what the issue is
shwld
shwldOP14mo ago
@Brody Thanks, I'll review the code.
Want results from more Discord servers?
Add your server