[07:38:17] [telegram] Was the train rolled back? [07:40:44] [telegram] On tw.wikipedia.org, I see localized strings in a state in which they were a month ago. [07:41:16] [telegram] Many are untranslated, or translated into an old version. [07:46:42] @amire80: yes, back to wmf.9 because of a memory leak, https://phabricator.wikimedia.org/T297517 [08:19:45] [telegram] Thanks! [08:45:32] [telegram] :( [15:25:11] [telegram] Spam (re @企业账户+4件套+@ka969: ) [15:30:34] wmf.9, the version that never ends [17:43:52] [telegram] Does anyone know what was deployed on October 7 after 18:00 UTC that made my bot stop working? [17:43:52] [telegram] https://uk.wikipedia.org/w/index.php?title=Шаблон:NUMBEROFACTIVEUSERSAGGR&action=history [17:43:54] [telegram] For fuck's sake how I am sick of all the damn breaking changes that make you then spend hours of your volunteer time trying to fix stuff that is if you even notice it, as in this case I didn't (in the last 2 instances WMF changes broke the bot I have managed to notice it within 2 days) [17:45:13] [telegram] How is it broken? [17:45:26] https://www.mediawiki.org/wiki/MediaWiki_1.37/Deprecation_of_legacy_API_token_parameters [17:45:36] [telegram] I don't know :) It doesn't edit. The crontab is still running and stuff [17:46:07] [telegram] Thanks (re @wmtelegram_bot: [irc] https://www.mediawiki.org/wiki/MediaWiki_1.37/Deprecation_of_legacy_API_token_parameters) [17:46:08] yup, that'll be the removal of token APIs that have been deprecated since 2014 [17:46:59] [telegram] The bot was written after 2014 🤷‍♂️ [17:47:13] unfortunately most bot frameworks weren't [17:47:16] [telegram] does the bot use pywikibot? [17:47:23] [telegram] Of course not [17:47:32] [telegram] I hate Python [17:47:39] looks like https://github.com/mer-c/wiki-java has been fixed, so you should be able to just update that [17:47:58] [telegram] This particular one uses botclasses.php [17:48:56] [telegram] yup, that still uses the old code https://github.com/teopedia/mediawiki-botclasses/blob/d759ec877b4e6a559cc3bf7e97d0be77850174fb/botclasses.php#L445 [17:48:58] [telegram] Do you know what version? It was forked in various places... [17:49:01] [telegram] /delete@wikilinksbot [17:49:16] [telegram] I updated https://github.com/wikimedia/mediawiki-tools-release/blob/master/make-deploy-notes/botclasses.php for example [17:50:01] [telegram] Here is the one copypasted in my repo https://bitbucket.org/cladis/numberofactiveusersaggr/src/master/botclasses.php [17:50:10] [telegram] not sure what version it is [17:51:26] looks like diverging forks [17:52:26] [telegram] The diff does not look bad, lemmi try to just replace one with another and see if it works [17:52:44] [telegram] (It isn't really worth using composer for this bot) [17:58:57] [telegram] [2021-12-11T17:58:11] /usr/bin/php exited with code 255. Respawning... [17:58:57] [telegram] [2021-12-11T17:58:16] /usr/bin/php exited with code 255. Respawning... [17:58:58] [telegram] [2021-12-11T17:58:22] /usr/bin/php exited with code 255. Respawning... [17:59:00] [telegram] [2021-12-11T17:58:27] /usr/bin/php exited with code 255. Respawning... [17:59:01] [telegram] [2021-12-11T17:58:33] /usr/bin/php exited with code 255. Respawning... [17:59:03] [telegram] hmm does not look like it has worked [17:59:08] [telegram] I'm not sure there's a canonica for it... Last time I looked, I think it was a Wikipage [18:04:11] [telegram] I'm not sure there's a canonical for it... Last time I looked, I think it was a Wikipage [18:10:07] https://github.com/legoktm/harej-bots/blob/master/botclasses.php [18:10:35] I fixed that one in...2015. [18:10:57] [telegram] heh [18:17:05] [telegram] let's try this one then :) [18:17:27] [telegram] (while I have started trying to remember how to run Toolforge's image locally) [18:19:56] [telegram] seems to result in the same error that before [18:19:57] [telegram] [2021-12-11T18:18:57] /usr/bin/php exited with code 255. Respawning... [18:19:58] [telegram] [2021-12-11T18:19:03] /usr/bin/php exited with code 255. Respawning... [18:20:00] [telegram] [2021-12-11T18:19:08] /usr/bin/php exited with code 255. Respawning... [18:20:01] [telegram] [2021-12-11T18:19:14] /usr/bin/php exited with code 255. Respawning... [18:20:29] [telegram] I mean perhaps I am doing something wrong, but I have copypasted the command to run it from my crontab, [18:20:30] [telegram] jstart -N updatenumberofactiveusersaggrukwiki -mem 500m php /data/project/basebot/public_html/numberofactiveusersaggr/index.php [18:22:41] 255 is a fatal error [18:22:42] [telegram] Check the logs... And/or try running it without running it as a job? [18:22:52] What's in stdout/stderr? [18:25:38] [telegram] well that is stderr I assume. or at least the contents of updatenumberofactiveusersaggrukwiki.err so I assume jstart writes stderr there [18:26:05] [telegram] oh, strout actuall has an error [18:26:20] [telegram] it didn't occur to be that it would go there [18:26:58] [telegram] there isn't now a wikipedia::setUserAgent() method it seems [18:28:14] Maybe you're better off using the same botclasses you already have and just applying https://github.com/legoktm/harej-bots/commit/279002f3cc2adad8bbfdb3219506d20dfa8557d0#diff-0a770fd088832f0de6a98129a1f50612131a8430b42cd320f6f9ffe96a06568b [18:30:37] [telegram] hm, might be so. I mean I can potentially remove call to setUserAgent, but I wonder why it is removed (never added?) in the version you have [18:32:08] Dunno, my copy comes from Toolserver SVN. [18:32:38] botclasses is great, except when it's not, so I'm slowly rewriting it all in Rust. [18:33:30] These days if I wanted to use PHP I'd probably pick https://addwiki.github.io/ [18:40:02] [telegram] yeah I think that is what I've been using for PHP bots for the last couple of years [18:40:52] [telegram] but when this particular bot was written I didn't even know PHP, I think it was just the last framework I've had to deal with at that point since I was fixing another user's bot at that time [18:42:09] [telegram] Rust sounds like fun, but since I am now working as a PHP dev IRL I am kinda stuck with it. Although I want to learn either Java or Kotlin or both since I've always wanted to try Android development [18:42:34] [telegram] (I kinda messed around with some j2me code back in the days…) [19:30:34] [telegram] I went with the legoktm's suggestion of just applying the fix to the existing one, but as I didn't notice that it was using format json rather than php in it when copypasting it took me extra time to realise that. All in all it took me 1.5 hours of time (with distractions). [19:30:35] [telegram] I am sure that is not the last thing that will have to be fixed because of this deprication. [19:30:36] [telegram] Just yesterday I was rewriting an old Quarry query of mine that did not work because of actor migration, and that one has happened years ago now… [19:32:20] [telegram] And then I also have a now broken, for two reasons really tool. One is quite simple, because of migration to subdomains most likely some rewrites do not work anymore. But another one is a one I don't have a good solution for, as the tool has the following SQL as its core: [19:32:30] [telegram] SELECT $dbwiki.image.img_name [19:32:30] [telegram] FROM $dbwiki.image [19:32:31] [telegram] INNER JOIN commonswiki_p.image [19:32:33] [telegram] ON $dbwiki.image.img_name = commonswiki_p.image.img_name [19:32:34] [telegram] ORDER BY $dbwiki.image.img_name;"; [19:32:39] https://github.com/legoktm/harej-bots/commit/100ec4be9fd771f49d884fd5b1d19cdce84ba70b#diff-0a770fd088832f0de6a98129a1f50612131a8430b42cd320f6f9ffe96a06568b [19:33:19] You can't join arbitrary wiki databases against other wikis anymore [19:33:20] [telegram] And since the cross-db joins were forbidden no good and easy solution to the same problem comes into my mind (re @Thecladis: SELECT $dbwiki.image.img_name [19:33:21] [telegram] FROM $dbwiki.image [19:33:22] [telegram] INNER JOIN commonswiki_p.image [19:33:24] [telegram] ON $dbwiki.image.img_name = commonswiki_p.image.img_name [19:33:25] [telegram] ORDER BY $dbwiki.image.img_name;";) [19:34:06] [telegram] Yes. But that makes finding files that have the same name on local wiki and on Commons, which was what the tool was for, an unexpectedly hard task to solve [19:34:21] [telegram] which used to be a 5 line query before [19:34:45] [telegram] ukwiki for one has thousands of such files [19:35:36] [telegram] I can probably use dump, but then it is not dynamic enough [19:36:19] this is https://phabricator.wikimedia.org/T268240 I guess [19:36:57] [telegram] No [19:37:12] [telegram] that task is about duplicates [19:37:16] https://phabricator.wikimedia.org/T267992#7491239 looks promising [19:37:41] if you just want shadowed files, that's the second task I linked [19:37:41] [telegram] but my tool was detecting situations where an Example.png from local wiki does not let Example.png from Commons to be shown [19:37:51] [telegram] ah [19:42:36] [telegram] It seems to only deal with files that have the same sha hash or something? [19:44:07] [telegram] Let me install Pycharm and try to make more sense of the code I guess [19:45:21] no, it looks for files with the same name [19:45:40] [telegram] but what is the code about sha is doing? [19:46:02] [telegram] I thought it is the filepath thingie, but I think that one uses md5 hashes rather than sha, doesn't it? [19:46:08] it's just batching the query by sha1 to split it up into chunks [19:46:31] instead of doing a single query across the entire image table that would probably just timeout [19:46:53] could've easily done it by page title prefix too, but I think it's more likely that sha1 is evenly spread out [19:46:54] (definitely would timeout) [19:47:16] my original implementation was by title prefix, but it's not anywhere near evenly distributed [19:48:56] [telegram] hmm, interesting [19:49:49] [telegram] well if it is really running around a minute it isn't too bad I guess [19:50:13] https://github.com/AntiCompositeNumber/AntiCompositeBot/blob/f4fb276aff9d2cec38325e038f60bdad47545446/src/shadows.35.py is a modified version that runs on python3.5 with the dependencies that are already available on the toolforge grid [19:51:29] it would not be difficult to reimplement in another language either [20:19:25] [telegram] have you removed it since? Don't see it in master (re @wmtelegram_bot: [irc] https://github.com/AntiCompositeNumber/AntiCompositeBot/blob/f4fb276aff9d2cec38325e038f60bdad47545446/src/shadows.35.py is a modified version that runs on python3.5 with the dependencies that are already available on the toolforge grid) [20:29:55] never put it in master because GreenC decided to run it instead [22:39:18] [telegram] Why does this article transclude itself? https://en.wikipedia.org/wiki/Special:WhatLinksHere/Johnathan_Blake [22:44:39] [telegram] probably an {{#ifexist:}} somewhere (in a template?) (re @amire80: Why does this article transclude itself? https://en.wikipedia.org/wiki/Special:WhatLinksHere/Johnathan_Blake) [22:47:33] Or a Lua module that gets its own page contents [22:49:15] [telegram] yes, this. seems something in a CS1 module does that. so basically every page on enwiki that has a citation template will be listed as transcluding itself. (just checked 5 random pages on enwiki, they're all listed as transcluding themselves) (re @wmtelegram_bot: [irc] Or a Lua module that gets its own page contents) [22:50:54] [telegram] oh right, because they’re checking if the page source contains {{use ymd dates}} or something like that IIRC [22:50:59] [telegram] /delete@wikilinksbot [22:51:26] [telegram] to determine the date formatting style in citations [22:52:14] [telegram] Does parser function also produce that effect? (re @jhsoby: probably an {{#ifexist:}} somewhere (in a template?)) [22:52:25] [telegram] https://en.wikipedia.org/w/index.php?title=Module:Citation/CS1/Configuration&oldid=1054076931#L-517 (re @lucaswerkmeister: oh right, because they’re checking if the page source contains {{use ymd dates}} or something like that IIRC) [22:52:29] [telegram] only ifexist, as far as i know (re @Thecladis: Does parser function also produce that effect?) [22:52:50] [telegram] I tgought only the Lua equivalent of that did. Ouch. [22:53:05] [telegram] This renders what links here useless in some cases [22:53:32] [telegram] Oh (re @wmtelegram_bot: [irc] never put it in master because GreenC decided to run it instead)