According to https://www.mediawiki.org/wiki/Parsoid/Troubleshooting you can test if the parsoid service is up and running and "serving" by surfing to http://yourDomain:8000/_wikitext/yourPrefix/". But 'prefix' has been removed from newer versions of Parsoid. Is there another way to test this?
Topic on Talk:Parsoid
you're better off trying http://localhost:8000/version
Thank you for your reply, but I already tested that Parsoid was up and running by accessing api.php via curl. According to the troubleshooting page, http://yourDomain:8000/_wikitext/yourPrefix/ should also help you determine whether it is actually doing what you expect to do. But as I do not know what value to enter for 'yourPrefix', I'm stuck.
(Background info: we have a private wiki that we need to run in ssl, and I'm having trouble understanding how to configure Parsoid using a self-signed certificate.)
The /_wikitext endpoint is only available if you enable the devAPI in your config.yaml
Did you set a prefix when you configured your MediaWiki api in the config.yaml?
Typically, this would look like,
- uri: 'http://yourdomain/api.php'
domain: 'yourdomain' prefix: 'yourprefix' // optional
in which case the answer would be 'yourprefix'.
However, the easiest way to confirm it's working is to make a GET request to http://yourdomain:8000/yourdomain/v3/page/html/Main_Page
which doesn't require setting a prefix (a somewhat deprecated concept in Parsoid)
A GET works fine. It returns:
MediaWiki has been installed. Consult the User's Guide for information on using the wiki software. Getting started Configuration settings list MediaWiki FAQ MediaWiki release mailing list Localise MediaWiki for your language Learn how to combat spam on your wiki
But when I hit 'Edit'-tab on the Main Page, I get a pop-up with "http" and an "OK" and "Cancel" button. If I select "OK", the page opens in "Edit source" instead of "Edit".
There's nothing useful in the apache logs, nor in the parsoid logs.
At the moment, /etc/mediawiki/parsoid/config.yaml has
logging: level: info
What other levels exist?
const LEVELS = ['trace', 'debug', 'info', 'warn', 'error', 'fatal'];
https://github.com/wikimedia/service-runner/blob/master/lib/logger.js#L9
It sounds like Parsoid is setup fine, and you need to adjust your VE settings.
Are there any errors in the browser console?
Thanks, Arloira.
Yes, I get an Internal Server Error in the console when I select the 'Edit' tab:
load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:140 GET https://edgwiki.hit.local/hit-wiki/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en 500 (Internal Server Error) send @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:140 ajax @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:134 ajax @ VM131:68 get @ VM131:67 requestParsoidData @ VM132:34 requestPageData @ VM132:33 (anonymous) @ VM131:77 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:47 fire @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:45 add @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:45 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:47 each @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:5 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:47 Deferred @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:47 then @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:46 activateTarget @ VM131:77 activatePageTarget @ VM131:77 activateVe @ VM131:84 onEditTabClick @ VM131:83 dispatch @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:65 elemData.handle @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0sz2zo7:60
How is VE configured in your LocalSettings.php?
Also, have you followed, https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis
I was trying to set up the wiki to use https for all pages and thought the issue was how to get parsoid (which apparently only works in http) to work using tls, but I now removed the ssl settings and still have no luck.
Current configuration:
/etc/mediawiki/parsoid/config.yaml
worker_heartbeat_timeout: 300000 logging: level: info services: - module: ../src/lib/index.js entrypoint: apiServiceWorker conf: mwApis: uri: 'http://edgwiki.hit.local/hit-wiki/api.php' serverPort: 8142 strictSSL: false
/var/www/html/hit-wiki/LocalSettings.php
(...) wfLoadExtension( 'VisualEditor' ); $wgDefaultUserOptions['visualeditor-enable'] = 1; $wgVisualEditorParsoidURL = 'http://edgwiki.hit.local'; if ( $_SERVER['REMOTE_ADDR'] == '127.0.0.1' ) { $wgGroupPermissions['*']['read'] = true; $wgGroupPermissions['*']['edit'] = true; };
I'd seen the https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid_in_private_wikis link, but as the parsoid service runs on the same server as the wiki, and I'm the only one who has direct login access to the server, I went with the config proposed at https://www.mediawiki.org/wiki/User:Andru~mediawikiwiki/Allow_Parsoid_Server
After each config change, I restart parsoid and apache2
Current error in the console:
load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:140 GET https://edgwiki.hit.local/hit-wiki/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en 500 (Internal Server Error) send @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:140 ajax @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:134 ajax @ VM1057:68 get @ VM1057:67 requestParsoidData @ VM1058:34 requestPageData @ VM1058:33 (anonymous) @ VM1057:77 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:47 fire @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:45 add @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:45 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:47 each @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:5 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:47 Deferred @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:47 then @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:46 activateTarget @ VM1057:77 (anonymous) @ VM1057:88 fire @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:45 add @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:45 jQuery.fn.ready @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:49 jQuery.fn.init @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:41 jQuery @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:1 (anonymous) @ VM1057:87 mw.loader.implement.css @ VM1057:93 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:161 fire @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:45 add @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:45 always @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:46 runScript @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:161 checkCssHandles @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:162 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:162 fire @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:45 fireWith @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:46 fire @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:46 fireCallbacks @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:156 addEmbeddedCSS @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:157 (anonymous) @ load.php?debug=false&lang=en&modules=jquery%2Cmediawiki&only=scripts&skin=vector&version=0p8i8gh:156
Both http://edgwiki.hit.local/hit-wiki/api.php and http://edgwiki.hit.local:8142/ work.
http://edgwiki.hit.local/hit-wiki/api.php returns the "MediaWiki API help" page, http://edgwiki.hit.local:8142/ returns the "Welcome to the Parsoid web service." page
You need to change $wgVisualEditorParsoidURL = 'http://edgwiki.hit.local';
to $wgVisualEditorParsoidURL = 'http://edgwiki.hit.local:8142';
in your LocalSettings.php
You've left out the port
Adding the port didn't seem to change things at first.
But at least the apache access log now held some info I could use:
10.32.14.57 - - [16/May/2017:18:00:48 +0200] "GET /hit-wiki/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en HTTP/1.1" 500 1894 "-" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
When I entered the url http://edgwiki.hit.local/hit-wiki/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en (based on the GET statement in the log), the browser gave me a full error message:
Internal Server Error [abfbfebee7a73c6aec183569] /hit-wiki/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en Error from line 415 of /var/www/html/mediawiki-1.28.1/includes/libs/MultiHttpClient.php: Call to undefined function curl_multi_init() Backtrace: #0 /var/www/html/mediawiki-1.28.1/includes/libs/MultiHttpClient.php(140): MultiHttpClient->getCurlMulti() #1 /var/www/html/mediawiki-1.28.1/includes/libs/virtualrest/VirtualRESTServiceClient.php(250): MultiHttpClient->runMulti(array) #2 /var/www/html/mediawiki-1.28.1/includes/libs/virtualrest/VirtualRESTServiceClient.php(146): VirtualRESTServiceClient->runMulti(array) #3 /var/www/html/mediawiki-1.28.1/extensions/VisualEditor/ApiVisualEditor.php(97): VirtualRESTServiceClient->run(array) #4 /var/www/html/mediawiki-1.28.1/extensions/VisualEditor/ApiVisualEditor.php(226): ApiVisualEditor->requestRestbase(string, string, array) #5 /var/www/html/mediawiki-1.28.1/includes/api/ApiMain.php(1435): ApiVisualEditor->execute() #6 /var/www/html/mediawiki-1.28.1/includes/api/ApiMain.php(510): ApiMain->executeAction() #7 /var/www/html/mediawiki-1.28.1/includes/api/ApiMain.php(481): ApiMain->executeActionWithErrorHandling() #8 /var/www/html/mediawiki-1.28.1/api.php(83): ApiMain->execute() #9 {main}
So I installed php-curl, restarted apache2, and the next attempt resulted in this info in the apache access log:
10.32.9.143 - - [16/May/2017:18:12:04 +0200] "GET /edgwiki.hit.local/v3/page/html/Main_Page/2?redirect=false HTTP/1.1" 404 484 "-" "VisualEditor-MediaWiki/1.28.1" 10.32.14.57 - - [16/May/2017:18:12:04 +0200] "GET /hit-wiki/api.php?action=visualeditor&format=json&paction=parse&page=Main_Page&uselang=en HTTP/1.1" 200 470 "http://edgwiki.hit.local/hit-wiki/index.php/Main_Page?veaction=edit" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36"
The first line looks odd. As in the second line, I expected a "GET /hit-wiki/...".
So I added the domain definition to both /etc/mediawiki/parsoid/config.yaml and /etc/mediawiki/parsoid/config.yaml, restarted apache and parsoid once more, and now we're in business.
FWIIW, I retested the url definition in LocalSettings.php at this stage and it does indeed require specifying the tcp port 8142.
So at least, after installing php-curl, adding the domain, and specifying the tcp port, it is working now for plain http.
Tomorrow, I'll start the battle to get it working in https.
Thanks for your assistance, Arlolra.