Visual Editors fail on new mediawiki installs (on Synology NAS)

I have a Synology NAS. It has a build of mediawiki that I installed as a app. In a recent upgrade, the “Visual Editor” feature within mediawiki stopped working. After doing some research, I discovered they only offer this as a non-supported add-on and is an old build. So I loaded Docker for Synology and tried to download and install the docker build for mediawiki using mariadb using both the official docker images hosted here using the latest builds of both. I was able to get the site running and following the guidelines others had posted on various other sites.

To my surprise, the Visual Editor still does not work and generates an error. Visual Editor = choose “Edit” on any wiki page… note the “source edit” or non-visual editor works. More research suggests this error seem related (in both cases, original Synology app and Docker version) to Parsoid and possibly when it transitioned from being based on JS to PHP.

Error:
2022-08-02_16-24-33

I have rebuilt this image 2x with the same error. I have even tried some several years old suggestions of making changes to the ‘url’ setting for ‘parsoid’. Synology ‘hides’ the docker image, so you must port forward from the docker/synology nas port to the mediawiki port (nas/docker 8080 => mediawiki 80), but that seems fairly normal. I have tried http://localhost/rest.php, http://localhost:8080/rest.php, the same entries using my hostname, my host ip, and … nothing works.

This is an official docker image, I would think it would work “out of the box”. Can anyone suggest how I can fix this. I have looked all over for how to contact mediawiki and this seems to be the only way.

Thanks for any help you can provide!

Is the visual editor extension the part of the official image or you need to install it? If it doesn’t come with a built-in visual editor, then it can be an issue with the editor itself.

To be honest, I don’t know. I believe the VisualEditor I believe is bundled as part of mediawiki by default. I only assume that it is part of the docker image. I know that at some point (around 2019 and mediawiki 1.35 or so) the VisualEditor software (parsoid) moved from being based in JS to PHP and it was my understanding that it was then part of the core build.

From mediawiki’s Parsoid page (Parsoid - MediaWiki):
" Parsoid (the PHP version) has been natively bundled with MediaWiki since version 1.35, released in September 2020."

I am not a programmer so I really don’t know for sure how to tell if it is included with the Docker image. It is such a core feature of Wiki, I would think so.

Parsoid is just a wikitext parser, not a visual editor.

I asked if you had to install it :slight_smile: Sorry if I was not clear. Your response lets me think that you did not install anything just run the official image, but then how did you get the error message? On the other hand you wrote:

Sou you have built an image. Can you share the Dockerfile?

Clicking on “edit” just opens an HTML text area without any visual editor…

Have you installed mediawiki on your desktop to see if it works?

And the compose file would be helpfull as well.

Describing things in prose is usaly less helpfull than actual sharing the Dockerfile, compose file or docker run commands used to create a container.

Also, may I ask for the exact synology model, as this image will not run on Disksations with a 3.x kernel.

Sorry, don’t know how to upload images. I had a screen capture of that error and that led me to Parsoid. The error is:

Error contacting the Parsoid/RESTBase server: (curl error: 7) Couldn’t connect to the server

I did look at the MediaWiki page on Extension:VisualEditor and that and the error led me to Parsoid. But maybe that is wrong. Here is from that page ( ):

The VisualEditor extension allows for editing pages as rich content. There is also a project of the same name aiming to create a reliable rich-text editor for the Web and for MediaWiki.

Before MediaWiki 1.35, the VisualEditor extension relied on a separate Parsoid parser service that needed to be installed and enabled in order to edit pages with it; this is now bundled with MediaWiki core.

When I say “built” the image, I am just downloading the official MariaDB and MediaWiki docker image on my NAS, then running through the steps to setup the database via the docker container install/configuration on my NAS and then doing the same for the MediaWiki container while also connecting the MariaDB database to it.

I got the Official MediaWiki image from here (can’t put more link as a new user …) on hub dot docker dot com) and used that as the basis for my Synology NAS docker configuration including ports and file/folders.
Got the Official MariaDB docker image from here too.

Clicking on “edit” just opens an HTML text area without any visual editor…
I click on “Edit” and get the error message above. A bar moves across the top and then the error pops up.

Have you installed mediawiki on your desktop to see if it works?
No, I suppose I can try that too.

And the compose file would be helpfull as well.

I did it from the Synology web interface. There isn’t really a compose file. I did follow some directions that essentially do the compose file settings:

Also, may I ask for the exact synology model, as this image will not run on Disksations with a 3.x kernel.

Running a DS920+ with the latest 7.1 system and all apps are current, including Docker.

In my original post I said:

I can’t find the original site, but that was changed in my LocalSettings.php file for the Wiki and these are the comments that came with that suggestion:

