Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test file uploads to the test wiki #69

Open
Daniel-Mietchen opened this issue Feb 27, 2017 · 14 comments
Open

Test file uploads to the test wiki #69

Daniel-Mietchen opened this issue Feb 27, 2017 · 14 comments

Comments

@Daniel-Mietchen
Copy link
Member

Daniel-Mietchen commented Feb 27, 2017

This had been originally posted over at wpoa/OA-signalling#145 but was meant to be placed here to keep these conversations together.

There is
https://test.wikipedia.org/wiki/Main_Page
for specifically bot testing purposes.

So we should be testing the fix to #62 #63.

Once we have a few useful uploads there, I will start the bot request #67 and on that basis, the unblock request #66 is hopefully getting in reach of being granted.

@difranco
Copy link
Collaborator

difranco commented Feb 28, 2017

I just modified the script to upload media only to test.wikipedia.org and it seems we may be blocked there too as all requests get redirected to a block url e.g.
https://test.wikipedia.org:443 "GET /w/api.php?action=query&meta=siteinfo%7Cuserinfo%7Cuserinfo&continue=&siprop=general%7Cnamespaces&uiprop=groups%7Crights%7Cblockinfo%7Chasmsg&format=json HTTP/1.1" 200 1807
and no edits show up here:
https://test.wikipedia.org/w/index.php?title=Special:RecentChanges&hidebots=0

Do you know whom we need to ask to get unblocked on test.wikipedia.org?

@Daniel-Mietchen
Copy link
Member Author

Don't know - will try to find out. Am traveling and thus basically offline.

@difranco
Copy link
Collaborator

difranco commented Feb 28, 2017 via email

@Daniel-Mietchen
Copy link
Member Author

@difranco it turns out we are not blocked on test wiki, only on Commons:
https://meta.wikimedia.org/w/index.php?title=Special%3ACentralAuth&target=Recitation-bot .

The reason for the error message is probably some caching issue - can you please retry? I was advised to start the unblock request after showing successful edits on testwiki.

@difranco difranco self-assigned this Mar 11, 2017
@difranco
Copy link
Collaborator

OK, thanks for the info, I'll have a look this afternoon.

@difranco
Copy link
Collaborator

difranco commented Mar 12, 2017

@Daniel-Mietchen
I retried just now and I'm still getting redirected to a blockinfo url:
2017-03-12 05:22:22,095 - requests.packages.urllib3.connectionpool - DEBUG - https://test.wikipedia.org:443 "GET /w/api.php?action=query&siprop=general%7Cnamespaces&continue=&format=json&meta=siteinfo%7Cuserinfo%7Cuserinfo&uiprop=groups%7Crights%7Cblockinfo%7Chasmsg HTTP/1.1" 200 1871

Could I speak directly to the person who advised you about this to sort it out?

@Daniel-Mietchen
Copy link
Member Author

Did you try it just once or several times? Since this issue likely involves caching, retrying may help - don't know.

That person would be https://commons.wikimedia.org/wiki/User:DerHexer . Not sure he can help with the technical details, though. Perhaps a mail to https://lists.wikimedia.org/pipermail/wikitech-l/ would be more promising. Or try both.

@difranco
Copy link
Collaborator

Yes, I tried several times and also tried logging into the wiki manually with Recitation-bot credentials and poking around just in case. Let me follow up with DerHexer and the list then.

@difranco
Copy link
Collaborator

Here is what is returned by that page when logged in as Recitation-bot in a browser:
{"batchcomplete":"","query":{"userinfo":{"id":35709,"name":"Recitation-bot","groups":["*","user","autoconfirmed"],"rights":["createaccount","read","edit","createpage","createtalk","writeapi","editmyusercss","editmyuserjs","viewmywatchlist","editmywatchlist","viewmyprivateinfo","editmyprivateinfo","editmyoptions","abusefilter-view","abusefilter-log","translate","centralauth-merge","vipsscaler-test","flow-hide","upload_by_url","upload","pagelang","reupload-own","move-rootuserpages","move-categorypages","minoredit","purge","sendemail","applychangetags","changetags","translate-messagereview","translate-groupreview","lqt-split","lqt-merge","lqt-react","flow-lock","mwoauthmanagemygrants","reupload","move","collectionsaveasuserpage","collectionsaveascommunitypage","autoconfirmed","editsemiprotected","movestable","autoreview","transcode-reset","skipcaptcha","abusefilter-log-detail","flow-edit-post"]}}}

@difranco
Copy link
Collaborator

I tried doing the upload logged in as Dfko, still got this redirect:
https://test.wikipedia.org:443 "GET /w/api.php?format=json&meta=userinfo%7Cuserinfo&continue=&uiprop=groups%7Crights%7Cblockinfo%7Chasmsg&action=query HTTP/1.1" 200 442
which returns this when logged in as Dfko in the browser:
{"batchcomplete":"","query":{"userinfo":{"id":35708,"name":"Dfko","groups":["*","user","autoconfirmed"],"rights":["createaccount","read","edit","createpage","createtalk","writeapi","editmyusercss","editmyuserjs","viewmywatchlist","editmywatchlist","viewmyprivateinfo","editmyprivateinfo","editmyoptions","abusefilter-view","abusefilter-log","translate","centralauth-merge","vipsscaler-test","flow-hide","upload_by_url","upload","pagelang","reupload-own","move-rootuserpages","move-categorypages","minoredit","purge","sendemail","applychangetags","changetags","translate-messagereview","translate-groupreview","lqt-split","lqt-merge","lqt-react","flow-lock","mwoauthmanagemygrants","reupload","move","collectionsaveasuserpage","collectionsaveascommunitypage","autoconfirmed","editsemiprotected","movestable","autoreview","transcode-reset","skipcaptcha","abusefilter-log-detail","flow-edit-post"]}}}

@difranco
Copy link
Collaborator

difranco commented Mar 19, 2017

From test.wikipedia.org:

Please read this: This wiki does not exist for users to test out random nonsense on an exhaustive basis; it's here for developers to check that changes to the code aren't going to cripple the live sites. See also: WP:WWD and WP:NOT.

As a result, administrator status is still not going to be given out to all and sundry. This isn't an arena for you to play with the tools, or mess about, nor is it somewhere you should be testing your bots, etc. - If you want a place that is for you to test out sysop tools, etc, try these sites.

So, switching tests to testwiki.wiki

@difranco
Copy link
Collaborator

difranco commented Mar 19, 2017

Getting an error on uploading images to testwiki.wiki seeming to have to do with blocking:
`2017-03-19 20:00:08,496 - root - ERROR - 404 Client Error: Not Found for url: https://testwiki.wiki/w/api.php?meta=siteinfo%7Cuserinfo%7Cuserinfo&siprop=general%7Cnamespaces&continue=&format=json&action=query&uiprop=groups%7Crights%7Cblockinfo%7Chasmsg
Traceback (most recent call last):
File "./background-process.py", line 64, in process_journal_article
getattr(curr_ja, method)(**method_params)
File "./journal_article.py", line 248, in upload_images
site = mwclient.Site(site_url)
File "/data/project/recitation-bot/www/python/venv/lib/python3.4/site-packages/mwclient/client.py", line 122, in init
self.site_init()
File "/data/project/recitation-bot/www/python/venv/lib/python3.4/site-packages/mwclient/client.py", line 144, in site_init
retry_on_error=False) File "/data/project/recitation-bot/www/python/venv/lib/python3.4/site-packages/mwclient/client.py", line 226, in get return self.api(action, 'GET', *args, **kwargs) File "/data/project/recitation-bot/www/python/venv/lib/python3.4/site-packages/mwclient/client.py", line 277, in api info = self.raw_api(action, http_method, **kwargs) File "/data/project/recitation-bot/www/python/venv/lib/python3.4/site-packages/mwclient/client.py", line 396, in raw_api
http_method=http_method)
File "/data/project/recitation-bot/www/python/venv/lib/python3.4/site-packages/mwclient/client.py", line 367, in raw_call
stream.raise_for_status()
File "/data/project/recitation-bot/www/python/venv/lib/python3.4/site-packages/requests/models.py", line 893, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://testwiki.wiki/w/api.php?meta=siteinfo%7Cuserinfo%7Cuserinfo&siprop=general%7Cnamespaces&continue=&format=json&action=query&uiprop=groups%7Crights%7Cblockinfo%7Chasmsg
2017-03-19 20:00:08,557 - root - DEBUG - 404 Client Error: Not Found for url: https://testwiki.wiki/w/api.php?meta=siteinfo%7Cuserinfo%7Cuserinfo&siprop=general%7Cnamespaces&continue=&format=json&action=query&uiprop=groups%7Crights%7Cblockinfo%7Chasmsg
'

switching to www.thetestwiki.org

Edit: can't create an account on www.thetestwiki.org because it won't accept the CAPTCHA which consists of only a trivial checkbox, looks like they have a bug.

@se4598
Copy link

se4598 commented Mar 19, 2017

Hey guys/@difranco, I don't know what this project is about, just came here via a mailinglist-link. I didn't looked closely on the issue here or the odd "redirects" you are talking about, but 3 notes:

  • The 404 you got on testwiki.wiki is because not all wikis are configured like the wikimedia ones, at testwiki.wiki the api-entrypoint is at /api.php instead of /w/api.php (so this is the working url for the the previous comment). 404 are not about a blocked useraccount, don't know why do you think it is.
  • And do you know about the beta cluster of wikimedia? There is almost everything setup like in the real wikipedia/wikimedia commons, and almost no restriction on testing. So, create a account and do the testing there on commons or whereever. I think there won't be a problem to get necessary permissions there if you need it (like bot or adminflag).
  • In the lines above, everywhere where you mention you get redirect because of a block or so, I can't follow you and see this redirect by the logline you gave there. If a action is indeed prevented because a user account is blocked, it will say so in the api response, see documentation

hope this helps!

@Daniel-Mietchen
Copy link
Member Author

Thanks, @se4598 — that is indeed very helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants