Jump to content

Topic on Extension talk:VEForAll/Flow

404 API error on 1.39

6
141.70.45.21 (talkcontribs)

API call from page form textarea to convert wikitext in html results in 404 error.

(action: veforall-parsoid-utils

format: json

from: wikitext

to: html

content: <div> ... </div>)

Response:

{

    "error": {

        "code": "veforall-api-error-parsoid-error",

        "info": "Request to parsoid for wikitext to html conversion of content connected to title example failed: 404",

        "*": "See /api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt; wikimedia/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/&gt; for notice of API deprecations and breaking changes."

    }

}

This worked in 1.37 just fine on PHP 8.0.

The error log shows multiple Http::createMultiClient Deprecation notices from VEForAll


PHP message: PHP Deprecated:  Use of Http::createMultiClient was deprecated in MediaWiki 1.34. [Called from VEForAll\ApiParsoidUtilsOld::parsoid in /extensions/VEForAll/includes/ApiParsoidUtilsOld.php at line 125] in /includes/debug/MWDebug.php on line 381" while reading response header from upstream, request: "POST /api.php HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php8.0-fpm.sock:"


Version: 0.4 (REL_39) so it should be 0.4.1

The error is not helpful either.

Yaron Koren (talkcontribs)

Yes, you should upgrade to VEForAll 0.4.1 - I'm guessing that will fix the problem.

141.70.45.21 (talkcontribs)

They should upgrade the version you get from the mediawiki downloader. If I download it from there for 1.39 I get 0.4. I have to take the version from github

141.70.45.21 (talkcontribs)

I downloaded the 0.4.1.tar.gz, extracted it into VEForALL on 1.39.2 and got the following error:

Error at /extensions/VEForAll/includes/ApiParsoidUtils.php(204)

from /extensions/VEForAll/includes/ApiParsoidUtils.php(204)

#0 /extensions/VEForAll/includes/ApiParsoidUtils.php(91): VEForAll\\ApiParsoidUtils->getVRSObject()

#1 /extensions/VEForAll/includes/ApiParsoidUtils.php(24): VEForAll\\ApiParsoidUtils->convert()

#2 /includes/api/ApiMain.php(1900): VEForAll\\ApiParsoidUtils->execute()

#3 /includes/api/ApiMain.php(875): ApiMain->executeAction()

#4 /includes/api/ApiMain.php(846): ApiMain->executeActionWithErrorHandling()

#5 /api.php(90): ApiMain->execute()

#6 /api.php(45): wfApiMain()

#7 {main}"

Exception caught: Class \"VEForAll\\RequestContext\" not found"


Looking at includes/ApiParsoidUtilsOld.php and adding "use RequestContext;" at the top of includes/ApiParsoidUtils.php fixes the error

141.90.9.33 (talkcontribs)

Can confirm, this seems to work. Without this edit, I can't even edit existing pages, let alone create new ones via PageForms.

Yaron Koren (talkcontribs)

Sorry about that! And thanks for finding a solution. I just checked in that line addition. I'm amazed that no one pointed this out until now... maybe most users still have not upgraded to 1.39.

Reply to "404 API error on 1.39"