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

1 messages · Page 1 of 1 (latest)

olive kindle
#

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?

plucky sinewBOT
#

Project ID: N/A

olive kindle
#

N/A

inland field
#

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

olive kindle
#

Thanks @inland field , is this something I have to fix on my server side then with my app?

inland field
#

update your app to make requests with http 1.1 minimum

olive kindle
#

I'll give it a shot, thanks @inland field for confirming it's something on my end

inland field
#

no problem

olive kindle
#

I'm still struggling with this @inland field 😅 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'

inland field
#

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?

olive kindle
#

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.

inland field
#

browser fetch, or node fetch?

olive kindle
#

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

inland field
#

what proxy? nginx, caddy, etc

olive kindle
#

and in their documentation, they make it seem like they use HTTP/1.1 for their proxy

#

Shopify has a built in proxy handling

inland field
#

tbh i did not know you could self host shopify

olive kindle
#

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

inland field
#

work through the call chain and see what is making the http 1.0 call

olive kindle
#

seems like i found this post too:

inland field
#

obviously http 1.0 would work on your dev server, but railway has disabled http 1.0 for hopefully obvious reasons

olive kindle
#

yeah 😛

inland field
#

im shocked that something in 2023 is still sending an http 1.0 request

olive kindle
#

yeah, I don't know enough about it myself to even pinpoint where the issue is

inland field
#

is there an update to shopify that you could deploy?

olive kindle
#

it's my first time using a proxy for an app

#

I'm not sure, let me check on their help slack server

inland field
#

cloudflare will still accept http 1.0, so just put cloudflare in front of your railway app and problem solved

olive kindle
#

perfect

#

we have cloudflare, so we were going to try that

#

I'll get back to you tomorrow and see if it works!

inland field
#

ive just confirmed it
https://devicons-production.up.railway.app/ -> 426
cloudflare -> https://devicons.railway.app/ -> 200

olive kindle
#

great!

#

code 426 or 429?

inland field
#

lol yeah 426, my bad

olive kindle
#

you're a lifesaver, I'll get back to you tomorrow and see if this works!

inland field
#

awsome

olive kindle
#

@inland field were there any specific settings you had to enable for cloudflare to also recognize HTTP 1.0? or just pointed your site to cloudflare?

inland field
#

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

olive kindle
#

ok 🙂

inland field
#

locked, that explains it

olive kindle
#

haha

#

i wanted to post my solution in case anyone else had this issue

inland field
#

I must have done that, my mobile app bugged

olive kindle
#

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

inland field
#

awesome, full is what railway recommends

#

sorry that I didn't bring up cloudflare sooner

olive kindle
#

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!

inland field
#

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

olive kindle
#

haha all good!

olive kindle
#

It worked on our live url!

inland field
#

yippie

olive kindle
#

Thanks again @inland field !

inland field
#

happy to help

olive kindle
#

@inland field hey brody, can you hop on a call with me real quick to discuss some pricing?

inland field
#

I am a conductor

#

plus I don't have a mic plus I don't like talking

olive kindle
#

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

inland field
#

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

olive kindle
#

yes, ok that helps

inland field
#

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

olive kindle
#

thanks @inland field 🙂

inland field
#

did that clear everything up?

olive kindle
#

yes! thank you