Page MenuHomePhabricator

upgrade mwclient (morebots no more log because of MediaWiki semantic versionning)
Closed, ResolvedPublic

Description

Because of T67306: Adopt Semantic Versioning format for WMF deploy branches beginning with 1.27.0-wmf.1 we can no more log in #wikimedia-operations because:

2015-10-01 13:41:55,841 DEBUG: 'production-logbot' got '!log Am I logging?'; Attempting to log.
2015-10-01 13:41:55,990 ERROR: Failed to log message
Traceback (most recent call last):
  File "/usr/lib/adminbot/adminlogbot.py", line 266, in on_pubmsg
    pageurl = adminlog.log(self.config, message, project, author)
  File "/usr/lib/adminbot/adminlog.py", line 15, in log
    site = mwclient.Site(config.wiki_connection, path=config.wiki_path)
  File "/usr/lib/pymodules/python2.7/mwclient/client.py", line 92, in __init__
    self.site_init()
  File "/usr/lib/pymodules/python2.7/mwclient/client.py", line 128, in site_init
    raise errors.MediaWikiVersionError('Unknown MediaWiki %s' % '.'.join(version))
MediaWikiVersionError: Unknown MediaWiki 1.27.0-wmf.1

Found in /data/project/morebots/production-logbot.err

Event Timeline

hashar raised the priority of this task from to High.
hashar updated the task description. (Show Details)
hashar added projects: acl*sre-team, Stashbot.
hashar added subscribers: hashar, 20after4, mmodell, Stashbot.

Seems the issue is in the python module mwclient: https://github.com/mwclient/mwclient.git

I have filled https://github.com/mwclient/mwclient/issues/98

Once fixed, would need someone to git pull the repo and reinstall the module on tools-labs.

Seems the issue is in the python module mwclient

Also see T114349 ?

Just a question: the change was to go from version number such as 1.26wmf24 and now mwclient should probably support also number such as 1.27.0-wmf.1 ?

Yup, it needs to support Semantic versioning. There is a python module for that, and probably others:

Relative python awesomeness: there is a python module that support the semantic versioning spec.

Pypi: https://pypi.python.org/pypi/semantic_version/
Doc: http://pythonhosted.org/semantic_version/

Merged in since I filled the upstream issue.

Latest mwclient doesn't crash. The tool labs install of mwclient is from 2011.

tools.yifeibot@tools-bastion-02:~$ ls -alh /usr/share/pyshared/mwclient/
total 80K
drwxr-xr-x  2 root root 4.0K Apr 22 06:11 .
drwxr-xr-x 41 root root 4.0K Jun  9 10:22 ..
-rw-r--r--  1 root root  18K Apr 10  2011 client.py
-rw-r--r--  1 root root 2.5K Apr 10  2011 compatibility.py
-rw-r--r--  1 root root  847 Apr 10  2011 errors.py
-rw-r--r--  1 root root 2.1K Apr 10  2011 ex.py
-rw-r--r--  1 root root 6.9K Apr 10  2011 http.py
-rw-r--r--  1 root root 1.3K Apr 10  2011 __init__.py
-rw-r--r--  1 root root 6.5K Apr 10  2011 listing.py
-rw-r--r--  1 root root 3.4K Apr 10  2011 page_nowriteapi.py
-rw-r--r--  1 root root  12K Apr 10  2011 page.py
-rw-r--r--  1 root root 3.6K Apr 10  2011 upload.py
zhuyifei1999 renamed this task from morebots no more log because of MediaWiki semantic versionning to upgrade mwclient (morebots no more log because of MediaWiki semantic versionning).Oct 1 2015, 2:09 PM

@zhuyifei1999 that's good news! Can you point me to an up-to-date .deb of that tool? (meanwhile, I will google :) )

Maybe it has been installed via git clone + python setup.py install ?

No, it comes from our repo:

Package python-mwclient:                 
i   0.6.5-1                                                          trusty-wikimedia                              1001

I built python-mwclient_0.8.0~dev1-1_all.deb and provided it on carbon. I also made the inclusion of python-mwclient explicit on tools exec nodes in the attached patch.

So... once we get some puppet runs (20 minutes or so) I can restart the bots and things should/may/might work better.

Note that python-mwclient_0.8.0~dev1-1_all.deb was built directly out of the github source at https://github.com/mwclient/mwclient. I did not bother to import the source into gerrit since I didn't make any changes.

The .deb was built with

$ python setup.py --command-packages=stdeb.command bdist_deb

Just for the record, this SAL tool has been chugging along just fine: https://tools.wmflabs.org/sal/production

Morebots is now re-deployed using a virtualenv rather than using system packages. The logging seems to have become significantly more verbose, but this is less urgent to fix.

Yay. Should we kill the package finally now?

Can y'all open a new task for whatever morebots refactoring you're doing, and then close this one? I think the immediate issue associated with this bug is resolved, twice :)

Yup, it needs to support Semantic versioning. There is a python module for that, and probably others:

It cannot really use such a package because it needs to support both the correct semantic versioning style (1.27.0-wmf.1), and the old-style (1.26wmf24). Anyways, both the latest development version (0.8) and the whole 0.7.x series of mwclient should handle this fine (by just checking the major and minor parts).

Virtualenv fixed it. Well done folks!

@Danmichaelo thanks to have taken the time to comment here and sorry for the lost of time :-)

Note that it's currently not running under a virtualenv (due to miscommunication, @Andrew and I were working on it in parallel and the updated debian-packaged was deployed around the same time).

means that mwclient is broken right now on labs?

means that mwclient is broken right now on labs?

@Andrew fixed it