Page MenuHomePhabricator

Property suggestor not appearing on Beta
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The suggestor does not appear with matching Properties as you type

image.png (216×430 px, 4 KB)

What should have happened instead?:
The Property suggestor should suggest Properties as you type

Event Timeline

When typing into the property suggester input, a bunch of errors show up in the dev console. The following is an example:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.wikidata.beta.wmcloud.org/w/api.php?action=wbsgetsuggestions&search=a&context=item&format=json&language=en&entity=Q424242&event=not1754921971488c53e4686. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). Status code: 200.

This happens because there are restrictions on API calls to a "different" domain than the page you're currently on. This difference is that the URLs used to get the suggested properties starts with a www, and the page loaded does not.

As a workaround, use the www-prefixed address for beta: https://www.wikidata.beta.wmcloud.org/wiki/Q424242

As a workaround, use the www-prefixed address for beta: https://www.wikidata.beta.wmcloud.org/wiki/Q424242

The www. domain is the correct one (according to e.g. the wikitech-l announcement), so I think the real issue here is that the non-www domain doesn’t fully redirect to the www domain (although https://wikidata.beta.wmcloud.org/ and https://wikidata.beta.wmflabs.org/, without a path, both redirect to https://www.wikidata.beta.wmcloud.org/wiki/Wikidata:Main_Page). I’m not sure if this is intentional or not, especially now that T289318: Move *.beta.wmflabs.org to *.beta.wmcloud.org is resolved… @Krinkle probably knows?

The old domain is wikidata.beta.wmflabs.org.
The new domain is www.wikidata.beta.wmcloud.org.
The domain "wikidata.beta.wmcloud.org" is neither old nor new, it is malformed.

There is shared configuration with prod, where we treat any unknown subdomains of wikidata as aliases. Aliases, however, are not redirects.

server_name: www.wikidata.beta.wmcloud.org
server_aliases: ["wikidata.beta.wmcloud.org", "*.wikidata.beta.wmcloud.org"]
canonical_name: "On"
server_name: www.wikidata.beta.wmcloud.org
server_aliases: ["wikidata.beta.wmcloud.org", "*.wikidata.beta.wmcloud.org"]`
canonical_name: "On"

This means at the Apache level, it is routed to the virtualhost for www.wikidata where MediaWiki thus responds in-place, from a non-canonical domain.

In production, it turns out that this code is present but unreachable, because elsewhere (in puppet:/redirects.dat) there is:

rewrite	wikidata.org	https://www.wikidata.org #T47005

.. which applies first, and thus renders the "alias" unreachable.

I suggest that we:

  • Add the same redirect in beta.
  • Remove the unreachable aliases, since it is undesirable to expose non-canonical, non-redirecting, and thus non-purged aliases of MediaWiki virtual hosts.

I noticed a similar issue recently with download.mediawiki.org (T50517), which I fixed the same way.

I suggest that we:

  • Add the same redirect in beta.
  • Remove the unreachable aliases, since it is undesirable to expose non-canonical, non-redirecting, and thus non-purged aliases of MediaWiki virtual hosts.

Thanks for explaining! I agree with both suggestions.

Change #1179719 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/puppet@production] mediawiki: Remove unused wikidata.org vhost and fix redirect in beta

https://gerrit.wikimedia.org/r/1179719

Mentioned in SAL (#wikimedia-releng) [2025-08-19T13:36:05Z] <Lucas_WMDE> lucaswerkmeister-wmde@deployment-puppetserver-1:/srv/git/operations/puppet$ pgit revert 20ea82337d # T401592

Change #1179719 merged by BCornwall:

[operations/puppet@production] mediawiki: Remove unused wikidata.org vhost and fix beta redirect

https://gerrit.wikimedia.org/r/1179719