Page MenuHomePhabricator

API warning (query): Unrecognized value for parameter "meta": wikibase.
Closed, ResolvedPublic

Description

My redirect.py bot sometimes outputs the warning: "WARNING: API warning (query): Unrecognized value for parameter "meta": wikibase." Not sure what it refers to. The bot seems to continue processing after all, but maybe worth having a look.

WARNING: API warning (query): Unrecognized value for parameter "meta": wikibase.

Event Timeline

The error Unrecognized value for parameter "meta": wikibase. indicates that the bot is including meta=wikibase in the request to action=query but the wiki does not have a meta module by that name. You can check the modules available for the meta parameter to action=query on a wiki using action=help&modules=query, or programmatically using action=paraminfo&modules=query.

@Anomie My bot is a standard pywikibot one, using the standard Pywikibot-redirect.py script. Could that information be obtained using APISandbox? And if I find those modules missing, what can we do? Sorry but I'm not very knowledefull in this kind of things. Thanks.

I have also bumped into this. It happens when you are working on a wiki which is not a Wikibase (ie. Wikidata) client.

This warning should be prevented per APISite.data_repository():

def handle_warning(mod, warning):
  return (mod == 'query' and
          warning == "Unrecognized value for parameter 'meta': "
                     "wikibase")

but it doesn't work (so there must have been some change in API).

Could that information be obtained using APISandbox?

Yes.

And if I find those modules missing, what can we do?

That's for pywikibot devs to determine.

but it doesn't work (so there must have been some change in API).

Looks like you identified it with the addition of T152598: Check Pywikibot for Mediawiki api Error code and other message reporting changes as a parent task.

In this case, the wikis where my bot operates are all Wikidata clients.
Thanks.

Are you sure? meta=wikibase is only available on Wikidata clients, so if the wiki's API throws this warning, it cannot be.

Anyway, Pywikibot needs to be updated not to print this warning (ie. the workaround above should be fixed).

Sorry, the project was an.wikipedia where the page was malformed: https://an.wikipedia.org/w/index.php?title=Usuario:OrbiliusMagister&oldid=241360

However an.wikipedia does support wikibase.

Retrieving 1 pages from wikipedia:an.
 ***

>>> Usuario:OrbiliusMagister <<< ***
Usuario:OrbiliusMagister is on another site.
WARNING: API warning (query): Unrecognized value for parameter "meta": wikibase.
Retrieving double redirect special page...
WARNING: API warning (query): Unrecognized value for parameter "meta": wikibase.

Could you post the command? I can't reproduce it.

Also are you running pywikibot from the master branch or via pip?

I did a $ grep -rP 'meta.+wikibase' --exclude-dir .git on the HEAD of both 2.0 branch and master branch. 2.0 branch found no results, while the only result for master branch is within APISite.data_repository()

Aha! I think I know the reason. Claiming.

Change 335254 had a related patch set uploaded (by Zhuyifei1999):
APISite.data_repository(): handle warning with re.match()

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

To reproduce this:

>>> __import__('pywikibot').Site('en', 'wiktionary').data_repository()
WARNING: API warning (query): Unrecognized value for parameter "meta": wikibase.

The response dict:

{u'query': {u'userinfo': {u'anon': u'', u'id': 0, u'name': u'REDACTED'}}, u'warnings': {u'query': {u'*': u'Unrecognized value for parameter "meta": wikibase.'}}}
zhuyifei1999 added a project: Regression.

Regression from 4e6810e
Priority: Low because it really affects nothing... besides having more verbose logs (assuming no butterfly effect of course :) )

Change 335254 merged by jenkins-bot:
APISite.data_repository(): handle warning with re.match()

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

@MarcoAurelio could you please confirm this is no longer present on after you update the code to master? I'm not so familiar with redirect.py, and the only place where APISite.data_repository() is directly called seems to be outside a loop.

Mpaa reopened this task as Open.

@MarcoAurelio could you please confirm this is no longer present on after you update the code to master? I'm not so familiar with redirect.py, and the only place where APISite.data_repository() is directly called seems to be outside a loop.

Hi and thank you very much for the work done. Since my bot is running using the shared pywikibot script files at Tool Labs I'll have to wait till they're updated to give you a reply. In theory I could test on my machine, but since my cronned tasks involves some projects, I'd prefer to wait and see if it throws the errors again. Hope that you don't mind. Best regards.

I've checked the bot logs on Tool Labs for the most recent performed tasks and I confirm I don't see the warning anymore. Thanks for your work.