HTTPS status 499
pakorn166
PROOP

17 days ago

I deploy service to use line messageing api for long time but today my service got status http 499 for nothing what heppend i use cloudflare

Solved

3 Replies

lucifer14144
HOBBY

17 days ago

after the dployment my web is not available its says site cant be reached


lucifer14144

after the dployment my web is not available its says site cant be reached

pakorn166
PROOP

17 days ago

im so disapointment because this week the railway has many downtime service this made me feel bad


pakorn166
PROOP

17 days ago

I was experiencing frequent HTTP 499 (Client Closed Request) errors on my LINE Webhook. After investigation, I found that the issue was due to Network Latency exceeding LINE's strict 1-second timeout limit.

Here is how I resolved it:

1. Implemented Asynchronous Processing (Non-blocking)

The most critical change was moving from a synchronous flow to an "Acknowledge First, Process Second" pattern.

  • Before: My server would process the logic (DB queries, API calls) and then return a 200 OK. If the logic took > 1s, LINE closed the connection (499).

  • After: As soon as the webhook is received and the signature is verified, I immediately return an HTTP 200 OK. I then process the event logic (like OCR slip verification or database updates) in the background.

2. Switched Cloudflare to "DNS Only" (Grey Cloud)

Cloudflare's Proxy (Orange Cloud) adds an extra layer of security checks and routing which can introduce 200–500ms of latency. By switching the specific subdomain to DNS Only, I reduced the "Hops" between LINE and my Railway server, shaving off critical milliseconds.

3. Optimized Database & Infrastructure

Since I am on a Railway Pro Plan, I ensured that my connection pooling was optimized to avoid handshake delays during high traffic.

Summary: Even if your DB and Logic are fast, global network fluctuations (especially in SEA during this period) can push you over the 1s limit. Returning a 200 OK immediately is the only foolproof way to prevent 499 errors with LINE.


Status changed to Solved ray-chen 17 days ago


Loading...