Jump to content

Topic on Extension talk:VisualEditor/Flow

httpResponse 406 from Parsoid

41
Gwsampo (talkcontribs)

When trying to edit using the extension Parsoid is throwing a 406.

Is this a known response?

216.248.100.66 (talkcontribs)

I am seeing the same pattern. I am able to create a new page using VisualEditor without problem but if I try to edit it gives a 406 error. If I check the log file on the Parsoid server it has the error message "Not acceptable". In checking the code for Parsoid in its Git repository, it looks like the error is produced by a check of the content version.

Dbummy (talkcontribs)

I am also getting a 406 error. I was trying to set up parsoid on another server and getting this. I thought it was me configuring wrong but now I wonder. @Gwsampo, was this already working on your server and now it is giving 406 error?

Gwsampo (talkcontribs)

I'm a new install but wouldn't say I'm a battler at this kind of thing...

My setup (IP_ADRESS/index.php?title=Special:Version)

Installed software

Product Version
MediaWiki 1.30.0
PHP 7.0.28-0ubuntu0.16.04.1 (apache2handler)
MySQL 5.7.21-0ubuntu0.16.04.1
Parsoid 0.9.0all
Curl 7.47.0

Installed extensions

Other
Extension Version License Description Authors
VisualEditor 0.1.0 (61f161a)05:07, 3 October 2017 MIT Visual editor for MediaWiki Alex Monk, Bartosz Dziewoński, Christian Williams, Ed Sanders, Inez Korczyński, James D. Forrester, Moriel Schottlender, Roan Kattouw, Rob Moen, Timo Tijhof, Trevor Parscal, C. Scott Ananian and others
Mshannaq (talkcontribs)

I also has the same problem, I got apierror-visualeditor-docserver-http: HTTP 406. when editing any already exists wiki pages , but when I create a new wiki page no problem appear and everything goes fine the and page created with the visual editor.

any one know how to solve this?

Gwsampo (talkcontribs)

When using postman to GET

http://IP_ADDRESS/mediawiki/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en

{

    "error": {

        "code": "apierror-visualeditor-docserver-http",

        "info": "HTTP 406",

        "*": "See http://IP_ADDRESS/mediawiki/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."

    }

}

Mshannaq (talkcontribs)

Yes I got the same also when I use post man

http://IP/api.php?action=visualeditor&format=json&paction=parse&page=REST_API_using_PHP&uselang=en

{

    "error": {

        "code": "apierror-visualeditor-docserver-http",

        "info": "HTTP 406",

        "*": "See https://IP/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."

    }

}

but when I try to request the same url for a non exists content I got

http://IP/api.php?action=visualeditor&format=json&paction=parse&page=not_exists_topic&uselang=en

{

    "visualeditor": {

        "result": "success",

        "notices": [

            "<p><strong>Warning:</strong> You are not logged in. Your IP address will be publicly visible if you make any edits. If you <strong><a rel=\"nofollow\" class=\"external text\" href=\"https://IP/index.php?title=%D8%AE%D8%A7%D8%B5:UserLogin&amp;returnto=Not_exists_topic\">log in</a></strong> or <strong><a rel=\"nofollow\" class=\"external text\" href=\"https:/IP/index.php?title=%D8%AE%D8%A7%D8%B5:UserLogin/signup&amp;returnto=Not_exists_topic\">create an account</a></strong>, your edits will be attributed to your username, along with other benefits.\n</p>",

            "<p>You have followed a link to a page that does not exist yet.\nTo create the page, start typing in the box below (see the <a class=\"external text\" href=\"https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents\">help page</a> for more info).\nIf you are here by mistake, click your browser's <strong>back</strong> button.\n</p>"

        ],

        "checkboxesDef": [],

        "checkboxesMessages": [],

        "templates": "<div class=\"templatesUsed\"></div>",

        "links": {

            "missing": [

                "Not exists topic"

            ],

            "known": []

        },

        "protectedClasses": "",

        "basetimestamp": "20180328002134",

        "starttimestamp": "20180328002134",

        "oldid": 0,

        "content": ""

    }

}

any advices?

Gwsampo (talkcontribs)

So frustrating but try in LocalSettings.php

Enabled skins (commenting out the other ones)

wfLoadSkin( 'MonoBook' );

wfLoadSkin( 'Vector' );

Gwsampo (talkcontribs)

Sorry that didn't work

Gwsampo (talkcontribs)

Maybe a bug in 1.30.0 mediawiki

Working in 1.31.0-alpha mediawiki

Steps to resolve was completing removing old mediwiki and installing latest development version from github and latest development version of visualeditor from git

Something like this

cd /var/lib/mediawiki

mv /var/lib/mediawiki /var/lib/mediawikiold

git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git

mv /var/lib/core /var/lib/mediawiki

Installed composer globallly (https://getcomposer.org/)

/var/lib/mediawiki composer update --no-dev

test mediawiki config page working

copied old skins

copied old extensions (excluding visual editor)

cd extensions

git clodn https://gerrit.wikimedia.org/r/p/mediawiki/extensions/VisualEditor.git

cd VisualEditor

git submodule update --init

completed wiki setup

worked

Installed software

Product Version
MediaWiki 1.31.0-alpha (6f9c30c)

09:38, 28 March 2018

PHP 7.0.28-0ubuntu0.16.04.1 (apache2handler)
MySQL 5.7.21-0ubuntu0.16.04.1
ICU 55.1

Installed extensions

Other
Extension Version License Description Authors
VisualEditor 0.1.0 (476a590)07:29, 28 March 2018 MIT Visual editor for MediaWiki Alex Monk, Bartosz Dziewoński, Christian Williams, David Lynch, Ed Sanders, Inez Korczyński, James D. Forrester, Moriel Schottlender, Roan Kattouw, Rob Moen, Timo Tijhof, Trevor Parscal, C. Scott Ananian and others
96.23.48.169 (talkcontribs)

I'm having the same problem ..

93.39.230.4 (talkcontribs)

Hi same problem here. Media Wiki 1.30, Visual Editor 1.30

Dbummy (talkcontribs)

Seems that MW1.30 works with Parsoid 0.8.0all but NOT with Parsoid 0.9.0all. if you run "dpkg -s parsoid" it will show you Parsoid version. I have mirrored setups (Ubuntu Server 16.04) with each of the versions of Parsoid and one is working and the other is giving 406 error. Trying to downgrade now.

Dbummy (talkcontribs)

Was able to get mine working (MW 1.30 / Parsoid 0.9.0all) by downgrading Parsoid to 0.8.0all.

--Ubuntu Server 16.04--

apt-get purge parsoid

wget https://people.wikimedia.org/~ssastry/parsoid/debs/parsoid_0.8.0all_all.deb

dpkg -i parsoid_0.8.0all_all.deb

apt-mark hold parsoid

82.204.2.90 (talkcontribs)

Worked for me, I couldn't find 0.8.0 via apt before so thanks for these steps

Don't forget to check your configs too!

185.154.146.37 (talkcontribs)

This worked for me!

216.248.100.66 (talkcontribs)

For me, changing the version of Parsoid to 0.8.0 was the solution. While it is noted in Parsoid's documentation that you need to be careful to use the right version of Parsoid for the version of VisualEditor you have, I didn't see any mention in the VE documentation as to which version was appropriate.

93.39.230.4 (talkcontribs)

I am on Centos 7 and I am not able to install the .deb file in the download page for the 0.8.0

I have tried:

dpkg -i parsoid_0.8.0all_all.deb

but I receive these errors:

parsoid depends on nodejs (>= 4.0.0); however:

  Package nodejs is not installed.

parsoid depends on logrotate; however:

  Package logrotate is not installed.

parsoid depends on adduser; however:

  Package adduser is not installed.

But I have installed node: v6.13.1 and npm: 3.10.10

Do you have any suggestion?

Thanks

Dbummy (talkcontribs)

The "deb" file is for Ubuntu or Debian based systems. I think with CentOS you would have to find the "rpm" file or compile from source. If using the rpm file, You would use "yum" instead of "apt-get". You may even be able to install the old version using yum. I know you can with apt-get in Ubuntu if the package is still available but it wasn't in my case.

217.148.121.13 (talkcontribs)

Already tried, in the repo there is only the last version.

I think I am stucked until they update the Visual Editor....

77.118.171.223 (talkcontribs)

Edit the file ParsoidConfig.js.

Its in ----> lib/config/ParsoidConfig.js

Change the following line from TRUE to FALSE:

ParsoidConfig.prototype.strictAcceptCheck = false;

Full Article is here

Greets,

Chris

217.18.193.124 (talkcontribs)

This "fixed" the issu for my setup.

60.11.42.35 (talkcontribs)

Thanks,It's work.Looks good.

62.2.90.162 (talkcontribs)

Googled for hours until i found this solution...works for me, a fresh installation of mediawiki & parsoid

12.118.115.198 (talkcontribs)

Thanks so much. Worked for me as well.

186.46.139.226 (talkcontribs)

Thank you that fixed it!

Just for documentation purposes the error I had on the parsoid.log file was:

Error:

{"name":"parsoid","hostname":"wiki","pid":1453,"level":60,"logType":"fatal/request","wiki":"wiki$1","title":"Ejemplo","oldId":null,"reqId":null,"userAgent":"VisualEditor-MediaWiki/1.30.0","msg":"Not acceptable.\ntext/html; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/HTML/1.6.1\"\ntext/html; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/HTML/2.0.0\"\n","stack":"","httpStatus":406,"longMsg":"Not acceptable.\ntext/html; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/HTML/1.6.1\"\ntext/html; charset=utf-8; profile=\"https://www.mediawiki.org/wiki/Specs/HTML/2.0.0\"\n","levelPath":"fatal/request","time": ""}

Solution:

Edit the file ParsoidConfig.js.

Its in ----> lib/config/ParsoidConfig.js

Change the following line from TRUE to FALSE:

ParsoidConfig.prototype.strictAcceptCheck = false;

Thanks!

Compumatter (talkcontribs)

Yep that did it ! Solved.

  • sudo vim /usr/lib/parsoid/src/lib/config/ParsoidConfig.js
  • ParsoidConfig.prototype.strictSSL = false;
  • sudo service parsoid restart
  • Done
Oleolsenkjhølkølk (talkcontribs)

Wait, what should i do if there is no such line in my config file?

There is only a "strict check for ssl", but setting that to false didn't solve the problem.

Is there something missing from my files?

185.125.207.249 (talkcontribs)

Posting to let everyone know that the post above exposes a solution that doesn't involve manually downloading the previous version of parsoid and freezing it on Ubuntu via apt mark. Be sure to restart the parsoid service after making the change.

Seb35 (talkcontribs)

You can also change the config file instead of Parsoid code: edit /etc/mediawiki/parsoid/config.yaml and add strictAcceptCheck: false at the same level as "userAgent" in the beginning, i.e. just under "conf". Example:

services:
  - module: lib/index.js
    entrypoint: apiServiceWorker
    conf:
        # For backwards compatibility, and to continue to support non-static
        # configs for the time being, optionally provide a path to a
        # localsettings.js file.  See localsettings.example.js
        #localsettings: ./localsettings.js
        
        # Set your own user-agent string
        # Otherwise, defaults to:
        #   'Parsoid/<current-version-defined-in-package.json>'
        #userAgent: 'My-User-Agent-String'
        
        # /!\ COMPATIBILITY for Parsoid 0.9.0 with MediaWiki before 1.31
        strictAcceptCheck: false
        
        # Configure Parsoid to point to your MediaWiki instances.
        mwApis:
...

PS: this is just an improvement over the above solution, all merits are due to .

213.33.64.46 (talkcontribs)

Don't forget to restart Parsoid with `service parsoid restart` after changing the configuration! This is the cleanest solution to get Parsoid 0.9.0all working with Mediawiki 1.30!

117.136.45.110 (talkcontribs)

Thank you too much, my friends!

I spend hours to search in baidu and google, it really frustrated me.

Thanks! All my friends!

真的非常感谢,前辈们!

Rajeshrajesh.35 (talkcontribs)

I am still getting error "apierror-visualeditor-docserver-http","info":"HTTP 406"

Using these configs:

OS : GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)

