Last modified: 2014-08-17 11:50:35 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 T58042, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56042 - PageNotFound error while running replace.py with compat
PageNotFound error while running replace.py with compat
Status: RESOLVED WORKSFORME
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
compat-(1.0)
All All
: High major
: ---
Assigned To: Pywikipedia bugs
aklapper-moreinfo
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-23 11:19 UTC by Basvb
Modified: 2014-08-17 11:50 UTC (History)
2 users (show)

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


Attachments

Description Basvb 2013-10-23 11:19:13 UTC
When I'm running pywikibot with replace.py I do sometimes (like once every 6-7 pages replaced) get an error which stops the replace to run.

Traceback (most recent call last):
  File "replace.py", line 967, in <module>
    main()
  File "replace.py", line 956, in main
    bot.run()
  File "replace.py", line 542, in run
    page.put(new_text, self.editSummary)
  File "C:\compat\compat\wikipedia.py", line 2112, in put
    sysop = sysop, botflag=botflag, maxTries=maxTries)
  File "C:\compat\compat\wikipedia.py", line 2203, in _putPage
    response, data = query.GetData(params, self.site(), sysop=sysop, back_respon
se = True)
  File "C:\compat\compat\pywikibot\support.py", line 121, in wrapper
    return method(*__args, **__kw)
  File "C:\compat\compat\query.py", line 135, in GetData
    res, jsontext = site.postForm(path, params, sysop, site.cookies(sysop = syso
p) )
  File "C:\compat\compat\wikipedia.py", line 6495, in postForm
    cookies=cookies)
  File "C:\compat\compat\wikipedia.py", line 6549, in postData
    raise PageNotFound(u'Page %s could not be retrieved. Check your family file
?' % url)
pywikibot.exceptions.PageNotFound: Page https://commons.wikimedia.org/w/api.php
could not be retrieved. Check your family file ?

The family is set as: 
family = 'commons'
mylang = 'commons'

the command used is: python replace.py -namespace:6 -cat:RCE_suggested:_Centrum -summary:"Remove RCE-tag suggestion (this specific tag is not useful)" "{{RCE-subject|Centrum}}" "" 

but the issue also occures on other commands and when entering a wrong password in the login.py (only at first attempt so far).

version information: 
Pywikibot: wikipedia.py (r-1 (unknown), ???????, 2013/10/23, 12:56:06, OUTDATED)

Release version: 1.0b1
Python: 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
Comment 1 xqt 2013-10-23 15:22:42 UTC
I noticed the command line in irc pastebin as


python replace.py -debug -lang:commons -family:commons -namespace:6 -cat:RCE_suggested:_Centrum -summary:"Remove RCE-tag suggestion (not useful)" -regex -dotall "(\{\{RCE\-subject\|Centrum\}\})" ""

git wordt niet herkend als een interne of externe opdracht, programma of batchbestand.

Getting [[Category:RCE suggested: Centrum]] list...
Getting 60 pages via API from commons:commons...

...

>>> File:Overzicht - Amsterdam - 20408351 - RCE.jpg <<<
- {{RCE-subject|Centrum}}{{RCE-subject|Verdedigingswerk}}
+ {{RCE-subject|Verdedigingswerk}}

Updating page [[File:Overzicht - Amsterdam - 20408351 - RCE.jpg]] via API
Traceback (most recent call last):

On the other hand, the bot worked:
https://commons.wikimedia.org/w/index.php?title=File%3AOverzicht_hoekpartij_met_koperen_koepel%2C_overdekte_winkelgalerij_-_Amsterdam_-_20408976_-_RCE.jpg&diff=107729373&oldid=101940554

https://commons.wikimedia.org/w/index.php?title=File%3AOverzicht_-_Amsterdam_-_20408351_-_RCE.jpg&diff=107728528&oldid=101940682
Comment 2 Basvb 2013-10-23 15:24:49 UTC
I tried it with multiple commands, and indeed most of the time 5 files or so get updated (up to 40 one time) and then the error occures.
Comment 3 Merlijn van Deen (test) 2013-10-26 16:40:30 UTC
The error you describe is raised by the following code:

                if e.code in [401, 404]:
                    raise PageNotFound(u'Page %s could not be retrieved. Check '
                                       u'your family file ?' % url)


which implies the server returned either HTTP/401 Unauthorized or HTTP/404 Not Found. 

Unfortunately, I cannot reproduce it with the new to-be-removed tag basvb suggested on IRC...


In //gerrit.wikimedia.org/r/92075 , I have added debug output to show what the actual error is. Could you:

1) make a backup of wikipedia.py
2) download https://git.wikimedia.org/raw/pywikibot%2Fcompat/015e067e078bc7611f27c4450755897e1c1fd42f/wikipedia.py and place it where the original one was
3) run again, with -debug
4) post the new debug response here?


Thanks!
Comment 4 Merlijn van Deen (test) 2013-10-27 09:12:11 UTC
The change has been merged, so instead of downloading the seperate file, you should now just download the latest nightly: http://tools.wmflabs.org/pywikibot/compat.zip
Comment 5 Ricordisamoa 2014-03-21 05:18:09 UTC
@Basvb, would you please follow the steps suggested by Merlijn? Thanks.
Comment 6 Andre Klapper 2014-05-21 14:32:42 UTC
@Basvb, would you please follow the steps suggested by Merlijn? Thanks.
Comment 7 Basvb 2014-05-21 22:36:34 UTC
I'm currently not working on commons and am not really up to date how this all works. I can't find the time to dive into this the comming 1-2 months. I'm sorry.
Comment 8 Basvb 2014-07-08 13:30:45 UTC
It seems to work now, I do not get the error anymore (changed around 100 pages now). Thanks for the help, and sorry for the delay.
Comment 9 Andre Klapper 2014-08-17 11:50:35 UTC
(In reply to Basvb from comment #8)
> It seems to work now

Closing as WORKSFORME then...

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


Navigation
Links