Topic on Extension talk:AbuseFilter

103.88.223.179 (talkcontribs)

Hello folks, I'm using MediaWiki 1.34 and was trying to install this extension but each time I save the code "wfLoadExtension( 'AbuseFilter' );" in my LocalSetting.php I see this error "HTTP ERROR 500". I tired with different versions 1.31, 1.35 and the master but all return with the same error so can someone please tell if there is something I'm not doing the right way?

MediaWiki 1.34.0
PHP 7.3.22 (cgi-fcgi)
MySQL 5.7.28-log
ICU 63.1
Lua 5.1.5

Thank you

Ipsha

Daimona Eaytoy (talkcontribs)

Hey! Without further information it's basically impossible to understand what's going on. It might be a configuration issue, or perhaps an AbuseFilter bug. I suggest following this guide to get detailed PHP error messages, and then posting it back here.

103.88.223.179 (talkcontribs)

Thank you for replying, so after following your instructions, I first tried with the master version and I was encountered with:

Fatal error: Uncaught ExtensionDependencyError: Abuse Filter is not compatible with the current MediaWiki core (version 1.34.0), it requires: >= 1.36.0.

which is understandable so I then tried with 1.31 and it returns with:

Fatal error: Uncaught Error: Call to undefined method ObjectCache::getMainStashInstance() in /extensions/AbuseFilter/includes/AbuseFilterHooks.php:310 Stack trace: #0 /includes/libs/objectcache/BagOStuff.php(133): AbuseFilterHooks::{closure}(30) #1 /extensions/AbuseFilter/includes/AbuseFilterHooks.php(311): BagOStuff->getWithSetCallback('$wgDBname:abuse...', 30, Object(Closure)) #2 /includes/Hooks.php(174): AbuseFilterHooks::onGetAutoPromoteGroups(Object(User), Array) #3 /includes/Hooks.php(202): Hooks::callHook('GetAutoPromoteG...', Array, Array, NULL) #4 /includes/Autopromote.php(48): Hooks::run('GetAutoPromoteG...', Array) #5 /includes/user/User.php(3367): Autopromote::getAutopromoteGroups(Object(User)) #6 /includes/user/User.php(3340): User->g in /extensions/AbuseFilter/includes/AbuseFilterHooks.php on line 310


Thank you

Daimona Eaytoy (talkcontribs)

That kind of error is expected: the compatibility policy of AbuseFilter, like for the majority (I think) of MediaWiki extensions, is "rel", which means that the 1_XX release of AbuseFilter is only compatible with MediaWiki 1_XX. So in your case, if you're using MediaWiki 1.34.0, you should download version 1.34.0 of AbuseFilter. I should also note that MediaWiki 1.34 is EOL, but that's not related to the issue you're facing.

103.88.223.179 (talkcontribs)

I installed the 1.34.0 version of AbuseFilter but now when I visit the Special:AbuseFilter/import and click on the "Import data" button it takes me to Special:AbuseFilter/new without saving the data and when I'm trying to create a new filter at Special:AbuseFilter/new it's not saving the data at all and again returned to the same page without any error message. So any idea if there is a bug or something? I'm not seeing any error message so I'm unsure what to post here.

Ciencia Al Poder (talkcontribs)
103.88.223.151 (talkcontribs)

So I contacted my service provider and they tried multiple settings but the error is still there. They replied that:

As this is a wiki custom site, I will recommend to contact wiki to provide recommendations on resolving this.

I can confirm modsecurity is not blocking processes as the enhanced security is disabled for the domain

In the link provided by @Ciencia Al Poder: above it says "If even saving a very simple edit gets you redirected to the main page, or to the same page without the edit appearing, it may be a problem with how you've set up $wgServer or some other configuration variable that controls the path of the index.php script, or conflicts with rewrite rules in your webserver's configuration." I tried using different browsers and set the below code in my LocalSetting

$wgServer =

$wgCanonicalServer =

The site is running on PHP 7.3 CGI and have the following settings in my htaccess

RewriteEngine On

RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d

RewriteRule ^/?images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2 [L,QSA,B]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d

RewriteRule ^/?images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]

<IfModule LiteSpeed>

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC] RewriteRule .* - [E=Cache-Control:vary=ismobile]

RewriteRule .* - [E=Cache-Vary:stopMobileRedirect,mf_useformat]

</IfModule>

<IfModule LiteSpeed>

   CacheLookup on

   </IfModule>

   

<FilesMatch "sitemap\.xsl$">

Allow from all

</FilesMatch>

But the filter is still not working properly so am I missing something?

Ciencia Al Poder (talkcontribs)

You must look in the development console of your browser (hit F12), go to the network tab, and look at the request when you submit the form to save the filter. If you get a POST and then a GET of the same page (because the POST is issuing a redirect), the data is lost, because HTTP redirects change the method (from POST to GET), discarding all the data.

Reply to "HTTP ERROR 500"