Jump to content

Topic on Project:Support desk/Flow

Mediawiki is not clearing Varnish cache

6
Summary by Bwiki01

I solved this problem. I solved it by setting varnish to port 80 and setting the value of $wgInternalServer with http:// protocol.

Bwiki01 (talkcontribs)
Outside world <---> CloudFlare CDN <--->

Server

Nginx HTTPS termination
w.x.y.z:443

<--->

Varnish accelerator
w.x.y.z:6031

<--->

Nginx webserver
127.0.0.1:(backend portnumber)

Nginx reverse proxy
w.x.y.z:80

Hello. I am running MediaWiki by configuring the server environment as above. I set up the server by properly referring to the Varnish Manual on the MediaWiki site, but when I edit a Mediawiki page, the cache is not purged, so the outdated page still shows to users. Debugging logs are:

[squid] CdnCacheUpdate::purge: http://127.0.0.1/wiki/%EC%82%AC%EC%9A%A9%EC%9E%90:test/%EC%97%B0%EC%8A%B5%EC%9E%A5 http://127.0.0.1/w/index.php?title=%EC%82%AC%EC%9A%A9%EC%9E%90:test/%EC%97%B0%EC%8A%B5%EC%9E%A5&action=history
[http] HTTP start: PURGE http://127.0.0.1/wiki/%EC%82%AC%EC%9A%A9%EC%9E%90:test/%EC%97%B0%EC%8A%B5%EC%9E%A5
[http] HTTP start: PURGE http://127.0.0.1/wiki/%EC%82%AC%EC%9A%A9%EC%9E%90:test/%EC%97%B0%EC%8A%B5%EC%9E%A5
[http] HTTP start: PURGE http://127.0.0.1/w/index.php?title=%EC%82%AC%EC%9A%A9%EC%9E%90:test/%EC%97%B0%EC%8A%B5%EC%9E%A5&action=history
[http] HTTP start: PURGE http://127.0.0.1/w/index.php?title=%EC%82%AC%EC%9A%A9%EC%9E%90:test/%EC%97%B0%EC%8A%B5%EC%9E%A5&action=history
[error] [f0e7a55a8d26e377af71bbbc] /w/index.php?title=%EC%82%AC%EC%9A%A9%EC%9E%90:test/%EC%97%B0%EC%8A%B5%EC%9E%A5&action=submit   ErrorException: PHP Warning: curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported

I have tried not setting $wgInternalServer or setting $wgInternalServer to 127.0.0.1:6081 but the symptoms still persist. I was aware of the existence of https://phabricator.wikimedia.org/T264735.

My site is running MediaWiki version 1.36, which is higher than version 1.35, where T264735 starts to occur. Wikipedia and bullbapedia in a similar environment to my site (cloudflare cdn and varnish and MediaWiki version 1.35 or higher are used. However, this is presumed to use the Apache web server), despite using MediaWiki 1.35 or higher, my site and Otherwise, the purge seems to work fine.

I'm curious how to avoid T264735 and make the site's purge normal. It doesn't matter if you use the VCL or some 3rd method.

Bawolff (talkcontribs)
Bwiki01 (talkcontribs)

This doesn't seem to help. The site I run is much smaller than the Wikimedia site, it is a site operated by one server, and it is not a large service enough to use Apache Kafka.

Curlport1080 (talkcontribs)

Just wanted to reply to this because our setup is similar and there's another issue with this config now that the curl bug is fixed:


The Nginx reverse proxy listening on port 80 also needs to be listening on port 1080.

The purge requests mediawiki sends through CdnCacheUpdate::naivePurge uses the IPs in $wgCdnServers as a proxy in the curl request. $wgCdnServers does not support specifying a port and the default port curl uses for proxys is 1080.

Bawolff (talkcontribs)

Are you sure $wgCdnServers doesnt support port? I think it is supposed to.

Anyways, if mediawiki is using wgCdnServers as a Socks proxy (not an http proxy), that seems like a bug

Mcapodici (talkcontribs)

See T291768 on phabricator. I have updated the documentation for the wgCdnServers manual page so hopefully save someone else the investigation and research time to solve this. I would love to post links, but the spam detector won't allow!

tl;dr: the solution is "I can confirm that adding :80 to each of the IP addresses in my $wgCdnServers setting does indeed resolve the problem for me."