Page MenuHomePhabricator

ApiErrorException on custom wiki
Open, Needs TriagePublic

Description

Hi! I recently (pre)-launched a custom wiki and have been trying to configure it with AWB, but have hit a pesky roadblock, pun not intended. Attempting to log in (regardless of valid credentials) returns the following:

workaround:

Exception:ApiErrorException
Message:API returned the following error: 'The "login" module requires a POST request.'
Call stack:<pre> at WikiFunctions.API.ApiEdit.CheckForErrors(String xml, String action)
at WikiFunctions.API.ApiEdit.Login(String username, String password, String domain)
at WikiFunctions.Profiles.AWBProfilesForm.PerformLogin(String username, String password)</pre>

OS: Microsoft Windows NT 6.2.9200.0
version: AutoWikiBrowser (6.3.0.0), WikiFunctions (6.3.0.0), revision 12558 (2024-01-16 20:38:04)
net: 4.0.30319.42000
duplicate:
site: https://pixarcarswiki.com

From scouring similar topics, it seems this is commonly given to Fandom users and possibly(?) other custom sites when you wrongly set http instead of https... However I've tried each with various formats (including www, etc.) and always get the same. I thought .htaccess settings might be screwing with it (previously I had a forced HTTP->HTTPS redirect) but after reverting those changes and much trial & error, including trying Dreamhost's auto redirect instead, the problem persists.

What's stumping me is the Apache logs themselves don't return any error, just the following in access (https):

[14/Apr/2024:20:44:27 +0000] "POST /api.php?format=xml&action=query&meta=tokens&type=login HTTP/1.1" 301 723 "-" "WikiFunctions ApiEdit/6.3.0.0..."
[14/Apr/2024:20:44:27 +0000] "GET /api.php?format=xml&action=query&meta=tokens&type=login HTTP/1.1" 200 903 "-" "WikiFunctions ApiEdit/6.3.0.0..." 
[14/Apr/2024:20:44:28 +0000] "POST /api.php?format=xml&action=login HTTP/1.1" 301 528 "-" "WikiFunctions ApiEdit/6.3.0.0..." 
[14/Apr/2024:20:44:28 +0000] "GET /api.php?format=xml&action=login HTTP/1.1" 200 815 "-" "WikiFunctions ApiEdit/6.3.0.0..."

Why does the server appear to recognize a POST request, but still reject back to the program itself? I do notice that all other (non-AWB) POSTs seem to use HTTP/2.0 instead of 1.1, if that's relevant. I'm brand new to this and only working with a few days of reading lol.

Thank you very much for your help :) Please let me know if this is something I need to look at with the site itself, it's driving me nuts.

Event Timeline

Based on my experience with T357908: Check for HTTP -> HTTPS redirect, and update URL/notify user as appropriate, and looking at your entry:

site: https://pixarcarswiki.com

Visiting that, it redirects to https://www.pixarcarswiki.com, as seen via curl.

$ curl -I https://pixarcarswiki.com
HTTP/2 301
location: https://www.pixarcarswiki.com/
content-type: text/html; charset=iso-8859-1
date: Mon, 15 Apr 2024 14:54:43 GMT
server: Apache

Basically, stop entering https://pixarcarswiki.com, enter https://www.pixarcarswiki.com/

The POST to a redirect doesn't work out well, especially for the initial requests.

It seems this is common enough, I probably need to add better handling for this too

Sure enough, that does it! I know for certain I tried that, but between all the different things I messed with I must have had something else out of place at the time. Login works fine now though. Thanks!!