Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readapidenied errors #13

Open
stcmeh opened this issue Jan 31, 2023 · 0 comments
Open

readapidenied errors #13

stcmeh opened this issue Jan 31, 2023 · 0 comments

Comments

@stcmeh
Copy link

stcmeh commented Jan 31, 2023

We've upgraded our Wiki to a new version of mediaWiki and now ceterach doesn't work anymore.

Here's the dump:

  File "/home/cad/anaconda/Anaconda3-2020.11/lib/python3.8/site-packages/ceterach-0.0.1-py3.8.egg/ceterach/utils.py", line 42, in wrapped
    if not hasattr(self, attr): self.load_attributes()

  File "/home/cad/anaconda/Anaconda3-2020.11/lib/python3.8/site-packages/ceterach-0.0.1-py3.8.egg/ceterach/page.py", line 107, in load_attributes
    self.__load(res)

  File "/home/cad/anaconda/Anaconda3-2020.11/lib/python3.8/site-packages/ceterach-0.0.1-py3.8.egg/ceterach/page.py", line 128, in __load
    res = res or next(i(kwargs, use_defaults=False))

  File "/home/cad/anaconda/Anaconda3-2020.11/lib/python3.8/site-packages/ceterach-0.0.1-py3.8.egg/ceterach/api.py", line 384, in olditerator
    res = self.call(params, rawcontinue='', **more_params)

  File "/home/cad/anaconda/Anaconda3-2020.11/lib/python3.8/site-packages/ceterach-0.0.1-py3.8.egg/ceterach/api.py", line 271, in call
    return self._call(params, more_params, use_defaults=use_defaults)

  File "/home/cad/phozone/latest/python/mwiki.py", line 140, in dbg_call
    raise raiseme

CeterachError: You need read permission to use this module.

I managed to hack a copy of api._call and print out the input parameters:

ceterach.api._call({'prop': ('info', 'revisions', 'categories'), 'rvprop': ('ids', 'flags', 'timestamp', 'user', 'comment', 'content'), 'inprop': ('protection',), 'rvlimit': 1, 'rvdir': 'older', 'titles': 'Test'},{'rawcontinue': ''},False)

the return json is:

{'error': {'code': 'readapidenied', 'info': 'You need read permission to use this module.', '*': 'See http://wiki.phoelex.com/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.'}}

There's a similar problem in the java api which is fixed by calling their "setVersion" function - it's described in stackoverflow here: https://stackoverflow.com/questions/57146687/how-to-fix-readapidenied-error-on-mediawiki-api-in-java

So I'm guessing that something changed in the versions of Wiki that means running a query through the api must be done differently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant