R
Railwayβ€’15mo ago
OrangeFractal

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β€’15mo ago
Project ID: N/A
OrangeFractal
OrangeFractalβ€’15mo ago
N/A
Brody
Brodyβ€’15mo 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
OrangeFractalβ€’15mo ago
Thanks @Brody , is this something I have to fix on my server side then with my app?
Brody
Brodyβ€’15mo ago
update your app to make requests with http 1.1 minimum
OrangeFractal
OrangeFractalβ€’15mo ago
I'll give it a shot, thanks @Brody for confirming it's something on my end
Brody
Brodyβ€’15mo ago
no problem
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo 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
OrangeFractalβ€’15mo 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β€’15mo ago
browser fetch, or node fetch?
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo ago
what proxy? nginx, caddy, etc
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo ago
tbh i did not know you could self host shopify
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo ago
work through the call chain and see what is making the http 1.0 call
Brody
Brodyβ€’15mo ago
obviously http 1.0 would work on your dev server, but railway has disabled http 1.0 for hopefully obvious reasons
OrangeFractal
OrangeFractalβ€’15mo ago
yeah πŸ˜›
Brody
Brodyβ€’15mo ago
im shocked that something in 2023 is still sending an http 1.0 request
OrangeFractal
OrangeFractalβ€’15mo ago
yeah, I don't know enough about it myself to even pinpoint where the issue is
Brody
Brodyβ€’15mo ago
is there an update to shopify that you could deploy?
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo ago
cloudflare will still accept http 1.0, so just put cloudflare in front of your railway app and problem solved
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo ago
ive just confirmed it https://devicons-production.up.railway.app/ -> 426 cloudflare -> https://devicons.railway.app/ -> 200
OrangeFractal
OrangeFractalβ€’15mo ago
great! code 426 or 429?
Brody
Brodyβ€’15mo ago
lol yeah 426, my bad
OrangeFractal
OrangeFractalβ€’15mo ago
you're a lifesaver, I'll get back to you tomorrow and see if this works!
Brody
Brodyβ€’15mo ago
awsome
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo 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
OrangeFractalβ€’15mo ago
ok πŸ™‚
Brody
Brodyβ€’15mo ago
locked, that explains it
OrangeFractal
OrangeFractalβ€’15mo ago
haha i wanted to post my solution in case anyone else had this issue
Brody
Brodyβ€’15mo ago
I must have done that, my mobile app bugged
OrangeFractal
OrangeFractalβ€’15mo ago
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo ago
awesome, full is what railway recommends sorry that I didn't bring up cloudflare sooner
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo 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
OrangeFractalβ€’15mo ago
haha all good! It worked on our live url!
Brody
Brodyβ€’15mo ago
yippie
OrangeFractal
OrangeFractalβ€’15mo ago
Thanks again @Brody !
Brody
Brodyβ€’15mo ago
happy to help
OrangeFractal
OrangeFractalβ€’15mo ago
@Brody hey brody, can you hop on a call with me real quick to discuss some pricing?
Brody
Brodyβ€’15mo ago
I am a conductor plus I don't have a mic plus I don't like talking
OrangeFractal
OrangeFractalβ€’15mo 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β€’15mo 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
OrangeFractalβ€’15mo ago
yes, ok that helps
Brody
Brodyβ€’15mo 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
OrangeFractalβ€’15mo ago
thanks @Brody πŸ™‚
Brody
Brodyβ€’15mo ago
did that clear everything up?
OrangeFractal
OrangeFractalβ€’15mo ago
yes! thank you
Brody
Brodyβ€’15mo ago
great! πŸ™‚