Getting error: net::ERR_ABORTED 426, with Shopify app

I have a shopify app hosted on railway, and when calling any of my fetch requests through a proxy, I get a 426 error code. This error doesn't occur in my development environment. I found this post going over a fix: https://community.shopify.com/c/shopify-apps/app-proxy-only-works-with-ngrok-not-when-deployed/td-p/1645712 How can I fix this in railway?
App proxy only works with ngrok, not when deployed
Hello there   I have an app proxy setup which works perfectly fine in dev environment with ngrok.   When I deploy the app to my URL (and change the required settings) the app proxy stops forwarding requests - my server won't receive the request to perform validation and handle it further.   Chrome c...
56 Replies
Percy
Percy•2y ago
Project ID: N/A
OrangeFractal
OrangeFractalOP•2y ago
N/A
Brody
Brody•2y ago
railway does not support requests done with http 1.0, all requests must be at minimum done with http 1.1, this is not configurable
OrangeFractal
OrangeFractalOP•2y ago
Thanks @Brody , is this something I have to fix on my server side then with my app?
Brody
Brody•2y ago
update your app to make requests with http 1.1 minimum
OrangeFractal
OrangeFractalOP•2y ago
I'll give it a shot, thanks @Brody for confirming it's something on my end
Brody
Brody•2y ago
no problem
OrangeFractal
OrangeFractalOP•2y ago
I'm still struggling with this @Brody 😅 I'm wondering if you can help point me in a certain direction what is the HTTP protocol railway uses? I know you said a 'minimum of http 1.1'
Brody
Brody•2y ago
they will respond to http 1.1 and http 2, with http 1.0 you will get 429 - upgrade required, as you are seeing what exactly is making these http 1.0 requests?
OrangeFractal
OrangeFractalOP•2y ago
ok, thank you I have an app that makes a fetch request to send data to the backend of my app, based on what a site visitor does on a website.
Brody
Brody•2y ago
browser fetch, or node fetch?
OrangeFractal
OrangeFractalOP•2y ago
to capture that, and to keep it secure, the front end makes a fetch request to a proxy server, and then that proxy server makes the actual request browser fetch first, then to a proxy I have on Shopify
Brody
Brody•2y ago
what proxy? nginx, caddy, etc
OrangeFractal
OrangeFractalOP•2y ago
and in their documentation, they make it seem like they use HTTP/1.1 for their proxy Shopify has a built in proxy handling https://shopify.dev/docs/apps/online-store/app-proxies
Brody
Brody•2y ago
tbh i did not know you could self host shopify
OrangeFractal
OrangeFractalOP•2y ago
yeah, that's the only way for now they don't have app hosting yet I host one of my apps on railway for the last 4 or 5 months now, but that app didn't do anything that required proxying data and capturing actions visitors took on the customer-facing side of the website that's what this new app is trying to do and it works fine on my dev server, it's when i finally push everything to railway that I'm getting the error 426
Brody
Brody•2y ago
work through the call chain and see what is making the http 1.0 call
Brody
Brody•2y ago
obviously http 1.0 would work on your dev server, but railway has disabled http 1.0 for hopefully obvious reasons
OrangeFractal
OrangeFractalOP•2y ago
yeah 😛
Brody
Brody•2y ago
im shocked that something in 2023 is still sending an http 1.0 request
OrangeFractal
OrangeFractalOP•2y ago
yeah, I don't know enough about it myself to even pinpoint where the issue is
Brody
Brody•2y ago
is there an update to shopify that you could deploy?
OrangeFractal
OrangeFractalOP•2y ago
it's my first time using a proxy for an app I'm not sure, let me check on their help slack server
Brody
Brody•2y ago
cloudflare will still accept http 1.0, so just put cloudflare in front of your railway app and problem solved
OrangeFractal
OrangeFractalOP•2y ago
perfect we have cloudflare, so we were going to try that I'll get back to you tomorrow and see if it works!
Brody
Brody•2y ago
ive just confirmed it https://devicons-production.up.railway.app/ -> 426 cloudflare -> https://devicons.railway.app/ -> 200
OrangeFractal
OrangeFractalOP•2y ago
great! code 426 or 429?
Brody
Brody•2y ago
lol yeah 426, my bad
OrangeFractal
OrangeFractalOP•2y ago
you're a lifesaver, I'll get back to you tomorrow and see if this works!
Brody
Brody•2y ago
awsome
OrangeFractal
OrangeFractalOP•2y ago
@Brody were there any specific settings you had to enable for cloudflare to also recognize HTTP 1.0? or just pointed your site to cloudflare?
Brody
Brody•2y ago
I didn't setup cloudflare for that site, someone from the team did, and I can't imagine they would have went out of their way to enable http 1.0 support so it must have been enabled by default cloudflare would be far more equipped to handle potentially unsecure requests, so they probably have it on by default, but as always do your own testing and if you have to enable something then no biggie
OrangeFractal
OrangeFractalOP•2y ago
ok 🙂
Brody
Brody•2y ago
locked, that explains it
OrangeFractal
OrangeFractalOP•2y ago
haha i wanted to post my solution in case anyone else had this issue
Brody
Brody•2y ago
I must have done that, my mobile app bugged
OrangeFractal
OrangeFractalOP•2y ago
OrangeFractal
OrangeFractalOP•2y ago
in cloudflare it has to be set to full and it works, if it is on the default 'flexible' it wasn't working, so selecting full and probably even strict full would work but i don't want to deal with CA certs, that's the whole reason I'm not using digital ocean's database that's been a headache
Brody
Brody•2y ago
awesome, full is what railway recommends sorry that I didn't bring up cloudflare sooner
OrangeFractal
OrangeFractalOP•2y ago
all good! i had brought it up with my project manager a few hours ago as a possible solution, but he was logging off for the day, and we were going through so many possible fixes for the issue, it was forgotten until you mentioned it again! I'll test it for real tomorrow, for now it's on one of my own domains, but fingers crossed!
Brody
Brody•2y ago
let me know if everything is good when you have tested it, I promise I won't accidentally lock this thread again without realising it lmao
OrangeFractal
OrangeFractalOP•2y ago
haha all good! It worked on our live url!
Brody
Brody•2y ago
yippie
OrangeFractal
OrangeFractalOP•2y ago
Thanks again @Brody !
Brody
Brody•2y ago
happy to help
OrangeFractal
OrangeFractalOP•2y ago
@Brody hey brody, can you hop on a call with me real quick to discuss some pricing?
Brody
Brody•2y ago
I am a conductor plus I don't have a mic plus I don't like talking
OrangeFractal
OrangeFractalOP•2y ago
ah, all good 🙂 who would be the best person to chat with? my project manager is trying to compare apples to apples the Digital Ocean app plan vs using railway to host the app, and is concerned about the pricing is all
Brody
Brody•2y ago
well it sounds like you should be on the teams plan, I can tell you that much lol since I get the feeling you are developing a commercial product
OrangeFractal
OrangeFractalOP•2y ago
yes, ok that helps
Brody
Brody•2y ago
then on top of the seat price, you pay for your usage, and usage costs are the same across all plans, so you would likely already have an idea about usage costs
OrangeFractal
OrangeFractalOP•2y ago
thanks @Brody 🙂
Brody
Brody•2y ago
did that clear everything up?
OrangeFractal
OrangeFractalOP•2y ago
yes! thank you
Brody
Brody•2y ago
great! 🙂
Want results from more Discord servers?
Add your server