Page MenuHomePhabricator

TypeError: Return value of Title::getInterwiki() must be of the type string, null returned
Closed, DuplicatePublicPRODUCTION ERROR

Description

List of steps to reproduce:

  • run redirect.py script

What happens?:

wikipedia:kn

>>> ಚರ್ಚೆಪುಟ:ಚುಟುಕು <<<
WARNING: API error internal_api_error_TypeError: [1f9776d1-9aa9-4e54-b750-aea8c9
d3fff8] Caught exception of type TypeError
ERROR: Detected MediaWiki API exception internal_api_error_TypeError: [1f9776d1-
9aa9-4e54-b750-aea8c9d3fff8] Caught exception of type TypeError
[errorclass: TypeError;
 servedby: mw1356]; raising

3 pages read
0 pages written
0 pages skipped
Execution time: 5 seconds
Read operation time: 1.7 seconds
Script terminated by exception:

ERROR: APIMWError: internal_api_error_TypeError: [1f9776d1-9aa9-4e54-b750-aea8c9
d3fff8] Caught exception of type TypeError
[errorclass: TypeError;
 servedby: mw1356]
Traceback (most recent call last):
  File "C:\pwb\core\pwb.py", line 423, in <module>
    if not main():
  File "C:\pwb\core\pwb.py", line 418, in main
    module)
  File "C:\pwb\core\pwb.py", line 113, in run_python_file
    main_mod.__dict__)
  File ".\scripts\redirect.py", line 881, in <module>
    main()
  File ".\scripts\redirect.py", line 860, in main
    bot.run()
  File "C:\pwb\core\pywikibot\bot.py", line 1601, in run
    self.treat(page)
  File ".\scripts\redirect.py", line 754, in treat
    super().treat(page)
  File "C:\pwb\core\pywikibot\bot.py", line 1856, in treat
    self.treat_page()
  File ".\scripts\redirect.py", line 570, in delete_1_broken_redirect
    targetPage = redir_page.getRedirectTarget()
  File "C:\pwb\core\pywikibot\page\__init__.py", line 1564, in getRedirectTarget

    return self.site.getredirtarget(self)
  File "C:\pwb\core\pywikibot\site\_apisite.py", line 1222, in getredirtarget
    result = query.submit()
  File "C:\pwb\core\pywikibot\data\api.py", line 1817, in submit
    if self._internal_api_error(code, error, result):
  File "C:\pwb\core\pywikibot\data\api.py", line 1666, in _internal_api_error
    raise e
pywikibot.exceptions.APIMWError: internal_api_error_TypeError: [1f9776d1-9aa9-4e
54-b750-aea8c9d3fff8] Caught exception of type TypeError
[errorclass: TypeError;
 servedby: mw1356]
CRITICAL: Exiting due to uncaught exception <class 'pywikibot.exceptions.APIMWEr
ror'>

Other internal_api_error_TypeError I've found:

wikipedia:tt

>>> Кулланучы:Lucien leGrey <<<
WARNING: API error internal_api_error_TypeError: [1c3349e9-4170-4af4-a0bd-908c1b
3d73c2] Caught exception of type TypeError
ERROR: Detected MediaWiki API exception internal_api_error_TypeError: [1c3349e9-
4170-4af4-a0bd-908c1b3d73c2] Caught exception of type TypeError
[errorclass: TypeError;
 servedby: mw1410]; raising

wikipedia:tt

>>> Кулланучы:Lucien leGrey <<<
WARNING: API error internal_api_error_TypeError: [72ee473b-bbcb-475d-b3f8-40495a
e8576b] Caught exception of type TypeError
ERROR: Detected MediaWiki API exception internal_api_error_TypeError: [72ee473b-
bbcb-475d-b3f8-40495ae8576b] Caught exception of type TypeError
[errorclass: TypeError;
 servedby: mw1346]; raising

What should have happened instead?:

Either work as expected and get the retrieved Information or give a more precise error message. I've no glue what this internal_api_error_TypeError means

Software version:
Pywikibot 7.0.0.dev0


