Page MenuHomePhabricator

The href of be-tarask: interlanguage link points to the be-x-old domain
Closed, ResolvedPublic

Description

Steps to reproduce

  1. Open any page on Wikipedia
  2. Insert [[:be-tarask:Some test page]]
  3. Save page
  4. Open saved page and mouse over the link
  5. In web browsers there is a full link address shown in status bar at the bottom. Look on its content

Expected behavior
There should be be-tarask.wikipedia.org/wiki/Some test page

Current behavior
There actually is be-x-old.wikipedia.org/wiki/Some test page. It looks like [[:be-tarask:]] links to be-x-old.wikipedia.org, which redirects to be-tarask.wikipedia.org, which is unnecessary double redirect.

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
OpenNone
StalledNone
StalledNone
InvalidNone
StalledNone
StalledNone
StalledNone
StalledNone
StalledFeatureNone
StalledNone
StalledFeatureNone
StalledFeatureNone
StalledFeatureNone
StalledNone
StalledNone
OpenNone
ResolvedNone
OpenNone
OpenNone
ResolvedLadsgroup

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 237195 had a related patch set uploaded (by Alex Monk):
Remove old be-tarask -> be-x-old alias

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

Change 237197 had a related patch set uploaded (by Alex Monk):
Remove old be-tarask -> be-x-old alias

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

Change 237197 merged by jenkins-bot:
Remove old be-tarask -> be-x-old alias

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

Change 237195 merged by jenkins-bot:
Remove old be-tarask -> be-x-old alias

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

That didn't work in production.

Everything is terrible.

I was poking around at this on mw1017 last night and found that instead of removing the alias, we need to reverse it (i.e. alias in the other direction) and perform the change to the langlist. Unfortunately, there are issues with that - see T111876

Change 236966 had a related patch set uploaded (by Alex Monk):
Also update langlist for be-x-old -> be-tarask rename

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

I wrote the code and it's ready to run. Some edits for testing. Just tell me and I fire the bot for all wikis.

Change 236966 abandoned by Brion VIBBER:
Make MediaWiki treat $lang of be_x_oldwiki as be-tarask, just don't change the real DB name

Reason:
Abandoning this in favor of a config switch that is off by default for now, same as our MP4 support. We can flip the switch, or the default state of the switch, when legal & community sign off.

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

Change 236966 restored by Brion VIBBER:
Make MediaWiki treat $lang of be_x_oldwiki as be-tarask, just don't change the real DB name

Reason:
Wrong commit sorry!

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

What is going on here? This is a blocker for multiple tasks waiting for this to be solved...

Yeah, you're right, all wiki rename proposals are waiting for this and all be-x-old issues probably too.

I recalled this because time to time this makes random Pywikibot's Travis/Appveyor test fail, which is a little bit annoying (why this patch failed? did I make some mistake in unittests? ahhhh! be-x-old test went to the scene :facepalm:)

Script terminated by exception:

ERROR: SiteDefinitionError: be-tarask:Баўгарыя is not a local page on wikipedia:cs, and the interwiki prefix be-tarask is not supported by Pywikibot!
Unknown URL 'https://be-x-old.wikipedia.org/wiki/$1'.
Traceback (most recent call last):
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/page.py", line 5609, in parse
    newsite = self._site.interwiki(prefix)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/site.py", line 956, in interwiki
    return self._interwikimap[prefix].site
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/site.py", line 710, in __getitem__
    raise self._iw_sites[prefix].site
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/site.py", line 673, in site
    self._site = pywikibot.Site(url=self.url)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/__init__.py", line 1238, in Site
    code, fam = _code_fam_from_url(url)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/__init__.py", line 1195, in _code_fam_from_url
    raise SiteDefinitionError("Unknown URL '{0}'.".format(url))
pywikibot.exceptions.SiteDefinitionError: Unknown URL 'https://be-x-old.wikipedia.org/wiki/$1'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "pwb.py", line 253, in <module>
    if not main():
  File "pwb.py", line 246, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 115, in run_python_file
    main_mod.__dict__)
  File "./neexistujici-kotvy.py", line 272, in <module>
    main()
  File "./neexistujici-kotvy.py", line 258, in main
    bot.run()  # guess what it does
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/bot.py", line 1505, in run
    self.treat(page)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/bot.py", line 1733, in treat
    self.treat_page()
  File "./neexistujici-kotvy.py", line 162, in treat_page
    if testovana_stranka.isRedirectPage():
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/page.py", line 811, in isRedirectPage
    return self.site.page_isredirect(self)
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/page.py", line 218, in site
    return self._link.site
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/page.py", line 5705, in site
    self.parse()
  File "/mnt/nfs/labstore-secondary-tools-project/pywikibot/public_html/core/pywikibot/page.py", line 5616, in parse
    .format(self._text, self._site, prefix, e))
pywikibot.exceptions.SiteDefinitionError: be-tarask:Баўгарыя is not a local page on wikipedia:cs, and the interwiki prefix be-tarask is not supported by Pywikibot!
Unknown URL 'https://be-x-old.wikipedia.org/wiki/$1'.
CRITICAL: Closing network session.

Every single time Pywikibot will try to parse [[be-tarask:something]]

Change 529916 had a related patch set uploaded (by Fomafix; owner: Fomafix):
[mediawiki/extensions/WikimediaMaintenance@master] Use https://be-tarask. instead of https://be-x-old.

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

Change 587863 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[mediawiki/extensions/WikimediaMaintenance@master] [bugfix] Fix double redirect with be-tarask wiki

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

@Krenair you seem to be the most knowledgeable on this; can you please review the patch? I don't see any issues with it, but I also don't have a full grasp of the situation.

Change 587863 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[mediawiki/extensions/WikimediaMaintenance@master] [bugfix] Fix double redirect with be-tarask wiki

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

I +2'd this, After it got deployed (next week). I will rebuild the interwiki cache and it should be fixed.

Change 587863 merged by jenkins-bot:
[mediawiki/extensions/WikimediaMaintenance@master] [bugfix] Fix double redirect with be-tarask wiki

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

@Ladsgroup It broke be-tarask interwiki at all. I think this might have something in common with db being named be_x_oldwiki. Could we rename db (and thus fix be-tarask interwiki)?

Otherwise we had to revert the double-redirect patch. Or add another be-x-old -> be-tarask redirect into MW config to fix T111853

@Ladsgroup It broke be-tarask interwiki at all. I think this might have something in common with db being named be_x_oldwiki. Could we rename db (and thus fix be-tarask interwiki)?

Otherwise we had to revert the double-redirect patch. Or add another be-x-old -> be-tarask redirect into MW config to fix T111853

It shouldn't have anything with the db name (we can't rename db anyway, it's not impossible but you need to stop everything for a significant time to be able to do that given the complexity of our infra). let me see what can be done to fix the be-tarask (to fix this whak-a-mole)

It shouldn't have anything with the db name (we can't rename db anyway, it's not impossible but you need to stop everything for a significant time to be able to do that given the complexity of our infra). let me see what can be done to fix the be-tarask (to fix this whak-a-mole)

I don't know, I just say what @Urbanecm tried to explain to me (I might get it wrong).

Please do look what can be done to make be-tarask iw work again preferably without reverting the patch. It seems be-tarask iw is now completely missing, which is weird as it is the current language code of an existing wiki.

Looking at the logic of dumpInterwiki.php, it uses the db name, which would explain why but that might be the reason, let me dig deeper and find a solution.

Yeah, that's what I talked about. Proper solution would be db rename, easy solution would be to add an exception to that dbname -> iw code process

By looking at dumpInterwiki.php, I can't find a simple way to override the lang of current wiki. We could add it, and override be-x-old to become be-tarask, at which point I'd expect interwiki cache to work normally. Alternativelly, we might just add be-tarask interwiki to the Meta interwiki map. What do you think, @Ladsgroup?

Change 602674 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[operations/mediawiki-config@master] Hotfix for the interwiki cache

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

Change 602674 merged by jenkins-bot:
[operations/mediawiki-config@master] Hotfix for the interwiki cache

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

Change 602675 had a related patch set uploaded (by Ladsgroup; owner: Ladsgroup):
[operations/mediawiki-config@master] Add be-tarask to langlist

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

Mentioned in SAL (#wikimedia-operations) [2020-06-05T12:55:05Z] <ladsgroup@deploy1001> Synchronized wmf-config/interwiki.php: Hotfix for be-tarask interwiki link being broken (T111853) (duration: 01m 00s)

Okay, It should be fixed now.
My suggestion is to add be-tarask to langlist file. That solved the issue and generated the hotfix I just deployed. the hotfix will get undeployed if 602675 doesn't get merged soon (and someone runs the scap update-interwiki-cache) . @Urbanecm Having the language name in langlist file seems less hacky than put it into interwiki map. What do you think?

Thanks for the hotfix. Indeed, adding to langlist seems to be the sanest thing.

Could we remove be-x-old from langlist? Can it break something?

Could we remove be-x-old from langlist? Can it break something?

I tried it (then generated the interwiki dump). It removed all interwiki links of be-x-old, meaning [[:be-x-old:foo]] would stop working. I rather try it in another time (gradual improvements).

It has been effectively handed off to you anyway :)

Could we remove be-x-old from langlist? Can it break something?

I tried it (then generated the interwiki dump). It removed all interwiki links of be-x-old, meaning [[:be-x-old:foo]] would stop working. I rather try it in another time (gradual improvements).

I see

@Ladsgroup when I go to https://www.wikidata.org/wiki/Q4048908 I still see a sitelink to be_x_old as opposed to be-tarask, while the link itself goes to be-tarask.wikipedia.org

Shouldn't the patch you merged above and the refreshing of interwiki data fixed this?

@Ladsgroup when I go to https://www.wikidata.org/wiki/Q4048908 I still see a sitelink to be_x_old as opposed to be-tarask, while the link itself goes to be-tarask.wikipedia.org

Shouldn't the patch you merged above and the refreshing of interwiki data fixed this?

Nope, that's dbname and already tracked in another ticket: T235505: Rename be-x-old as be-tarask in Wikidata

Change 602675 merged by jenkins-bot:
[operations/mediawiki-config@master] Add be-tarask to langlist

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

Mentioned in SAL (#wikimedia-operations) [2020-06-09T11:15:17Z] <ladsgroup@deploy1001> Synchronized langlist: [[gerrit:602675|Add be-tarask to langlist (T111853)]] (duration: 00m 57s)

This is done. I think.

Change 529916 abandoned by Fomafix:

[mediawiki/extensions/WikimediaMaintenance@master] Use https://be-tarask. instead of https://be-x-old.

Reason:

https://phabricator.wikimedia.org/T111853 is already solved.

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

Change 236966 abandoned by Zabe:

[operations/mediawiki-config@master] Make MediaWiki treat $lang of be_x_oldwiki as be-tarask, just don't change the real DB name

Reason:

This is probably not the way we should/will do this.

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