Netlify Started Returning 500 errors on redirect

One of my redirects started randomly failing and returning 500 from netlify:

❯ curl -I "https://aec.works/auth/linkedin"
HTTP/2 500
server: Netlify
date: Mon, 05 Jul 2021 20:30:53 GMT
age: 0
x-nf-request-id: 3f313c08-50a6-4bf3-8819-7d19391fdbc4

Redirect Config:

netlify.tml:

App:

I looked at similar questions here but I am not sure it’s the same issue
https://answers.netlify.com/t/redirect-randomly-returns-500/39958

Seems like it could be an error on my end possibly related to my auth flows,
but with the opaque 500 response from netlify I can’t tell what’s happening.
This flow was working for a while and only recently stopped working.

Any help is appreciated

PS: just noticed I used custom url in issue above. hitting the netlify url directly gives me different results, not sure custom url is adding to the issue.

I’m getting a 200 using curl and browser:

image

Did something change meanwhile?

1 Like

Zero changes on my end @hrishikesh .
Yesterday responses seemed flakey and sometimes worked, sometimes didn’t.

I am getting mostly 200 nows.

Earlier was 100% 500s.
Tried about 20 requests now and they all seem to be going through.

Is anyone at Netlify check the logs/trace one of the 500 responses using x-nf-request-id so I we can understand the issue?

500s:

❯ curl -I "https://aec.works/auth/linkedin"
HTTP/2 500
server: Netlify
date: Mon, 05 Jul 2021 20:30:46 GMT
age: 0
x-nf-request-id: cac30d04-8549-4ca1-ac81-aa9b4650f661


❯ curl -I "https://aec.works/auth/linkedin"
HTTP/2 500
server: Netlify
date: Mon, 05 Jul 2021 20:30:48 GMT
age: 0
x-nf-request-id: c54d6149-1004-4722-a17e-987347f5f2ea


❯ curl -I "https://aec.works/auth/linkedin"
HTTP/2 500
server: Netlify
date: Mon, 05 Jul 2021 20:30:49 GMT
age: 0
x-nf-request-id: ba49eb45-cc05-444a-95b3-31b2d8d29124

200s:

❯ curl -I  "https://aec.works/auth/linkedin"
HTTP/2 200
cache-control: public, max-age=0, must-revalidate
content-length: 1841
content-type: text/html; charset=UTF-8
date: Tue, 06 Jul 2021 04:47:49 GMT
etag: "5f54ef3cdea17491ea35443a5ab8ebab-ssl"
strict-transport-security: max-age=31536000
server: Netlify
age: 78
x-nf-request-id: 0013faa7-565a-48cf-ad24-3b4d4e41f152

Hi @gtalarico,

I could see the 500 errors in the internal logs, however the cause is yet to be identified. I’ve passed it on to the team that could have an answer and will update the thread once I have more info. Meanwhile if you still see more 500s, let us know.

1 Like

Hi @hrishikesh I would appreciate some help here.
I continue getting 500’s from netlify redirects and it’s making my website unusable.
It’s pretty inconsistent too - here are a few more

From browser
x-nf-request-id: 01FB02PWW3KW244B12859NCMET
image

From curl:

❯ curl -I  "https://aec.works/auth/linkedin"
HTTP/2 500
server: Netlify
date: Mon, 19 Jul 2021 19:10:59 GMT
content-length: 0
age: 0
x-nf-request-id: 01FB02VDNHMBVQVFM4D20DTKH0

Hi @gtalarico,

I’m assuming it’s because of this redirect rule:

https://aec.works/* https://aec.works/ 200

Could you try removing it to see if it makes a difference?

Hi @hrishikesh

Is this an invalid redirect configuration? It was setup for SPA router and was functioning correctly for several months, until I started getting these random 500s.

Do you know if there was a change in how Netlify handles redirect configs?

Also just did some more tests using the exact same request from above and get 200s again.

I don’t understand he inconsistency. And these 500 are totally opaque and I have not details from netlify on the cause.

Could you please help escalate this and have someone review logs or request traces for these?

~/
❯ curl -I "https://aec.works/auth/linkedin"
HTTP/2 200
cache-control: public, max-age=0, must-revalidate
content-length: 0
content-type: text/html; charset=UTF-8
date: Tue, 20 Jul 2021 16:55:10 GMT
etag: "5f54ef3cdea17491ea35443a5ab8ebab-ssl"
strict-transport-security: max-age=31536000
server: Netlify
age: 1
x-nf-request-id: 6f5bf845-81aa-4580-894f-b92a758cc98c


~/
❯ curl -I "https://aec.works/auth/linkedin"
HTTP/2 200
cache-control: public, max-age=0, must-revalidate
content-length: 0
content-type: text/html; charset=UTF-8
date: Tue, 20 Jul 2021 16:56:47 GMT
etag: "5f54ef3cdea17491ea35443a5ab8ebab-ssl"
strict-transport-security: max-age=31536000
server: Netlify
age: 0
x-nf-request-id: f636200d-77ce-4fc6-9c20-6297d6eda3c4


~/
❯ curl -I "https://aec.works/auth/linkedin"
HTTP/2 200
cache-control: public, max-age=0, must-revalidate
content-length: 0
content-type: text/html; charset=UTF-8
date: Tue, 20 Jul 2021 16:56:50 GMT
etag: "5f54ef3cdea17491ea35443a5ab8ebab-ssl"
strict-transport-security: max-age=31536000
server: Netlify
age: 0
x-nf-request-id: da92e479-072f-48a9-b0e5-98443102f8bf

And notice the inconsistency here, these were made one right after the other, from two different laptops. Looks like the cache was reset after the first 500 but then worked as expected:

~/
❯ curl -I "https://aec.works/companies?sort=updated"
HTTP/2 500
server: Netlify
date: Tue, 20 Jul 2021 17:02:19 GMT
age: 0
x-nf-request-id: 8b03107b-d9fd-4988-88fa-fb7177b3649f


~/
❯ curl -I "https://aec.works/companies?sort=updated"
HTTP/2 200
cache-control: public, max-age=0, must-revalidate
content-length: 1841
content-type: text/html; charset=UTF-8
date: Tue, 20 Jul 2021 17:02:33 GMT
etag: "5f54ef3cdea17491ea35443a5ab8ebab-ssl"
strict-transport-security: max-age=31536000
server: Netlify
age: 0
x-nf-request-id: 01FB2DWZ754XSGBGDNQ8W7F0CH


~/
❯ curl -I "https://aec.works/companies?sort=updated"
HTTP/2 200
cache-control: public, max-age=0, must-revalidate
content-length: 1841
content-type: text/html; charset=UTF-8
date: Tue, 20 Jul 2021 17:02:33 GMT
etag: "5f54ef3cdea17491ea35443a5ab8ebab-ssl"
strict-transport-security: max-age=31536000
server: Netlify
age: 33
x-nf-request-id: 01FB2DY00T5V7C0M4M5NFVS4A3


~/
❯ curl -I "https://aec.works/companies?sort=updated"
HTTP/2 200
cache-control: public, max-age=0, must-revalidate
content-length: 1841
content-type: text/html; charset=UTF-8
date: Tue, 20 Jul 2021 17:02:33 GMT
etag: "5f54ef3cdea17491ea35443a5ab8ebab-ssl"
strict-transport-security: max-age=31536000
server: Netlify
age: 105
x-nf-request-id: 01FB2E065ADSG4JQAG78Y535D9

Hey there! We do treat internal (.netlify.app) and external proxy rewrite differently. I’d advise you to update any rule that specifies aec.works to aecworks.netlify.app, i.e:

https://aec.works/* https://aecworks.netlify.app/ 200

If issues persist after making this change, please do let us know!

8 posts were split to a new topic: 500 Error retruned from proxy to Heroku API