varnishcache / varnish-cache

Varnish Cache source code repository
https://www.varnish-cache.org
Other
3.6k stars 371 forks source link

Redirect infinite loop after upgrade from 2/16/2018 master to 3/19/2018 master #2616

Closed 19h closed 6 years ago

19h commented 6 years ago

Hey,

I tried to upgrade our varnish proxy today as is our regular schedule, but when testing (upon upgrading) could not reach the backend as varnish was now suddenly stuck in redirect loops. This seems to be either a regression / removal of deprecated feature (?) introduced after February 16th and before March 19th.

Same environment as my previous ticket.

Previous HEAD (-> master): a4a6eb9e0922aec5471642f687b0ac16007f04f7 New HEAD (-> master): 5e2b0d8abda18e807b73ed2f6c0746688001e85b

default.vcl: https://gist.github.com/KenanSulayman/bf0ac854ccdb8985cc28bf47365bea78

Example request (as forwarded by h2o tls termination proxy):

T 9.8.7.14:40304 -> 9.8.7.22:80 [AP]
GET /w/api.php?action=query&format=json&formatversion=2&prop=pageimages%7Cpageterms&piprop=thumbnail&pithumbsize=160&wbptterms=description&pilimit=3&generator=search&gsrsearch=morelike%3A4-AcO-DMT&gsrnamespace=0&gsrlimit=3&gsrqiprofile=classic_noboostlinks&uselang=content&smaxage=86400&maxage=86400 HTTP/1.1.
connection: keep-alive.
host: psychonautwiki.org.
User-Agent: Mozilla/5.0 (Linux; Android 7.1.1; Moto Z (2) Build/NCX26.122-59-8-11-1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.109 Mobile Safari/537.36.
Accept: application/json, text/javascript, */*; q=0.01.
Accept-Language: en-US,en;q=0.9.
Referer: https://psychonautwiki.org/.
X-Forwarded-Host: psychonautwiki.org.
X-Forwarded-Port: 443.
X-Forwarded-Ssl: on.
X-Forwarded-Uri: /w/api.php?action=query&format=json&formatversion=2&prop=pageimages%7Cpageterms&piprop=thumbnail&pithumbsize=160&wbptterms=description&pilimit=3&generator=search&gsrsearch=morelike%3A4-AcO-DMT&gsrnamespace=0&gsrlimit=3&gsrqiprofile=classic_noboostlinks&uselang=content&smaxage=86400&maxage=86400.
X-Request-Id: XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX.
X-Requested-With: XMLHttpRequest.
Accept-Encoding: gzip.
x-forwarded-proto: https.
x-forwarded-for: XX.XX.XX.XX, 9.8.7.21.
via: 1.1 psychonautwiki.org.

After upgrading, this request (and all other requests) trigger(s) a redirect to itself, causing a redirect loop. I temporarily reverted to the image of the build artifacts using the master dated February 16th.

I'm happy to support in debugging this error case. Please let me know what other information would be helpful.

-K

mbgrydeland commented 6 years ago

Hi,

Could you please provide some varnishlog data from these redirects please? And did I understand correctly that these are HTTP/2 optimistic upgrade connections? Getting some coplete session logs (varnishlog -g session) would be preferable.

Regards, Martin Blix Grydeland

fgsch commented 6 years ago

ping @KenanSulayman

19h commented 6 years ago

Sorry about the delay, after a pretty busy April the next scheduled deploy is pending and I'll use that opportunity to debug this further. Thanks for the patience!

19h commented 6 years ago

I just rebuilt varnish with the lastest HEAD and this issue does not exist anymore. I don't have a enough time to debug the root cause of the error in the march 19 varnish build, but whatever it is, it's probably gone. I'll update should I stumble over it again. Thanks!