Server 499 Error Specifically when using Firefox

I am going to try to provide enough detail and info to make this (semi)-reproducible but there are a lot of factors at play so it might be tricky.

I have a full stack app build with React and Python. The front and back end are deployed separately, but both on Render. The domain is hosted with GoDaddy, and I am using a subdomain for the backend to avoid cookie issues.

My app works as expected in Chrome and Safari, but in Firefox I frequently get an error.

The two error messages I see are:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.torsera.com/process_story. (Reason: CORS request did not succeed). Status code: (null).

and

Error: 
Object { stack: "Fb@https://www.torsera.com/static/js/main.a32a5f2f.js:2:734425nOw</</m.onerror@https://www.torsera.com/static/js/main.a32a5f2f.js:2:751607nEventHandlerNonNull*Ow</<@https://www.torsera.com/static/js/main.a32a5f2f.js:2:751584nOw<@https://www.torsera.com/static/js/main.a32a5f2f.js:2:750679ne_@https://www.torsera.com/static/js/main.a32a5f2f.js:2:757729n_request@https://www.torsera.com/static/js/main.a32a5f2f.js:2:760570nrequest@https://www.torsera.com/static/js/main.a32a5f2f.js:2:759092nt/<@https://www.torsera.com/static/js/main.a32a5f2f.js:2:761020nJy/<@https://www.torsera.com/static/js/main.a32a5f2f.js:2:728072nWM@https://www.torsera.com/static/js/main.a32a5f2f.js:2:1231453nonClick@https://www.torsera.com/static/js/main.a32a5f2f.js:2:1234296nLe@https://www.torsera.com/static/js/main.a32a5f2f.js:2:39487nVe@https://www.torsera.com/static/js/main.a32a5f2f.js:2:39641n730/jr/<@https://www.torsera.com/static/js/main.a32a5f2f.js:2:59541njr@https://www.torsera.com/static/js/main.a32a5f2f.js:2:59635nFr@https://www.torsera.com/static/js/main.a32a5f2f.js:2:60052n730/$r/<@https://www.torsera.com/static/js/main.a32a5f2f.js:2:65494nuu@https://www.torsera.com/static/js/main.a32a5f2f.js:2:129152nRe@https://www.torsera.com/static/js/main.a32a5f2f.js:2:38619n$r@https://www.torsera.com/static/js/main.a32a5f2f.js:2:61346nHt@https://www.torsera.com/static/js/main.a32a5f2f.js:2:45742nKt@https://www.torsera.com/static/js/main.a32a5f2f.js:2:45524nEventListener.handleEvent*qr@https://www.torsera.com/static/js/main.a32a5f2f.js:2:60849nBr@https://www.torsera.com/static/js/main.a32a5f2f.js:2:60248n730/zr/<@https://www.torsera.com/static/js/main.a32a5f2f.js:2:60414nzr@https://www.torsera.com/static/js/main.a32a5f2f.js:2:60358n730/t.createRoot@https://www.torsera.com/static/js/main.a32a5f2f.js:2:150747n@https://www.torsera.com/static/js/main.a32a5f2f.js:2:1293094n@https://www.torsera.com/static/js/main.a32a5f2f.js:2:1293227n@https://www.torsera.com/static/js/main.a32a5f2f.js:2:1293231n", message: "Network Error", name: "AxiosError", code: "ERR_NETWORK", config: {…}, request: XMLHttpRequest }
home-page-util-functions.js:233:14

After quite a bit of research I discovered that despite the error mentioning CORS this is not really a CORS issue.

The endpoint I am hitting is returning a 200 response to the options request but the actual POST request is NOT getting any response.

I found various posts on stackoverflow and this mdn doc: mdn but none of this seem to be the issue I am having, because my request does succeed on Firefox occasionally.

I checked my server logs and I found that when my request fails there is always a log like this somewhere in server logs: 499 api.torsera.com/process_storyclientIP="69.180.xxx.xxx" requestID="893c3004-ca76-4fc4" responseTimeMS=29965 responseBytes=0 userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:130.0) Gecko/20100101 Firefox/130.0"

That error doesn’t always seem to appear in the same place in the logs and importantly my backend continues to process the user request even after this error appears.

The notable thing from this error is responseTimeMS=29965 which makes me believe there is some type of timeout happening.

IMPORTANT The backend process I am running is making multiple calls to external apis. So I believe it is my connection with the external apis that is throwing the 499 error.

However, if that is the case I am not sure why it would be browser dependent.

I have tried increasing network.http.connection-timeout in Firefox and that didn’t change anything.

Here are the request headers I am using:

Accept: application/json
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: en-US,en;q=0.5
Alt-Used: api.torsera.com
Connection: keep-alive
Content-Length: 148
Content-Type: application/json
Cookie: _ga_4FS2W9D=GS1.1.172775.5.1.17258.0.0.0; _ga=GA1.1.561638967.1726769877; session=eyJhbGciOiE15OXB1Q0puYmpEN2dRTzlQT09kTnl4VG1
Host: api.torsera.com
Origin: https://www.torsera.com
Priority: u=0
Referer: https://www.torsera.com/
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-site
TE: trailer

If there are any other details that I can provide let me know. I am very determined to get to the bottom of this issue.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật