Page MenuHomePhabricator

Regression: Loginmanager does not make proper use of password parameter
Open, HighPublic

Description

as outlined in T248471 the code

# needs patch as outlined in https://phabricator.wikimedia.org/T248471
           #self.site.login(password=self.getPassword())
           password=self.getPassword()
           lm = LoginManager(password=password, site=self.site, user=self.user)
           lm.login()

does not perform as intended. I get an error message i have replaced wiki lang and user with tags to hide the original message details:

Logging in to <wiki>:<lang> as <user>
WARNING: API error readapidenied: You need read permission to use this module.
WARNING: API error readapidenied: You need read permission to use this module.
ERROR: APIError: readapienied: You need read permission to use this module.
[help: See http://<wiki>.bitplan.com/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes.]
WARNING: API error readapiddenied: You need read permission to use this module.
WARNING: API error readapidenied: You need read permission to use this module.
WARNING: Could not check user <user> exists on <wiki>:<lang>
Password for user <user> on <wiki>:<lang> (no characters will be shown): Warning: Password input may be echoed.

I'd expect that the API calls are not done but a straight login attempt. If API calls must be done and fail this should not lead to the password be forgotten. It shoul not be mandatory to check the user with a siteinfo call.

May be we need a parameter that forces this behavior to avoid this hard to debug situation.

Event Timeline

If checking the version is the issue please user the information from the family file (and trust it) instead of trying to find out via Mediawiki API doing an http request before being logged in ...

If you try to debug the situation and click on "site" in the loginmanager a sequence of API call is initiated ... that makes it even harder to find out what is going on ...

One of the issues seems to be that I don't know how to get rid of the "You need read permission to use this module." messsage on MediaWiki1.35 so that things would at least work for my public wikis.

curl -s "http://test.bitplan.com/api.php?action=query&meta=siteinfo&siprop=general|namespaces|namespacealiases|statistics&format=json" | jq .
{
  "error": {
    "code": "readapidenied",
    "info": "You need read permission to use this module.",
    "*": "See http://test.bitplan.com/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for notice of API deprecations and breaking changes."
  }
}
Xqt triaged this task as High priority.Jan 16 2021, 4:14 PM
Xqt added a project: Regression.

@Xqt - thanks for trying again. I still have some project based on pywikibot although I am trying to avoid it and use mwclient more these days due to this limited useability in intranet situations.