Dvorapa added a comment.

  In T224712#5917361 <https://phabricator.wikimedia.org/T224712#5917361>, 
@Anomie wrote:
  
  > In T224712#5913343 <https://phabricator.wikimedia.org/T224712#5913343>, 
@Dvorapa wrote:
  >
  >> Beta Cluster is fixed, but still fails for zh.wikisource.org, see:
  >
  > Can't reproduce (with non-Pywikibot code), login to zh.wikisource.org works 
fine for me. If you still think it's a problem in MediaWiki or Wikimedia's 
infrastructure, you should supply the HTTP requests and responses to verify 
that cookies and such are being handled correctly.
  
  @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`. See the log of my test (full log 
<https://travis-ci.org/dvorapa/pywikibot/jobs/655402220#L3486>, test code 
<https://github.com/dvorapa/pywikibot/blob/eb10cb93518242bcb560e5955883a10bc779538a/pywikibot/data/api.py#L3138>):
  
    WARNING: 
###############################################################################
    
    WARNING: 
/w/api.php?format=json&lgname=Pywikibot-test&action=login&maxlag=5&lgpassword=[secure]&lgtoken=77c559a0bf34eaf6755aaebca7a56ba25e5693bf+\
    
    WARNING: API warning (login): Fetching a token via "action=login" is 
deprecated. Use "action=query&meta=tokens&type=login" instead.
    
    WARNING: API warning (main): Subscribe to the mediawiki-api-announce 
mailing list at 
<https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for 
notice of API deprecations and breaking changes. Use 
[[Special:ApiFeatureUsage]] to see usage of deprecated features by your 
application.
    
    WARNING: {'login': {'token': 'ce9ea250edb885d68e5a7cf11f90d64e5e5693bf+\\', 
'result': 'NeedToken'}, 'warnings': {'login': {'*': 'Fetching a token via 
"action=login" is deprecated. Use "action=query&meta=tokens&type=login" 
instead.'}, 'main': {'*': 'Subscribe to the mediawiki-api-announce mailing list 
at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for 
notice of API deprecations and breaking changes. Use 
[[Special:ApiFeatureUsage]] to see usage of deprecated features by your 
application.'}}}
    
    WARNING: ce9ea250edb885d68e5a7cf11f90d64e5e5693bf+\
    
    WARNING: invalid
  
  There are two weird things: Why does API ignore lgtoken in the first request 
and why NeedToken gives invalid tokens afterwards (which results with a login 
loop)?

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

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

To: Pchelolo, Dvorapa
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