Talk:Parsoid/2022
Add topic| This page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Report a new bug in Phabricator
Previous discussion was archived at Talk:Parsoid/Archive on 24 June 2015.
Working with self-signed SSL certificate?
[edit]Is there a way to tell VisualEditor/Parsoid to work correctly for a wiki with a self-signed SSL cert? Clicking "Edit" in VisualEditor produces the error "Error contacting the Parsoid/RESTBase server: (curl error: 60) Peer certificate cannot be authenticated with given CA certificates." This is on MediaWiki 1.37.1.
I've tried the "insecure http" workaround at https://phabricator.wikimedia.org/T272680 (setting $wgVirtualRestConfig['modules']['parsoid']['url'] = 'http://mywiki.com/w/rest.php'), but the error message remained.
This is a test wiki on my own network, not a production wiki. I'm hoping for a server-side solution, not client-side, since multiple clients connect to this wiki.
Thank you very much. Maiden taiwan (talk) 22:57, 20 January 2022 (UTC)
- If you set the url to http then there's no certificate to verify, so something didn't quite work out in your testing Arlolra (talk) 23:04, 1 February 2022 (UTC)
- Hello all.
- I am having the exact same issue with my install of mediawiki. This is a 'private' wiki (only certain users will be able to edit), but the majority of pages will be publicly readable.
- Hence the whole site must be working on HTTPS (SSL).
- I know however that a large number of the editors will not be impressed if they have to learn mediawiki markup, so the visual editor is a must have.
- My set up is as follows.
- |MediaWiki
- |1.36.2
- |-
- |PHP
- |7.4.25 (apache2handler)
- |-
- |MariaDB
- |10.5.12-MariaDB-0+deb11u1
- |-
- |ICU
- |67.1
- |}
- |Article path
- |
/index.php/$1 - |-
- |Script path
- |
/ - |-
- |index.php
- |
/index.php - |-
- |api.php
- |
/api.php - |-
- |rest.php
- |
/rest.php - |}
- Running on top of the Apache web server, with Debian 11.
- I have used the https config as I found it from here : https://askubuntu.com/questions/788658/configuring-apache2-for-mediawiki
- I have tried copying the SSL certificates to /etc/ssl/certs on the main part of the server, but I'm sure I have not done this correctly.
- I have tried many solutions and have been able to recreate all the errors found in Extension:VisualEditor#Troubleshooting, so much so I can flip between them almost at will !
- The solution in my mind would be for the parsoid to be able to verify the authenticity of the server (in this instance itself), I must be able to do this, but where should I place the public and private certificates ?
- I am __very__ reluctant to run the wiki over http only. I notice that all the pages can be edited on the various wikimedia sites (including this one) with the visual editor, and they are working on https.
- It leads me to question if I should install parsoid / restbase as if I was in a Dev environment.
- finaly. I'm quite surprised that there isn't sample config for apache / nginx for working over SSL anywhere in the manual page .... once I get my config figured out, and cut down to the bare required minimum on my dev site I will be very happy to share my config to the manual:install page.
- Thanks in advance for you aid in resolving this issue.
- David Scibearspace (talk) 17:14, 10 February 2022 (UTC)
- You don't need to run the wiki over http only. You only need to allow http requests to localhost. Arlolra (talk) 01:02, 11 February 2022 (UTC)
- I understood that, but running parsoid over http causes the error that I posted above. I'm not getting the local communication to work.
- Also when running parsoid over local non SSL communication the address bar says http in it (unlike on this site, and other mediawiki sites) that continue to say https.
- I'm sure there is an error in my apache config for the site, specific to parsoid, or in the LocalSettings.php file. Having tried all the various options that are set out in the various threads here, and across the net (OK mabye not all, but a lots of them! ;) ). I continue to end up with the error above, or one of the others on the visual editor : troubleshooting page.
- You said in your earlier response to Maiden taiwan that something didn't work out in their testing. do you have any further suggestions for troubleshooting ? I'm not sure what other log files I need to debug the situation fully.
- I should say here that I really like mediawiki, its lovely to use, I'm just concerned for my colleagues if they have to edit the source for pages (I know it won't be popular)
- Thanks
- D Scibearspace (talk) 09:47, 11 February 2022 (UTC)
- I guess the first step is establishing that you connect to Parsoid over http at localhost.
- What happens when you visit http://localhost/rest.php/localhost/v3/page/html/Main%20Page Arlolra (talk) 17:11, 11 February 2022 (UTC)
- Hello Arlolra,
- appologies for the slow reply, my dev work is only a part of my main job, and I've been rather 'busy' !
- So I can actually use a browser from the local host (headless server). But I can ssh into the server and 'curl' the page you have asked about.
$ curl <nowiki>http://localhost/rest.php/localhost/v3/page/html/Main%20Page</nowiki> <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <nowiki><h1>Not Found</h1></nowiki> <nowiki><p>The requested URL was not found on this server.</p></nowiki> <nowiki><hr></nowiki> <address>Apache/2.4.38 (Debian) Server at localhost Port 80</address> </body></html>
- the same but this time using https ...
curl https://localhost/rest.php/localhost/v3/page/html/Main%20Page curl: (60) SSL certificate problem: self signed certificate More details here: https://curl.haxx.se/docs/sslcerts.html curl failed to verify the legitimacy of the server and therefore could not establish a secure connection to it. To learn more about this situation and how to fix it, please visit the web page mentioned above.
- which is consistent with the problems that I have seen other users have. IT also is why I wonder if I can get the server to 'self verify' somehow (like I do when I ssh into the server, but done locally). I know that the browser will normally store the SSL certificate, so as to 'verify' the server. but how to enable the same for the php commands within parsoid over localhost.
- Again, I can confirm that when I run the site without https everything works just fine.
- Should I try with a 'dev' version of parsoid (as outlined in Parsoid#Installation). In fact on that page (Parsoid#Linking a developer checkout of Parsoid) it states that :
- <blockquote>
- Parsoid code is bundled in two different ways: first, Parsoid is included from MediaWiki as a composer library,
wikimedia/parsoid </blockquote> - Is this only in the git version ? as I don't find this path on the main mediawiki files that I downloaded. The only folder is the and this doesn't have the structure as described in the parsoid development pages, which makes it hard to know what I should be modifying.
/extensios/VisualEditor
- Appologies this became a longer response that I had anticipated !
- David Scibearspace (talk) 09:49, 16 February 2022 (UTC)
- https://unix.stackexchange.com/questions/90450/adding-a-self-signed-certificate-to-the-trusted-list Ciencia Al Poder (talk) 10:00, 16 February 2022 (UTC)
- If you're getting a 404 from Apache for
curl http://localhost/rest.php/localhost/v3/page/html/Main%20Page, you need to configure Apache serve your MediaWiki instance for connections to port 80 Arlolra (talk) 16:23, 16 February 2022 (UTC) - @Arlolra,
- I appreciate your suggestions .... but ...
- That would be a problem as all the guides say that web sites should now be served over HTTPS (ie SSL and port 403) and not be using port 80 (which makes lots of sense to me).
- When I run the site without SSL (so on port 80 / http) everything is fine, but see above, I want SSL.
- The site will have registered users, and I can't have them log in over port 80 sending passwords to my server "in the clear".
- @Ciencia Al Poder, that looks interesting, I'll test to see if it works.
- Its also given me another idea, can I use a config file for CURL that will cause it to always use the 'insecure' flag, or point to the required certificate to authenticate with ? ... its a facetious question ... Im off to have a look now ... Scibearspace (talk) 10:10, 17 February 2022 (UTC)
- So there is a default config file for curl :
- see : https://everything.curl.dev/cmdline/configfile
- this leads to the question for curl as used by mediawiki, is there a local mediwiki config file for php / curl.
- My reasoning for this is if the server uses curl in other automated jobs / web apps etc, pointing to this "default config" file may tread on the toes of how CURL works in those other instances.
- Can we (cough I) create a config for curl in the LocalSettings.php , or somewhere else in the mediawiki file structure, that would be easily to modified as required.
- suggested example :
- $wgCurlSSLcert = "/path/to/SSL/cert" Scibearspace (talk) 11:04, 17 February 2022 (UTC)
- My suggestion was to accept connections at port 80 on localhost, not from traffic coming from outside your machine
- So, something like <VirtualHost localhost:80> and <VirtualHost mywiki.com:443>
- Another option is to use a certificate from https://letsencrypt.org/ instead of self-signing Arlolra (talk) 15:47, 17 February 2022 (UTC)
- Arlorla,
- Ah sorry, I missunderstood.
- That makes sense ... I'll need to look into how to configure apache for that.
- I'm guessing something like
- <VirtualHost localhost:80>
- ServerName wiki.example.com
- ServerAdmin admin@wiki.example.com
- ${APACHE_LOG_DIR}/wiki.example.com.error.log
- CustomLog ${APACHE_LOG_DIR}/wiki.example.com.access.log combined
- </VirtualHost>
- But my current config has
<virtualHost *:80>pushing everything to SSL withRedirect permanent "/" "https://wiki.example.com/" - Do you have any guides on how I can do this, I'm sure its fairly common, but not something I've had to do before.
- Once again, thanks in advance, and I fully intend to create a page to document my config once it is working, which I will happily share. Scibearspace (talk) 14:47, 18 February 2022 (UTC)
- Appologies to anyone following this thread.
- I've not found time to work on this ... will report back once I have. Scibearspace (talk) 08:29, 23 March 2022 (UTC)
- tried the <VirtualHost localhost:80> solution, and get:
- {"message":"Error: exception of type Wikimedia\\ParamValidator\\ValidationException: Validation of `domain` failed: invalid-domain {\"expected\":\"... 212.68.70.3 (talk) 09:33, 25 August 2022 (UTC)
mediawiki 1.37.1 Error contacting the Parsoid/RESTBase server: (curl error: 7) Couldn't connect to server
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
After upgrading to MediaWiki 1.37.1, I can no longer use the visual editor. The loading box pops up and then gives me the following error:
Error contacting the Parsoid/RESTBase server: (curl error: 7) Couldn't connect to server
I am not even sure how to diagnose this. I spent about 4 hours on the Google trying to find solutions. None seemed to work or were even applicable. Any help would be appreciated?
I am running:Ubuntu Server 20.04.3 as a VM
Apache 2.4.41
PHP 7.4.3
MariaDB 10.5.13 (not local) GCTWorks (talk) 19:40, 1 February 2022 (UTC)
- Can you paste your Parsoid configuration from your LocalSettings.php
- The first step is to isolate Parsoid and see if that works on its own Arlolra (talk) 23:00, 1 February 2022 (UTC)
- I am not sure my LocalSetting.php file has the configuration you are talking about. I did a text search for "parsoid" and nothing came up. GCTWorks (talk) 12:41, 2 February 2022 (UTC)
- Do you have a $wgVirtualRestConfig
- See https://www.mediawiki.org/wiki/Extension:VisualEditor#Linking_with_Parsoid Arlolra (talk) 15:35, 2 February 2022 (UTC)
- I do not have this in my LocalSettings.php file. I basically have a near Out of the Box LocalSettings.php file except some additional $wgFileExtensions appended to the end. All of the was working fine in 1.37.0. I will try adding this later.
- Is this something I need to do because my LocalSettings.php is from my initial install at 1.36.2 or 1.36.3? The upgrade to 1.37.0 went fine. GCTWorks (talk) 17:49, 2 February 2022 (UTC)
- It's possible you don't need that variable, there is a zero config setup, I believer, and adding that might make things worse.
- Did you look at the troubleshooting guide,
- https://www.mediawiki.org/wiki/Extension:VisualEditor#Troubleshooting
- The error code you're seeing mentioned there. Arlolra (talk) 18:13, 2 February 2022 (UTC)
- It does up once for a Docker install. I am not using Docker. Just a native install. GCTWorks (talk) 18:46, 2 February 2022 (UTC)
- An error is being reported by curl. My suggestion would be to log those errors and see what url it's trying to access. Arlolra (talk) 19:08, 2 February 2022 (UTC)
- Apologies, but how do I do that? I did some googling, but I was not successful in finding the logs for that error. GCTWorks (talk) 20:19, 2 February 2022 (UTC)
- Presumably runMultiCurl is being called and it looks like a warning will be logged,
- https://github.com/wikimedia/mediawiki/blob/91e4fc00ca15aa485bde39d6f7fd99329077d98d/includes/libs/http/MultiHttpClient.php#L299-L300
- I imagine you need to set a $wgDebugLogFile in your LocalSettings.php
- https://www.mediawiki.org/wiki/Manual:How_to_debug#Logging Arlolra (talk) 21:19, 2 February 2022 (UTC)
- Okay. Here is what I think are the two pertinent log lines, obfuscated for security:
- [http] HTTP start: GET https://mywiki.my.domain/rest.php/mywiki.my.domain/v3/page/html/Main_Page/3?redirect=false&stash=true
- [http] Error fetching URL "https://mywiki.my.domain/rest.php/mywiki.my.domain/v3/page/html/Main_Page/3?redirect=false&stash=true": (curl error: 7) Couldn't connect to server
- I do not know enough about how it is supposed to work to know what might be wrong GCTWorks (talk) 21:54, 2 February 2022 (UTC)
- What happens when you visit that url directly, say in a browser Arlolra (talk) 22:04, 2 February 2022 (UTC)
- I get the following:
- {"error":"rest-read-denied","httpCode":403,"httpReason":"Forbidden"} GCTWorks (talk) 22:44, 2 February 2022 (UTC)
- That's a different error. You connected but didn't forward a cookie so don't have permission to access the api. But it shows that you can connect to the endpoint.
- The curl error says that MediaWiki can't connect, which means that it is probably having a hard time resolving the right address for your domain. That is indeed similar to the docker issue linked to before at https://www.mediawiki.org/wiki/Extension:VisualEditor#Troubleshooting Arlolra (talk) 23:29, 2 February 2022 (UTC)
- Oh okay. So, I think you are correct in that it might be similar. I did not realize it until you mentioned it, the hostname of my server is the same as the "mywiki" part of mywiki.my.domain. Let me change the hostname and retest. I will follow-up with the results. GCTWorks (talk) 01:30, 3 February 2022 (UTC)
- Okay. That did the trick. Interesting that this was not an issue before I upgraded. How can I help to get that docker issue text updated to reflect my circumstances as well? I bet this would help some people.
- Also, thank you so much for helping me! I really appreciate it considering I am a bit of n00b. GCTWorks (talk) 01:50, 3 February 2022 (UTC)
- mediawiki.org is a wiki, please just edit the page as you see fit Arlolra (talk) 16:02, 3 February 2022 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.Use a single Parsoid PHP server for multiple wikis
[edit]I am trying to separate restbase and other nodejs apps into separate VMs/containers. I am testing in mediawiki 1.38 and 1.37.
If I configure parsoid host in this form: parsoidHost (restbase config.yaml):
/parsoid: x-modules: - path: sys/parsoid.js options: parsoidHost: "{{'http://{domain}/rest.php'}}"
I get the following error in the log which indicates domain has not been replaced with the correct domain:
"HTTPError","message":"Invalid URI \"http:///%7Bdomain%7D/rest.php/testwiki.wiki.internal/v3/page/pagebundle/Main_Page/20\"","status":504,
The correct url for parsoid should be:http://testwiki.wiki.internal/rest.php/testwiki.wiki.internal/v3/page/html/Main%20Page/20
This format gives a similar error:parsoidHost: "{{'http://{$.request.params.domain}/rest.php'}}"
full error{"name":"restbase","hostname":"restbase","pid":7192,"level":50,"message":"Invalid URI \"http:///$%7B$.request.params.domain%7D/rest.php/testwiki-fat.wiki.internal/v3/transform/pagebundle/to/wikitext/Main_Page/20\"","res":{"name":"HTTPError","message":"Invalid URI \"http:///$%7B$.request.params.domain%7D/rest.php/testwiki-fat.wiki.internal/v3/transform/pagebundle/to/wikitext/Main_Page/20\"","status":504,"headers":{"content-t ype":"application/problem+json","access-control-allow-origin":"*","access-control-allow-methods":"GET,HEAD","access-control-allow-headers":"accept, content-type, content-length, cache-control, accept-language, api-user-agent, if-match, if-modified-since, if-none-match, dnt, accept-encoding","access-control-expose-headers":"etag","x-content-type-options":"nosniff","x-frame-options":"SAMEORIGIN","referrer-policy":"origin-when -cross-origin","x-xss-protection":"1; mode=block","content-security-policy":"default-src 'none'; frame-ancestors 'none'","x-content-security-policy":"default-src 'none'; frame-ancestors 'none'","x-webkit-csp":"default-src 'none'; frame-ancestors 'none'","cache-control":"private, max-age=0, s-maxage=0, must-revalidate","x-request-id":"65e84430-ca39-11ec-80d5-5303b9bf502a","server":"restbase"},"body":{"type":"internal_http_er ror","detail":"Invalid URI \"http:///$%7B$.request.params.domain%7D/rest.php/testwiki-fat.wiki.internal/v3/transform/pagebundle/to/wikitext/Main_Page/20\"","internalStack":"Error: Invalid URI \"http:///$%7B$.request.params.domain%7D/rest.php/testwiki-fat.wiki.internal/v3/transform/pagebundle/to/wikitext/Main_Page/20\"\n at Request.init (/var/lib/restbase/node_modules/request/request.js:273:31)\n at new Request (/var/l ib/restbase/node_modules/request/request.js:127:8)\n at Function.request (/var/lib/restbase/node_modules/request/index.js:53:10)\n at Request._tryUntilFail (/var/lib/restbase/node_modules/requestretry/index.js:124:23)\n at Factory (/var/lib/restbase/node_modules/requestretry/index.js:178:7)\n at Request.run (/var/lib/restbase/node_modules/preq/index.js:160:16)\n at preq (/var/lib/restbase/node_modules/preq/in dex.js:267:46)\n at Object.module.exports [as filter] (/var/lib/restbase/node_modules/hyperswitch/lib/filters/http.js:76:12)\n at handlerWrapper (/var/lib/restbase/node_modules/hyperswitch/lib/hyperswitch.js:420:27)\n at /var/lib/restbase/node_modules/hyperswitch/lib/hyperswitch.js:426:28\n at HyperSwitch._filteredRequest (/var/lib/restbase/node_modules/hyperswitch/lib/hyperswitch.js:171:19)\n at HyperSwitch. <computed> [as post] (/var/lib/restbase/node_modules/hyperswitch/lib/hyperswitch.js:460:21)\n at ParsoidService.callParsoidTransform (/var/lib/restbase/sys/parsoid.js:690:40)\n at /var/lib/restbase/sys/parsoid.js:643:25\n at tryCatcher (/var/lib/restbase/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/var/lib/restbase/node_modules/bluebird/js/release/promise.js:547:31)"," internalURI":"http://${$.request.params.domain}/rest.php/testwiki-fat.wiki.internal/v3/transform/pagebundle/to/wikitext/Main_Page/20","internalQuery":"{}","internalErr":"Invalid URI \"http:///$%7B$.request.params.domain%7D/rest.php/testwiki-fat.wiki.internal/v3/transform/pagebundle/to/wikitext/Main_Page/20\"","internalMethod":"post"},"requestName":"get_from_backend"},"stack":"HTTPError: Invalid URI \"http:///$%7B$.request.p arams.domain%7D/rest.php/testwiki-fat.wiki.internal/v3/transform/pagebundle/to/wikitext/Main_Page/20\"\n at /var/lib/restbase/node_modules/preq/index.js:246:19\n at tryCatcher (/var/lib/restbase/node_modules/bluebird/js/release/util.js:16:23)\n at Promise._settlePromiseFromHandler (/var/lib/restbase/node_modules/bluebird/js/release/promise.js:547:31)\n at Promise._settlePromise (/var/lib/restbase/node_modules/bl uebird/js/release/promise.js:604:18)\n at Promise._settlePromiseCtx (/var/lib/restbase/node_modules/bluebird/js/release/promise.js:641:10)\n at _drainQueueStep (/var/lib/restbase/node_modules/bluebird/js/release/async.js:97:12)\n at _drainQueue (/var/lib/restbase/node_modules/bluebird/js/release/async.js:86:9)\n at Async._drainQueues (/var/lib/restbase/node_modules/bluebird/js/release/async.js:102:5)\n at Imm ediate.Async.drainQueues [as _onImmediate] (/var/lib/restbase/node_modules/bluebird/js/release/async.js:15:14)\n at processImmediate (node:internal/timers:466:21)","latency":21,"root_req":{"method":"post","uri":"/testwiki-fat.wiki.internal/v1/transform/html/to/wikitext/Main_Page/20","headers":{"content-length":"5758","content-type":"multipart/form-data; boundary=------------------------54315dbeb2b1f7be","if-match":"\"20/ 956ec650-ca1d-11ec-b753-6728b9e18a10\"","user-agent":"VisualEditor-MediaWiki/1.38.0-rc.0","api-user-agent":"VisualEditor-MediaWiki/1.38.0-rc.0","x-client-ip":"::ffff:192.168.128.20","x-forwarded-for":"::ffff:192.168.128.20","x-request-id":"65e84430-ca39-11ec-80d5-5303b9bf502a","x-request-class":"external"}},"request_id":"65e84430-ca39-11ec-80d5-5303b9bf502a","levelPath":"error/request","msg":"Invalid URI \"http:///$%7B$.req uest.params.domain%7D/rest.php/testwiki-fat.wiki.internal/v3/transform/pagebundle/to/wikitext/Main_Page/20\"","time":"2022-05-02T17:00:41.352Z","v":0}
This syntax does work however for the api endpoint and restbase base uri (and is recommended in the docs:
apiUriTemplate: "{{'http://{domain}/api.php'}}" baseUriTemplate: "{{'http://restbase.wiki.internal:7231/{domain}/v1'}}"
Using curl or web browser this returns the main page as expected:
http://restbase.wiki.internal/testwiki.wiki.internal/v1/page/html/Main_Page
As does the same request directly to parsoid:
http://testwiki.wiki.internal/rest.php/testwiki.wiki.internal/v3/page/html/Main%20Page/20
If I change config.yaml for restbase to use a DNS entry to point all wiki servers to a single wiki for parsoid I get errors like 'Validation of `domain` failed'{"message":"Error: exception of type Wikimedia\\ParamValidator\\ValidationException: Validation of `domain` failed: invalid-domain {\"expected\":\"testwiki-a.wiki.internal\",\"actual\":\"testwiki-b.wiki.internal\"}","exception":{"id":"699104fa54c628eaf170cbb0","type":"Wikimedia\\ParamValidator\\ValidationException","file":"/var/lib/mediawiki/vendor/wikimedia/parsoid/extension/src/Rest/Handler/ParsoidHandler.php","line":162,"message":"Validation of `domain` failed: invalid-domain {\"expected\":\"testwiki-a.wiki.internal\",\"actual\":\"testwiki-b.wiki.internal\"}","code":0,"url":"/rest.php/testwiki-b.wiki.internal/v3/page/html/Main%20Page/20","caught_by":"other","backtrace":[{"file":"/var/lib/mediawiki/vendor/wikimedia/parsoid/extension/src/Rest/Handler/ParsoidHandler.php","line":260,"function":"assertDomainIsCorrect","class":"MWParsoid\\Rest\\Handler\\ParsoidHandler","type":"->"},{"file":"/var/lib/mediawiki/vendor/wikimedia/parsoid/extension/src/Rest/Handler/PageHandler.php","line":75,"function":"getRequestAttributes","class":"MWParsoid\\Rest\\Handler\\ParsoidHandler","type":"->"},{"file":"/var/lib/mediawiki/includes/Rest/Router.php","line":414,"function":"execute","class":"MWParsoid\\Rest\\Handler\\PageHandler","type":"->"},{"file":"/var/lib/mediawiki/includes/Rest/Router.php","line":338,"function":"executeHandler","class":"MediaWiki\\Rest\\Router","type":"->"},{"file":"/var/lib/mediawiki/includes/Rest/EntryPoint.php","line":167,"function":"execute","class":"MediaWiki\\Rest\\Router","type":"->"},{"file":"/var/lib/mediawiki/includes/Rest/EntryPoint.php","line":132,"function":"execute","class":"MediaWiki\\Rest\\EntryPoint","type":"->"},{"file":"/var/lib/mediawiki/rest.php","line":31,"function":"main","class":"MediaWiki\\Rest\\EntryPoint","type":"::"}]},"httpCode":500,"httpReason":"Internal Server Error"}
Clearly it is not allowed for one wiki to parse text for another. Is there a flag to change this behavior perhaps?
So either I need to figure out how to get restbase to dynamically create the correct URL or how to configure a parsoid php server to respond for other wiki sites.
I have no problem getting restbase and parsoid working when everything is in the same container/VM. Calebgcooper (talk) 14:21, 2 May 2022 (UTC)Here is my full config.yamlbash-5.1# cat restbase/config.yaml # # Simple RESTBase config for Mediawiki Container # https://www.mediawiki.org/wiki/RESTBase/Installation # # - cassandra DB # - parsoid at http://localhost/rest.php # - wiki at http://testwiki.wiki.internal/api.php # # - proxied via nginx, available via # - http://hostname/api/rest_v1/ # services: - name: restbase module: hyperswitch conf: port: 7231 salt: 988881adc9fc3655077dc2d4d757d480b5ea0e11 default_page_size: 125 user_agent: RESTBase ui_name: RESTBase ui_url: https://www.mediawiki.org/wiki/RESTBase ui_title: RESTBase docs spec: x-request-filters: - path: lib/security_response_header_filter.js - path: lib/normalize_headers_filter.js x-sub-request-filters: - type: default name: http options: allow: - pattern: /^https?:\/\// paths: /{domain}/{api:v1}: x-modules: - spec: info: version: 1.0.0 title: Wikimedia REST API description: Welcome to your RESTBase API. x-route-filters: - path: ./lib/normalize_title_filter.js options: redirect_cache_control: 's-maxage=0, max-age=86400' paths: /page: x-modules: - path: v1/content.yaml options: response_cache_control: 's-maxage=0, max-age=86400' - path: v1/content_segments.yaml options: response_cache_control: 's-maxage=0, max-age=86400' - path: v1/common_schemas.yaml - path: v1/summary.js - path: v1/related.js - path: v1/random.yaml - path: v1/pdf.js options: uri: http://restbase.wiki.internal:3030 secret: secret /transform: x-modules: - path: v1/transform.yaml /media: x-modules: - path: v1/mathoid.yaml options: host: http://restbase.wiki.internal:10042 /data: x-modules: - path: v1/citoid.js options: host: http://restbase.wiki.internal:1970 - path: v1/lists.js - path: v1/recommend.yaml - path: v1/javascript.yaml - path: v1/css.yaml /{domain}/{api:sys}: x-modules: - path: projects/proxy.yaml options: backend_host_template: '{{"/{domain}/sys/legacy"}}' - spec: paths: /table: x-modules: - path: sys/table.js options: conf: version: 1 backend: cassandra hosts: - cassandradb pool_idle_timeout: 20000 retry_delay: 250 retry_limit: 10 show_sql: false keyspace: system defaultConsistency: localOne localDc: datacenter1 datacenters: - datacenter1 storage_groups: - name: local domains: /./ /legacy/key_value: x-modules: - path: sys/key_value.js /legacy/page_revisions: x-modules: - path: sys/page_revisions.js /post_data: x-modules: - path: sys/post_data.js /action: x-modules: - path: sys/action.js options: apiUriTemplate: "{{'http://{domain}/api.php'}}" baseUriTemplate: "{{'http://restbase.wiki.internal:7231/{domain}/v1'}}" /page_save: x-modules: - path: sys/page_save.js /events: x-modules: - path: sys/events.js /parsoid: x-modules: - path: sys/parsoid.js options: parsoidHost: "{{'http://{domain}/rest.php'}}" grace_ttl: 1000000 /mathoid: x-modules: - path: sys/mathoid.js options: host: "{{'http://restbase.wiki.internal:10042'}}" # Finally, a standard service-runner config. info: name: restbase logging: name: restbase level: warn streams: - type: stdout num_workers: 0 bash-5.1#
- I found this page but it is for parsoid js, if there was an equivalent for parsoid php it would be very helpful:
- https://www.mediawiki.org/wiki/Parsoid/Setup/RESTBase/Arbitrary_domains Calebgcooper (talk) 16:53, 2 May 2022 (UTC)
Regex to catch URLs
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
What regex does Parsoid use to catch and parse URLs? I asked at en:WP:VPT and was redirected here. NguoiDungKhongDinhDanh 06:18, 16 May 2022 (UTC)
- Autourls and external links are parsed in this PEG grammar block. So, Parsoid doesn't just use a regex for it. SSastry (WMF) (talk) 15:00, 16 May 2022 (UTC)
- Parsoid doesn't use regexes for that,
- https://github.com/wikimedia/parsoid/blob/master/src/Wt2Html/Grammar.pegphp#L932-L983
- It tries to match what the legacy parser does in Parser::makeFreeExternalLink
- The part that seems to be confusing is this removing of the trailing punctuation bit,
- https://github.com/wikimedia/mediawiki/blob/master/includes/parser/Parser.php#L1897-L1902 Arlolra (talk) 15:04, 16 May 2022 (UTC)
- Thank you both for answering. I guess I'll just have to learn PHP to figure out the rest. NguoiDungKhongDinhDanh 15:53, 16 May 2022 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.exception of type TypeError: Argument 2 passed to Wikimedia\\Parsoid\\Wt2Html\\TT\\ListHandler::pushList() must be an instance of stdClass, instance of Wikimedia\\Parsoid\\NodeData\\DataParsoid given
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
I've just upgraded my MediaWiki to 1.38.2 and Visual Editor broke down. I tried a lot of different attempts without success, I've opened various question on StackOverflow but I am lost.
This is the error:exception of type TypeError: Argument 2 passed to Wikimedia\\Parsoid\\Wt2Html\\TT\\ListHandler::pushList() must be an instance of stdClass, instance of Wikimedia\\Parsoid\\NodeData\\DataParsoid given
This is the error on the wiki: https://www.tematichedigenere.com/rest.php/www.tematichedigenere.com/v3/page/html/Cosa%20c'%C3%A8%20da%20fare%3F/27246
And this is the error trying to click on the Edit button. https://www.tematichedigenere.com/wiki/Guerra_Ucraina_Russia?veaction=edit
What's the easiest way to make the wiki get back working? Hyperreview (talk) 10:37, 8 August 2022 (UTC)- Solved by reinstalling the whole folder Hyperreview (talk) 14:04, 8 August 2022 (UTC)
- So, can I resolve this then? SSastry (WMF) (talk) 14:49, 8 August 2022 (UTC)
- The same question was asked here https://www.mediawiki.org/w/index.php?title=Talk%3AParsoid/Releases#c-Arlolra-20220804195000-93.47.32.35-20220804154500 Arlolra (talk) 15:45, 8 August 2022 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.Any IIS tutorial?
[edit]Please post a tutorial for IIS users. Same problem. 45.227.131.210 (talk) 18:44, 21 September 2022 (UTC)
VisualEditor Error contacting the Parsoid/RESTBase server: (curl error: 7) Couldn't connect to server
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
Server info:
MediaWiki 1.38.4
PHP 7.4.33 (fpm-fcgi)
MySQL 5.7.39-log
ICU 50.2
When I'm trying to use VisualEditor, all I get is this error: Error contacting the Parsoid/RESTBase server: (curl error: 7) Couldn't connect to server
I'm using almost default LocalSetting.php and have no Parsoid configuration.
I've noticed the guide Extension:VisualEditor#Troubleshooting, but I'm not understand what "mediawiki native hostname" and "the domain the wiki is running on" is.
Here is the log about the error (URL is edited):
[http] HTTP start: GET mywikiroot/rest.php/wiki.zyrail.org/v3/page/html/%E9%A6%96%E9%A1%B5/1?redirect=false&stash=true
[http] Error fetching URL "mywikiroot/rest.php/wiki.zyrail.org/v3/page/html/%E9%A6%96%E9%A1%B5/1?redirect=false&stash=true": (curl error: 7) Couldn't connect to server
However, the URL is accessable without any error message.
What can I do? Thanks for help. Jeffreyg1228 (talk) 10:03, 27 November 2022 (UTC)
The discussion above is closed. Please do not modify it. No further edits should be made to this discussion.