Stashbot now just shows the following error whenever someone tries to log a message (seen in #wikimedia-cloud and #wikimedia-operations):
<stashbot> dcaro: Failed to log message to wiki. Somebody should check the error logs.
Error writing to wiki Traceback (most recent call last): File "/data/project/stashbot/stashbot/sal.py", line 204, in log url = self._write_to_wiki(bang, channel_conf) File "/data/project/stashbot/stashbot/sal.py", line 373, in _write_to_wiki resp = page.save("\n".join(lines), summary=summary, bot=True) File "/data/project/stashbot/venv-k8s-py39/lib/python3.9/site-packages/mwclient/page.py", line 179, in save return self.edit(*args, **kwargs) File "/data/project/stashbot/venv-k8s-py39/lib/python3.9/site-packages/mwclient/page.py", line 184, in edit return self._edit(summary, minor, bot, section, text=text, **kwargs) File "/data/project/stashbot/venv-k8s-py39/lib/python3.9/site-packages/mwclient/page.py", line 207, in _edit raise mwclient.errors.NoWriteApi(self) mwclient.errors.NoWriteApi: <Page object 'b'Server Admin Log'' for <Site object 'wikitech.wikimedia.org/w/'>>
Looking at the mwclient source code, I think this is because mwclient expects to see writeapi in the action=query&meta=siteinfo response:
# Extract site info self.site = meta['query']['general'] self.namespaces = { namespace['id']: namespace.get('*', '') for namespace in meta['query']['namespaces'].values() } self.writeapi = 'writeapi' in self.site
(And if self.writeapi [where self is a Site] is false, then it throws the NoWriteApi error seen in the logs later:)
def _edit(self, summary, minor, bot, section, **kwargs): # (snip) if not self.site.writeapi: raise mwclient.errors.NoWriteApi(self)
With the current train status, that flag is still present on enwiki, but not on Wikitech, because we dropped writeapi flag from siteinfo API as part of T294397: Drop writeapi MediaWiki right. I believe this breaks, or will break (when the train reaches the relevant wiki), all mwclient-based bots which make edits.