Topic on Extension talk:VisualEditor
Product | Version |
---|---|
MediaWiki | 1.36.1 |
PHP | 7.4.20 (fpm-fcgi) |
MariaDB | 10.5.11-MariaDB |
ICU | 67.1 |
Lua | 5.1.5 |
Elasticsearch | 6.8.16 |
I had this error with 1.36.0 so I upgraded to 1.36.1 and still have it sometimes. It is a small private wiki farm. One way I can consistently cause the error is to use the VisualEditor on my User page. It does work on other pages though which is strange.
I have $wgGroupPermissions['user']['writeapi'] = true;
set for all wikis in the farm.
I have the follow example in my vhost with the rewrite rules
<VirtualHost *:443> ServerAdmin webmaster@un9.io DocumentRoot [redacted] ServerName mitm.un9.io AllowEncodedSlashes NoDecode SSLEngine on Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateChainFile /etc/letsencrypt/live/un9.io/chain.pem SSLCertificateFile /etc/letsencrypt/live/un9.io/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/un9.io/privkey.pem RewriteEngine On RewriteRule ^/(.*):(.*) /index.php/$1:$2 <Directory [redacted]> AllowOverride AuthConfig FileInfo Limit Options=FollowSymLinks Require all granted RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) /index.php/$1 [L,QSA] </Directory> </VirtualHost>
I enabled debug logging and code this
[http] HTTP complete: GET https://mitm.un9.io/rest.php/mitm.un9.io/v3/page/html/User%3ATestUser/16?redirect=false&stash=true code=400 size=194 total=0.887740 connect=0.530200 [VisualEditor] ApiParsoidTrait::requestRestbase: Received HTTP 400 from RESTBase
I've not seen errors in apache or php-fpm logs or audit/setroubleshoot logs. It looks a bit strange to me to see the domain in the URL twice. Is that because of the rewrite rules and how do I fix it.
Thanks
No wiki farm on my end, but getting the HTTP 400 error as well on my single wiki running 1.36.1. NGINX web server. Also getting the same debug log code as you. I'll post more if I find any resolution.
Edit: Specifically, it works when creating a new page, but it doesn't work when editing an existing page. See mention of it here: https://www.mediawiki.org/w/index.php?title=Topic:Vunt92vkiyisn8cu&topic_showPostId=vupnmgwaasz9pvfm#flow-post-vupnmgwaasz9pvfm
One consistent way I found so far, is editing my user page - I always get the error
Same issue here on 1.35.6 downloaded today (no added extensions installed, no short URLs, default config from the installer), not on a farm, same message also:
ApiParsoidTrait::requestRestbase: Received HTTP 400 from RESTBase
VE of course was from the installer package, so no mismatched packages or anything weird going on there either.
MediaWiki | 1.35.6 |
PHP | 7.4.25 (cgi-fcgi) |
MySQL | 8.0.28-0ubuntu0.20.04.3 |
Adding to hosts file ie; /etc/hosts on Linux, fixed it until the solution is known
127.0.0.1 yourwikidomain.com
Adding my external hostnames to /etc/hosts (mapping them to 127.0.0.1) fixed this for me. If the local server cannot resolve its own public-facing hostname+domain, then VisualEditor fails in this way. In my case, I was iterating on a new server build to upgrade from 1.27 to 1.38, and I kept hitting this problem because my host is not yet officially deployed, with DNS updated appropriately.
Alas, this did not fix for me on MW 1.38
I noticed in the apache2 access log that it was trying to get /wiki/rest.php/https(link)://my.fullqualifiedwiki.domain/v3/page/html/Main_page instead of /wiki/rest.php/my.fullqualifiedwiki.domain/v3/page/html/Main_page (there is no"(link)" but I'm trying to get around the "abusefilter-warning-linkspam")
So in LocalSettings.php I added 'domain' => 'my.fullyqualifiedwiki.domain' to the
$wgVirtualRestConfig['modules']['parsoid'] = array( 'url' => $wgServer . $wgScriptPath . '/rest.php', 'domain' => 'my.fullyqualifiedwiki.domain', );
This worked for me.
My wiki fixed after add text to Nginx config files srrver block. location /rest.php/ { try_files $uri $uri/ /zw/rest.php?$query_string; }