Anomie added a comment.

  In T224712#5920305 <https://phabricator.wikimedia.org/T224712#5920305>, 
@Dvorapa wrote:
  
  > @Anomie @Jdforrester-WMF I broke Pywikibot login loop and found out the 
issue with zh.wikisource.org. It seems API sometimes reacts weirdly to 
action=login requests. For 
`format=json&lgname=Pywikibot-test&action=login&maxlag=5&lgpassword=[secure]&lgtoken=77c559a0bf34eaf6755aaebca7a56ba25e5693bf+\`
 API responds with `API warning (login): Fetching a token via "action=login" is 
deprecated. Use "action=query&meta=tokens&type=login" instead.` and the result 
contains `NeedToken` and a token, which gives `invalid` if checked by 
`checktoken`.
  > [...]
  > There are two weird things: Why doesn't API accept lgtoken in the first 
request (token is freshly generated) and why NeedToken gives invalid tokens 
afterwards (which results with a login loop)?
  
  Yes, that was fairly obvious as to what was happening from 
https://travis-ci.org/wikimedia/pywikibot/jobs/654150636, as it already logged 
that warning. That's caused by the session being lost on every new request.
  
  There are, broadly, three ways the session might be lost:
  
  1. Something in MediaWiki's session handling is broken, as was the case for 
en.wikisource.beta.wmflabs.org earlier.
  2. Something in your client (probably cookie handling) is broken. This can 
include the client somehow having a stale/corrupt cookie that isn't removed by 
MediaWiki's attempts to unset it.
  3. Some proxy in between your client and MediaWiki is breaking the request 
somehow.
  
  My being unable to reproduce it in locally (several times now over a few 
days) makes #1 seem less likely, as does the fact that there's no "Unbreak 
Now!" task open about this affecting human users. But that doesn't completely 
rule it out.
  
  Being able to examine the actual HTTP request and response headers for all 
requests during the failed login would go a long way towards investigating #2, 
which is why I asked for that. Unfortunately the log you provided does not seem 
to contain that information.

TASK DETAIL
  https://phabricator.wikimedia.org/T224712

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Pchelolo, Anomie
Cc: Jdforrester-WMF, Pchelolo, Anomie, Dvorapa, Framawiki, Aklapper, 
pywikibot-bugs-list, Dalba, Xqt, Beast1978, Un1tY, Zkhalido, Hook696, 
Daryl-TTMG, RomaAmorRoma, E.S.A-Sheild, WDoranWMF, Meekrab2012, joker88john, 
Viztor, DannyS712, CucyNoiD, NebulousIris, Wenyi, Gaboe420, Versusxo, 
Majesticalreaper22, Amorymeltzer, Giuliamocci, Adrian1985, Cpaulf30, Af420, 
Darkminds3113, Bsandipan, Lordiis, Adik2382, Th3d3v1ls, Ramalepe, Liugev6, 
Tbscho, MayS, Sethakill, WSH1906, Lewizho99, Mdupont, JJMC89, Maathavan, dg711, 
Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, Alchimista, Rxy, Jay8g, 
Krenair, Legoktm
_______________________________________________
pywikibot-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to