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
StalledNone
StalledNone
StalledNone
StalledNone
StalledNone
StalledNone
StalledNone
StalledNone
StalledNone
StalledNone
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

Regarding running a bot:
It's possible to do this but we should remove b-x-old usages wherever we see it (except in user space) instead of changing them into be-tarask, I can run a bot in userspace if you want :)

Why remove?

I agree that if a bot happens to find a page where all the links (not just be-x-old) can be auto-migrated to Wikidata, then it should be done (except user space).

But as far as I know, some links still cannot be migrated because of conflicts and such. Wherever this happens, be-x-old should be replaced, and in user space it should be everywhere.

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

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

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.

jayvdb added a subscriber: jayvdb.Sep 10 2015, 3:55 AM

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.

Krenair removed Krenair as the assignee of this task.Oct 17 2015, 5:53 PM
Restricted Application added a subscriber: JEumerus. · View Herald TranscriptApr 4 2016, 11:45 AM
Krinkle removed a subscriber: Krinkle.Apr 4 2016, 11:36 PM

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

Dvorapa updated the task description. (Show Details)Dec 20 2017, 10:21 AM
Dvorapa added a comment.EditedJun 19 2018, 8:45 AM

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

As far as I know, the really important blocker is T114772: Allow entering Wikidata sitelinks to wikis that have non-typical wiki ID (not matching the database name).

@daniel , @Lydia_Pintscher , any news about that?.. I'm trying to bring this up every few months.

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

Krinkle updated the task description. (Show Details)Aug 26 2019, 3:44 PM

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

Huji added a subscriber: Huji.May 27 2020, 12:42 PM

@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

Dvorapa added a comment.EditedJun 5 2020, 12:17 PM

@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

Dvorapa reopened this task as Open.Jun 5 2020, 12:18 PM

@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.

Dvorapa removed Dvorapa as the assignee of this task.Jun 5 2020, 1:01 PM

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).

Huji assigned this task to Ladsgroup.Jun 5 2020, 1:32 PM

It has been effectively handed off to you anyway :)

Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptJun 5 2020, 1:32 PM

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

Huji added a comment.Jun 6 2020, 8:11 PM

@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)

Ladsgroup closed this task as Resolved.Aug 3 2020, 8:10 AM

This is done. I think.

Maintenance_bot moved this task from Incoming to Done on the User-Ladsgroup board.Aug 3 2020, 8:15 AM