Last modified: 2014-01-03 16:21:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T61507, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 59507 - DRTRIGON-112 subster_irc bot forgets wiki login when accessing other mediawiki project
DRTRIGON-112 subster_irc bot forgets wiki login when accessing other mediawik...
Status: RESOLVED FIXED
Product: Tool Labs tools
Classification: Unclassified
DrTrigonBot - General (Other open bugs)
unspecified
All All
: Unprioritized major
: ---
Assigned To: Bugzilla Bug Importer (valhallasw)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-03 16:21 UTC by Bugzilla Bug Importer (valhallasw)
Modified: 2014-01-03 16:21 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:36 UTC
This issue was converted from https://jira.toolserver.org/browse/DRTRIGON-112.
Summary: subster_irc bot forgets wiki login when accessing other mediawiki project
Issue type: Bug - A problem which impairs or prevents the functions of the product.
Priority: Major
Status: Closed
Assignee: drtrigon <dr.trigon@surfeu.ch>

-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Tue, 17 Jan 2012 19:06:41
-------------------------------------------------------------------------------

When looking at the logfile from 2012-01-17 for following comments and later:

> 2012-01-17 19:44:36,744 bot_control INFO Password for user DrTrigonBot on wikipedia:de:

the subster bot (may be just when used by subster_irc...?!?) asks for the wiki password.  
(look also at difflink in URL - which triggered the error in the logfile)

We have to protect the bot from logging out when accessing foreign wikis!
Comment 1 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:37 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Fri, 20 Jan 2012 10:09:29
-------------------------------------------------------------------------------

This does not apply when accessing the same external wikis by API, as can be seen in [1].

[1] http://de.wikipedia.org/w/index.php?title=Benutzer:DrTrigon/Spielwiese&diff=98597085&oldid=98597019&diffonly=0
Comment 2 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:39 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Sat, 28 Jan 2012 14:06:11
-------------------------------------------------------------------------------

A possible solution or work-a-round for this problem is to use 'site._load(force=True)' to re-login e.g.
    
    external_buffer = self.site.getUrl(param['url'], no_hostname = True)
    if self.site.loggedInAs() is None: self.site._load(force=True)
Comment 3 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:41 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Sat, 28 Jan 2012 14:42:47
-------------------------------------------------------------------------------

This (work-a-round) was implemented in r259.
Comment 4 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:42 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Sat, 28 Jan 2012 15:06:39
-------------------------------------------------------------------------------

Critical -> Major

The bug is solved (work-a-round) but since subster_irc runs multi-threaded it is still possible that on thread tries to write in between 'getUrl' and '_load' from other thread and thus will raise and error. Thus the whole logout should be prevented and not happen at all!
Comment 5 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:44 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Mon, 30 Jan 2012 10:33:23
-------------------------------------------------------------------------------

Started the discussion on the list, look at http://lists.wikimedia.org/pipermail/pywikipedia-l/2012-January/007182.html

From that it seems to be hard to find a consensus since in fact I am "abusing" the function here. But a very slight modification to the function would solve all problems... Thus there has to be a useful consensus...
Comment 6 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:45 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Wed, 01 Feb 2012 16:32:36
-------------------------------------------------------------------------------

Re-merge with pywikipedia framework (increase to v1.2) and solve the problem as worked out on maillist. Create a new generic getUrl function (from old one in site class) and specialize it into the one in site class. Similar to the solution in rewrite.

May be this has to be discussed further with Merlijn (valhallasw) since from rewrite it seams to me that it could be impossible to separate into the whished 2 functions... but let's solve this later... ![][1]

   [1]: https://jira.toolserver.org/images/icons/emoticons/wink.gif
Comment 7 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:47 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Thu, 02 Feb 2012 10:09:14
-------------------------------------------------------------------------------

  * http://lists.wikimedia.org/pipermail/pywikipedia-l/2012-January/007205.html
  * http://lists.wikimedia.org/pipermail/pywikipedia-l/2012-February/007223.html
Comment 8 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:48 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Sun, 05 Feb 2012 02:19:57
-------------------------------------------------------------------------------

Another issue - may be related, may be not (but can be solved in same session, since hast to be done upstream) is the fact that the framework seems to have trouble handling e.g. arwiki. 'live_version' has a bug there (raises an error) and also login seems to be problematic because of:
    
    2012-02-05 02:11:17,512 bot_control          INFO     WARNING: Your account on wikipedia:ar is blocked by False.
    2012-02-05 02:11:17,512 bot_control          INFO     Reason: أيبي التول سيرفر
    2012-02-05 02:11:17,512 bot_control          INFO     Editing using this account will stop the run.
    

The first issue was worked-a-round by skipping this request for 'ar' in r261.
Comment 9 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:50 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Thu, 16 Feb 2012 20:49:55
-------------------------------------------------------------------------------

The work-a-round was removed because of fix of 'live_version' upstream in r8900. Done in r269.
Comment 10 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:52 UTC
-------------------------------------------------------------------------------
From: drtrigon <dr.trigon@surfeu.ch>
Date: Thu, 16 Feb 2012 22:58:18
-------------------------------------------------------------------------------

updated analogue to rewrite; 'getUrl' moved/splitted to 'pywikibot.comms.http.request'  
the generic one does not attempt to (re)login on the target if it is a wiki

upstream r9901.

Ported and done in r270.
Comment 11 Bugzilla Bug Importer (valhallasw) 2014-01-03 16:21:53 UTC
This bug was imported as RESOLVED. The original assignee has therefore not been
set, and the original reporters/responders have not been added as CC, to
prevent bugspam.

If you re-open this bug, please consider adding these people to the CC list:
Original assignee: dr.trigon@surfeu.ch
CC list: dr.trigon@surfeu.ch

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links