2021-11-14 04:01:25 [1f9776d1-9aa9-4e54-b750-aea8c9d3fff8] mw1356 knwiki 1.38.0-wmf.7 exception ERROR: [1f9776d1-9aa9-4e54-b750-aea8c9d3fff8] /w/api.php?action=query&prop=info&titles=%E0%B2%9A%E0%B2%B0%E0%B3%8D%E0%B2%9A%E0%B3%86%E0%B2%AA%E0%B3%81%E0%B2%9F%3A%E0%B2%9A%E0%B3%81%E0%B2%9F%E0%B3%81%E0%B2%95%E0%B3%81&redirects=&meta=userinfo&uiprop=blockinfo%7Chasmsg&rawcontinue=&maxlag=6&format=json   TypeError: Return value of Title::getInterwiki() must be of the type string, null returned {"exception_url":"/w/api.php?action=query&prop=info&titles=%E0%B2%9A%E0%B2%B0%E0%B3%8D%E0%B2%9A%E0%B3%86%E0%B2%AA%E0%B3%81%E0%B2%9F%3A%E0%B2%9A%E0%B3%81%E0%B2%9F%E0%B3%81%E0%B2%95%E0%B3%81&redirects=&meta=userinfo&uiprop=blockinfo%7Chasmsg&rawcontinue=&maxlag=6&format=json","reqId":"1f9776d1-9aa9-4e54-b750-aea8c9d3fff8","caught_by":"entrypoint"} 
[Error TypeError] (/srv/mediawiki/php-1.38.0-wmf.7/includes/Title.php:970) Return value of Title::getInterwiki() must be of the type string, null returned
  #0 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiPageSet.php(1221): Title->getInterwiki()
  #1 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiPageSet.php(1166): ApiPageSet->loadRedirectTargets()
  #2 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiPageSet.php(952): ApiPageSet->resolvePendingRedirects()
  #3 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiPageSet.php(295): ApiPageSet->initFromTitles(array)
  #4 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiPageSet.php(208): ApiPageSet->executeInternal(boolean)
  #5 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiQuery.php(615): ApiPageSet->execute()
  #6 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiMain.php(1888): ApiQuery->execute()
  #7 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiMain.php(867): ApiMain->executeAction()
  #8 /srv/mediawiki/php-1.38.0-wmf.7/includes/api/ApiMain.php(838): ApiMain->executeActionWithErrorHandling()
  #9 /srv/mediawiki/php-1.38.0-wmf.7/api.php(90): ApiMain->execute()
  #10 /srv/mediawiki/php-1.38.0-wmf.7/api.php(45): wfApiMain()
  #11 /srv/mediawiki/w/api.php(3): require(string)
  #12 {main}

Details

MediaWiki Version
1.38.0-wmf.7
Request URL
https://kn.wikipedia.org/w/api.php?action=query&prop=info&titles=%E0%B2%9A%E0%B2%B0%E0%B3%8D%E0%B2%9A%E0%B3%86%E0%B2%AA%E0%B3%81%E0%B2%9F%3A%E0%B2%9A%E0%B3%81%E0%B2%9F%E0%B3%81%E0%B2%95%E0%B3%81&redirects=&meta=userinfo&uiprop=blockinfo%7Chasmsg&rawcontinue=&maxlag=6&format=json

Event Timeline

Reedy renamed this task from submitting a "info" query leads to internal_api_error_TypeError to TypeError: Return value of Title::getInterwiki() must be of the type string, null returned.Nov 14 2021, 5:20 PM
Reedy changed the subtype of this task from "Bug Report" to "Production Error".
Reedy set Request URL to kn.wikipedia.org/w/api.php?action=query&prop=info&titles=%E0%B2%9A%E0%B2%B0%E0%B3%8D%E0%B2%9A%E0%B3%86%E0%B2%AA%E0%B3%81%E0%B2%9F%3A%E0%B2%9A%E0%B3%81%E0%B2%9F%E0%B3%81%E0%B2%95%E0%B3%81&redirects=&meta=userinfo&uiprop=blockinfo%7Chasmsg&rawcontinue=&maxlag=6&format=json.
Reedy updated the task description. (Show Details)
Reedy set Release Version to 1.38.0-wmf.7.
Reedy changed Request URL from kn.wikipedia.org/w/api.php?action=query&prop=info&titles=%E0%B2%9A%E0%B2%B0%E0%B3%8D%E0%B2%9A%E0%B3%86%E0%B2%AA%E0%B3%81%E0%B2%9F%3A%E0%B2%9A%E0%B3%81%E0%B2%9F%E0%B3%81%E0%B2%95%E0%B3%81&redirects=&meta=userinfo&uiprop=blockinfo%7Chasmsg&rawcontinue=&maxlag=6&format=json to https://kn.wikipedia.org/w/api.php?action=query&prop=info&titles=%E0%B2%9A%E0%B2%B0%E0%B3%8D%E0%B2%9A%E0%B3%86%E0%B2%AA%E0%B3%81%E0%B2%9F%3A%E0%B2%9A%E0%B3%81%E0%B2%9F%E0%B3%81%E0%B2%95%E0%B3%81&redirects=&meta=userinfo&uiprop=blockinfo%7Chasmsg&rawcontinue=&maxlag=6&format=json.