Topic on Project:Support desk

Visual Editor problems: Error contacting the Parsoid/RESTBase server (HTTP 404)

4
Summary by John Bradie
John Bradie (talkcontribs)

Debian 10.5 (buster)

MediaWiki 1.35.0-rc.2
PHP 7.3.19-1~deb10u1 (apache2handler)
MariaDB 10.4.8-MariaDB-log


I can't figure out why Visual Editor is not working for a specific use case. Visual Editor works fine except when trying to create a subpage with Visual Editor in the User namespace. e.g. www.mysite.com/User:John/Newpage, it keeps giving me Error contacting the Parsoid/RESTBase server (HTTP 404).


It works fine when using Visual Editor outside the user namespace, which is very strange?


I did a fresh install on my machine and even one on a brand new AWS EC2 machine to check, with only VisualEditor/Wikieditor as extensions. It doesn't work on either install.


Would anyone have any idea what can be wrong or have any pointers?

John Bradie (talkcontribs)

debugging I look at the values of the response that gave an error (they are below).


What catches my attention is 'requestPath': transform/wikitext/to/html/User%3AJohn%2Ftestpage and I suspect the problem comes from : and / being sanitized to %3A and %2F. Which I believe is unnecessary.


After seeing this, and to check if the premise is correct, I checked if creating subpages in the Main namespace also gives an error. And it does.


So this looks like its a bug?


'code':

404


'trace':

#0 /var/www/html/w/extensions/VisualEditor/includes/ApiVisualEditor.php(67): ApiVisualEditor->requestRestbase(Object(Title), 'POST', 'transform/wikit...', Array)

#1 /var/www/html/w/extensions/VisualEditor/includes/ApiVisualEditor.php(251): ApiVisualEditor->parseWikitextFragment(Object(Title), 'testtext', false, NULL, true)

#2 /var/www/html/w/includes/api/ApiMain.php(1593): ApiVisualEditor->execute()

#3 /var/www/html/w/includes/api/ApiMain.php(529): ApiMain->executeAction()

#4 /var/www/html/w/includes/api/ApiMain.php(500): ApiMain->executeActionWithErrorHandling()

#5 /var/www/html/w/api.php(90): ApiMain->execute()

#6 /var/www/html/w/api.php(45): wfApiMain()

#7 {main}


'response':

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL was not found on this server.</p> <hr> <address>Apache/2.4.38 (Debian) Server at localhost Port 80</address> </body></html>


'requestPath':

transform/wikitext/to/html/User%3AJohn%2Ftestpage

John Bradie (talkcontribs)

ok so I think its definitely a bug:


If I remove urlencode from lines 230 & 250 in file ApiParsoidTrait.php it does work..........


I hacked it for the moment...

John Bradie (talkcontribs)