1

We've installed wikibase-docker with an Apache server in front of it to handle SSL and proxy two vhosts to the ports from Docker.

In the log from the wdqs-updater I see:

org.wikidata.query.rdf.tool.rdf.Munger$BadSubjectException: Unrecognized subjects: [https://api.example.com/entity/statement/Q12-caba1d44-46d5-8598-9185-784a75e4cebb, https://api.example.com/entity/statement/Q12-4c77991e-4674-5301-75f1-5b494612b56b, https://api.example.com/wiki/Special:EntityData/Q12, https://api.example.com/entity/Q12].
Expected only sitelinks and subjects starting with http://wikibase.svc/wiki/Special:EntityData/ and [http://wikibase.svc/entity/] 

The 'wikibase.svc' name is used in the docker-compose.yml file and is the internal docker name.

To get the MediaWiki search working I had to update ${DOLLAR}wgServer = WebRequest::detectServer() in LocalSettings.php.template to have the value "https://api.example.com"

What do I need to change to make it work? All references to wikibase.svc in the docker-compose.yml file? Or something else?

I already tried updating WIKIBASE_HOST= for the wdqs-updater container, but that didn't seem to help.

Herman van Rink
  • 312
  • 2
  • 9
  • I also tried setting just `WIKIBASE_SCHEME_AND_HOST=https://api.example.com` but it currently just gives me many `Exception in thread "main" org.wikidata.query.rdf.tool.exception.ContainedException: Non-200 response from triple store: HttpContentResponse[HTTP/1.1 503 Service Unavailable - 0 bytes] body=` errors. – Herman van Rink Jul 13 '20 at 10:27
  • I tried working with https://addshore.com/2019/11/changing-the-concept-uri-of-an-existing-wikibase-with-data/ but do not fully comprehend which parts I need. Just changing the `WIKIBASE_HOST` for the wqds and wqds-updater resulted in more errors. When I tried to follow in fully the wdqs-new container failed on the '/loadData.sh' step with 'Error 503 Service Unavailable'. – Herman van Rink Aug 12 '20 at 13:25
  • What did you set WIKIBASE_HOST to? – Addshore Aug 12 '20 at 19:38
  • The wqds and wqds-updater containers had WIKIBASE_HOST set to `api.example.com`, wdqs-frontend had it still set to `wikibase.svc`. But after changing that and restart I still get 'Exception in thread "main" org.wikidata.query.rdf.tool.exception.ContainedException: Non-200 response from triple store: HttpContentResponse[HTTP/1.1 500 Server Error - 8080 bytes] body=' from the wqds-updater container. – Herman van Rink Aug 13 '20 at 05:15
  • I've now managed to get this working again, to get rid of the 500 errors I had to `docker volume rm wikibase-docker_query-service-data` (and before that stop the containers and remove the ones that use that volume) Setting the environment variables was probably the primary solutions. – Herman van Rink Aug 21 '20 at 12:18

1 Answers1

1

In docker-compose you have a list of variables that work perfectly on a localhost. When you need to deploy it in production you need to change few variables to define the public hostname, Ip and SSL. I did setup a nginx setup to manage the hostname and SSL certificate.

In my setup I have 1 hostname per service, my Nginx that forward the request to the right port number all the wikibase on the same machine.

My query service setting for nginx add the ssl certificate and forward to the port 8282 the request sent to https://query.example.com

On my production machine I "just" need to replaxe example.com by personaldata.io.

server {
       listen 80;
       server_name query.example.com;
       return 301 https://$server_name$request_uri;
       }
server {
       listen 443;
       server_name query.example.com;
       ssl on;
       ssl_certificate     /etc/letsencrypt/live/query.example.com/fullchain.pem;
       ssl_certificate_key /etc/letsencrypt/live/query.example.com/privkey.pem;
       ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
       ssl_ciphers         HIGH:!aNULL:!MD5;  
       access_log /var/log/nginx/query.example.com.log;
location / {
            proxy_pass http://127.0.0.1:8282;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-forwarded-host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
      }

The variables I had to change on my setup:

QS_PUBLIC_SCHEME_HOST_AND_PORT=https://qs.example.com:443 # Public domain name and port
WIKIBASE_SCHEME=https
WIKIBASE_HOST=wiki.example.com
QS_PUBLIC_SCHEME_HOST_AND_PORT=https://qs.example.com:443
WB_PUBLIC_SCHEME_HOST_AND_PORT=https://wiki.example.com:443
WIKIBASE_SCHEME_AND_HOST=https://wiki.example.com
  • Thanks, qs.example.com would be the vhost proxying to 9191 right? I don't have a vhost for that yet. The otherenv vars I do have. – Herman van Rink Aug 14 '20 at 09:34