Topic on Project:Support desk

Mediawiki is not clearing Varnish cache

3
Lucasbasquerotto (talkcontribs)

Hi, I'm setting up Mediawiki with Varnish and the pages are being correctly cached by Varnish, but when I edit a Mediawiki page, the cache is not purged, so the outdated page still shows to users. I even removed the acl to make varnish accept calls from any source.

In Mediawiki settings, I defined both the host (name of the docker container) as well as the docker IP, but it didn't worked.


I've added to the settings:

$wgUseCdn = true;

$wgCdnServers = [];

$wgCdnServers[] = "172.22.0.10";


(the docker container had the above IP at that time)


I enabled Mediawiki logs and see the error:

[squid] CdnCacheUpdate::purge: https://localhost:8443/index.php/Test_Page https://localhost:8443/index.php?title=Test_Page&action=history

[DeferredUpdates] Deferred update CdnCacheUpdate failed: Call to undefined function socket_create()


I have found no solution for undefined socket_create() in Mediawiki.

Installed software

Product Version
MediaWiki 1.34.1
PHP 7.3.18 (apache2handler)
MariaDB 10.5.3-MariaDB-1:10.5.3+maria~bionic-log
ICU 63.1

I'm using varnish 6.4.0 (vcl 4.0). I'm using the docker image mediawiki:1.34.1

I don't know how to proceed and haven't found a solution.


Update:


If I try to enable sockets (docker-php-ext-enable sockets) it shows that it's already enabled: warning: sockets (sockets.so) is already loaded!, but from the error it seems as if it's not enabled tough.

Lucasbasquerotto (talkcontribs)

I've installed and enabled the sockets extension (docker-php-ext-install sockets and docker-php-ext-enable sockets) and restarted the docker container, and it works now.

I think it's important to document that the sockets extension needs to be enabled at Manual:Varnish caching and update $wgUseSquid and similar variables to $wgUseCdn and the other new variables.

Pspviwki (talkcontribs)

Got a similar problem but without any errors. All is set, just the job is not done. After the page is updated, the cached version is still served.

MediaWiki 1.37.1, PHP 7.4.27 (fpm-fcgi), MariaDB 10.6.5-MariaDB, ICU 70.1, varnish 7.0.2.

Settings in LocalHost: $wgUseCdn = true; $wgCdnServers = [] $wgCdnServers[] = '127.0.0.1'; alternative $wgCdnServers = [ '127.0.0.1', '127.0.0.1' ]; also tried

Any ideas where to look or to provoke it to any kind of error message?

Reply to "Mediawiki is not clearing Varnish cache"