NAME="Red Hat Enterprise Linux Server"

VERSION="7.6 (Maipo)"


MediaWiki 1.31.1

VisualEditor 0.1.0 (6854ea0)22:33, 5 November 2018

"parsoid" : 0.10.0+git

Parso log:

"name": "parsoid",

"hostname": "ashsd.xxx.com",

"pid": 19229,

"level": 60,

"logType": "fatal/request",

"wiki": "Wiki2",

"title": "Bot",

"oldId": null,

"reqId": null,

"userAgent": "VisualEditor-MediaWiki/1.31.1",

"msg": "Not acceptable.\ntext/html; charset=utf-8; profile=\"\"\ntext/html; charset=utf-8; profile=\"/HTML/999.0.0\"\n",

"stack": "",

"httpStatus": 406,

"longMsg": "Not acceptable.\ntext/html; charset=utf-8; profile=\""\ntext/html; charset=utf-8; profile=\"/HTML/999.0.0\"\n",

"levelPath": "fatal/request",

"time": "2019-06-19T09:00:58.714Z",

"v": 0


This post was hidden by Rajeshrajesh.35 (history)
Rajeshrajesh.35 (talkcontribs)

I have solved this error, there was missing domain name in these files, i would suggest all of you to check the domains in these files.


[Root]/config.yaml,

[Root]/sys/mathoid.js,

[Root]/v1/mathoid.yaml

Rajeshrajesh.35 (talkcontribs)

These errors are related to restbase.

192.196.142.91 (talkcontribs)

@Rajeshrajesh.35

Hi,

I have the same error but it seems that I have no problem with domain names.

Have you change anything else ?

Rajeshrajesh.35 (talkcontribs)

No, is individual services running as

Parsoid?

Restbase?

Method?

Also, check port is enabled so that API connect internally, still you have problem drop me email [my user name] @ gmail.com

213.133.67.162 (talkcontribs)

If people are getting this with MediaWiki version 1.31.x on Ubuntu 18.04, parsoid had updated to version 0.11.all for me.

You can downgrade to 0.10.0all which is supported by 1.31.x here: https://releases.wikimedia.org/parsoid/


Pin it with `apt-mark hold parsoid`

93.188.122.139 (talkcontribs)

Для установленной на WINDOWS

php 5.6

apache 2.4

Mediawiki 1.30.2

помогла решить проблему установка версий Parsoid 0.9.0, NodeJS 10.21

С parsoid версии 0.11.0 не работало с указанной в теме ошибкой.

Новые страницы создавались, а при редактировании существующих было: apierror-visualeditor-docserver-http: HTTP 406

Reply to "httpResponse 406 from Parsoid"