$wgVirtualRestConfig['modules']['parsoid'] = array(
    // URL to the Parsoid instance.
    // You should change $wgServer to match the non-local host running Parsoid
    // Note! This is a server to server URL (it must be valid within your VM/container)
    // For a VM or docker this will probably be correct:
    // 'url' => "http://localhost/rest.php",
    // Orig: 'url' => $wgServer . $wgScriptPath . '/rest.php'
    'url' => 'http://nas1:8080/rest.php',
    // Parsoid "domain", see below (optional, rarely needed)
    //'domain' => 'localhost',
);

DS920+ should be fine. It should already have a 4.x kernel, which works with the php random mumber generator. I guess the lack of compatiblity with Distkations that still use the 3.x kernel is the reason why they stopped supporting it.

I tried to set it up, just for the sake of it. At the bottom of the page where you register your admin user, there is a radio button to select if the extended installation should be perfomed or the installation should finish. The extended installation dialog allowed to select the VisualEditor.

Update: some words where missing.

Update2: is this the VisualEditor you are refering to?

The screenshot is taken from a fresh installation using the extended installation dialog without any manual changes on the LocalSettings.php file.

Yes, that is the visual editor I am referring to. Did you use a Synology NAS? MariaDB setup with a container link or port?

Because I did the install on Synology NAS without any changes from default other on that advanced page except to choose the Visual Editor, as shown below and I got a new error. (On my other installs I changed a few other things like not making it an open wiki, but kept everything default here…)

I tried to upload the screenshots of my config screens, but it will only let me upload 1 picture. So here is the checkbox I made for the VisualEditor:

Now the error I get is:
The server did not respond within the expected time.

Nope, mine uses a 3.x kernel. This is why I know it doesn’t work for older models.
I took the very same compose file and run it directly on an Ubuntu 20.04 host - the same compose file is embedded in the dockerhub description of mediawiki.

I clicken on WikiEditor as well and on CodeEditor two. I enabled all three.

update: I just removed everything with docker-compose down -v, removed the mapping for the LocalSettings.php and started from scratch. This time I just picked the VisualEditor → the same ui element appears.

The nas could be overwhelmed. If many containers/apps run on a DS920+ then this might happen. To this day I am riddled why Synology boxes come with lightwight cpus. They recently started to change it for their 21+/22+ models, but some still use the old lightweight cpus.

Then you just configure the container, now I understand.

I was not patient indeed and I skipped that step. Now everything makes sense :slight_smile:

Now I tried with the VisualEditor and got the same error message as @cbaker007 . I used Docker Desktop and forwarded port 8080 to 80, then I tried forwarding port 80 to port 80 so it is not about ports, but it does not happen only on a NAS. I still don’t know the reason of this message, I just wanted to let you know that I could reproduce it.

I found out why I got the same error. It looks like the solution you mention @cbaker007 still works, but for me it was an other variable.

First I installed the wiki using port 8080, then I did not install it again, just changed my compose file. By that time I had my LocalSettings.php with this content:

## The protocol and server name to use in fully-qualified URLs
$wgServer = "http://localhost:8080"

This is why I found the cause, because it redirected me to localhost:8080 in an other browser tab. I looked into the config file, removed the port to use port 80 and it worked. So I reinstalled the mediawiki again to comfirm my theory and indeed, mediawiki generates the file using the same port that we forward from the host, but the PHP code which wants to use curl (why???) cannot use that port.

When it was written in JavaScript, it was not a problem since it worked on the client side, but now after you generate the config file, you need to fix the port number.

It should work with the IP address of the NAS, but it would not work with the hostname “nas1” if it is not configured in a DNS server that Docker uses.

1 Like

@rimelek I went back to my original setup and did as you suggested. My $wgServer was set to the name of my NAS (NAS1). NOTE: That is registered with my Synology NAS because it is running DNS for my network. Machines on my network can reach nas1 and I was accessing the Wiki using “nas1:8080”. That is what I was using to log in. But I think what you are saying is the docker host (mediawiki image) can’t resolve that name when trying to do an “Edit”, maybe due to the port forwarding/bridge network connection of docker…

Regardless, I changed my setting in my LocalSettings.php to the IP for my Synology NAS:
Was - $wgServer= “http://nas1:8080
Changed to - $wgServer = “http://192.168.100.20:8080

Rebooted my MediaWiki Docker Container and the VisualEditor (using “Edit”) WORKED!

Thank you for your help @rimelek and @meyay.

I see, mine worked, because when the LocalSettings,php is downloaded after the installation, it renders the hostname and port into the configuration, Since mine was a remote docker host, of couse the remote ip and published port where correct. But, the same should be true if the container is instelled on a Syno, as a syno has no desktop to access the installer with “localhost”.