Dvorapa added a comment.
Thank you, I'll
In T196683#4309533, @Sc4s2cg wrote:
Well, I installed mediawiki in a fresh Ubuntu 18.04 installation. Restored the database, then used pwb and everything worked perfectly.
If anyone is still interested I can make a private topic if you'd like to mess
Urbanecm added a comment.
I've added you to Trusted Contributors. Now, you can see https://phabricator.wikimedia.org/paste/edit/form/36/ and should be able to fill details you don't want to share publicly in there. Please add me to subscribers, otherwise I won't be able to access the paste as well
Sc4s2cg added a comment.
Well, I installed mediawiki in a fresh Ubuntu 18.04 installation. Restored the database, then used pwb and everything worked perfectly.
If anyone is still interested I can make a private topic if you'd like to mess around in the old wiki? @Urbanecm @zhuyifei1999TASK
Urbanecm added a comment.
Good point, didn't know that. I won't oppose adding them to Trusted Contributors, if you think it's okay for this purpose. Why only creating private pastes is restricted, if anything, then making existing public pastes private should be restritcted insteadTASK
zhuyifei1999 added a comment.
In T196683#4309279, @Urbanecm wrote:
https://phabricator.wikimedia.org/paste/edit/form/36/
That form is only available to ndas, ops, and #trusted-contributors. Shall we add them to the last one?TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
Urbanecm added a comment.
For the record, I'm posting titanium's OS version details.
urbanecm@titanium ~
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.4 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.4 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
Urbanecm added a comment.
@Sc4s2cg I feel like sharing more details (like link to the wiki you're trying to use) to enable us to replicate the issue if we can is warranted. If you don't want to post it publishly, you can create a private paste via
Sc4s2cg added a comment.
@Dvorapa yeah, I can confirm that LocalSettings has the domain specified and not localhost. I'm at a loss on what could be wrong. I'll try to do a fresh install of mediawiki on a different Ubuntu VM.TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
Urbanecm added a comment.
@Dvorapa Regarding database creation on toolforge, try this:
Cat ~/replica.my.cnf and record your username stored in this file (it should begin with s for tools and with u for ordinary users)
Run sql local
Run CREATE DATABASE yourusernameanything (where anything is
Dvorapa added a comment.
@Sc4s2cg I've also tried these three non-WMF wikis, all of them works as expected, so there must be something wrong in your config I think: https://testwiki.wiki, https://publictestwiki.com/wiki/Main_Page, https://www.thetestwiki.org/wiki/Main_PageTASK
Sc4s2cg added a comment.
@Dalba It looks like I got a connection error: https://pastebin.com/smncxm0A
@Dvorapa were you able to replicate the issue?TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Sc4s2cgCc:
Dalba added a comment.
Try:
$python -c "import requests; print(requests.post('https://en.wikipedia.org/w/api.php', 'action="">
`
(Replace https://en.wikipedia.org/w/api.php with your api path.)TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
Sc4s2cg added a comment.
I added this variable to the family file, but no change in error.
def apipath(self, code):
return '/path to api.php'
Also you could check the output what you get from API, what it looks like. Try to print what you actually get by Pywikibot and compare it to what
Sc4s2cg added a comment.
In T196683#4269324, @zhuyifei1999 wrote:
In T196683#4269319, @Sc4s2cg wrote:
@zhuyifei1999 yes, that is the endpoint. Going to wiki.[REDACTED].com/api.php gets me the same page as www.mediawiki.org/w/api.php
How about with some parameters?
zhuyifei1999 added a comment.
In T196683#4269319, @Sc4s2cg wrote:
@zhuyifei1999 yes, that is the endpoint. Going to wiki.[REDACTED].com/api.php gets me the same page as www.mediawiki.org/w/api.php
How about with some parameters? wiki.[REDACTED].com/api.php?action="" should look like
Sc4s2cg added a comment.
@zhuyifei1999 yes, that is the endpoint. Going to wiki.[REDACTED].com/api.php gets me the same page as www.mediawiki.org/w/api.php
@Dvorapa the whole api path is http://wiki.[REDACTED].com/api.php
Just wanted to reply real quick before I implement you guys'
Dvorapa added a comment.
If there is a bug on Pywikibot side, probably there is somewhere some of these variables hardcoded somewhere or incorrectly chosen a default or maybe generate_family_file is not correctly making scriptpath and apipath variables when you insert api path to it, so try to
Dvorapa added a comment.
The variables recognized by Pywikibot you can modify in your family file:
Single code/lang wiki:
name = example
dbname = examplewiki
protocol = http/https (default https)
domain = www.example.com
scriptpath = '/w'
apipath = '/api.php'
langs[name] = www.example.com
Dvorapa added a comment.
As @zhuyifei1999 suggested, you should make sure the api uri properly if it leads where it should and set the proper uri to def apipath(): return 'http://path to api.php' into your family file.
Also you should check the output what you get from API, what it looks like.
zhuyifei1999 added a comment.
Oh I see, uri: /api.php is printed. Is wiki.[REDACTED].com/api.php your mediawiki API endpoint if you visit in your browser? An API endpoint looks like https://www.mediawiki.org/w/api.phpTASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
zhuyifei1999 added a comment.
In T196683#4267172, @Sc4s2cg wrote:
So rawdata is wiki.[REDACTED].com/api.php
Theoretically that should be true, but did you check the uri? If that is indeed the case, does the uri actually lead to the mediawiki API if you visit it in browser?TASK
Sc4s2cg added a comment.
Just a prompt to see if anyone has any idea?TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: Sc4s2cgCc: zhuyifei1999, Chicocvenancio, Framawiki, Dvorapa, Aklapper,
Sc4s2cg added a comment.
Request being made:
rawdata = http.request(
site=self.site, uri=uri,
method='POST',
body=body,headers=headers)
So rawdata is just wiki.[REDACTED].com/api.php
Variables sent:
site: finalwiki:en
uri: /api.php
zhuyifei1999 added a comment.
In T196683#4266451, @Sc4s2cg wrote:
This is what it looks like:
LGTM.
I suggest you check what is in the response, the rawdata, using a print statement/function or something similar.
File "/home/peter/NetShare/core/pywikibot/data/api.py", line 1999, in submit
Sc4s2cg added a comment.
So I went ahead and tried to create a family file manually as per [[ https://www.mediawiki.org/wiki/Manual:Pywikibot/Use_on_third-party_wikis#Manually_in_core | these ]]directions. My wiki api is at wiki.[REDACTED].com/api.php
This is what it looks like:
from pywikibot
Dvorapa added a comment.
Also that's why the manual on https://www.mediawiki.org/wiki/Manual:Pywikibot/Use_on_third-party_wikis is a little bit outdated.TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To:
Dvorapa added a comment.
url = "">
I meant apipath = https://wiki.[REDACTED.com]/api.php into the family file.
pwb is able to any of the default mediawikis (like wikivoyage, wikipedia). Just not the custom added ones (mine).
pwb should be able to work with any MediaWiki wiki (and also with
Sc4s2cg added a comment.
Yeah, I tried editing the families path directly:
Configuration parameters:
url = ""
name = famwiki
to
Configuration parameters:
url = ""
name = famwiki
Yeah, I'm running out of ideas as well. I went ahead and ran a manual python script again but it ran successfully.
Dvorapa added a comment.
I see. I still feel like there is a broken connection between pwb and api. In your family file maybe you can try to set apipath and path parameters. I'm running out of ideas.TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
Sc4s2cg added a comment.
I was using botpasswords, but just tried using normal login but same issue. So from what I can tell:
Ubuntu: permission issues won't let pyb.py access user-config.py. 666 and 777 permissions it says are too broad (first traceback in above post)
Windows: no permission
Chicocvenancio added a comment.
In T196683#4266246, @Dvorapa wrote:
If you don't have an access to some other computer, try to access your wiki using https://paws.wmflabs.org/paws/hub/login PAWS. You will need Wikimedia account to log in, but after that you could run Pywikibot from Wikimedia
Dvorapa added a comment.
If you don't have an access to some other computer, try to access your wiki using https://paws.wmflabs.org/paws/hub/login PAWS. You will need Wikimedia account to log in, but after that you could run Pywikibot from Wikimedia servers and try to access your wiki "from
Dvorapa added a comment.
I've never seen filemode issues like this, maybe you should try a different computer as I suggested earlier. The family file seems ok to me, the user file probably also ok. Do you use botpasswords or just usual password? Also try to log in without a password file set (it
Sc4s2cg added a comment.
I changed permissions of user-config.py using sudo chmod 666, but it is still complaining that the file is writeable:
peter@peter-BHYVE2:~/NetShare/core$ sudo chmod 666 user-config.py
[sudo] password for peter:
peter@peter-BHYVE2:~/NetShare/core$ python3 pwb.py login
Dvorapa added a comment.
Also try to run pywikibot from a different computer, sometimes it causes a trouble.TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: DvorapaCc: Dvorapa, Aklapper, pywikibot-bugs-list,
Dvorapa added a comment.
Please also share values of mylang, myfamily, usernames in user-config.py, maybe also your famwiki family file created. If there is no problem in those, then it should just work.TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
Dvorapa added a comment.
So you have to run login twice, right? Once for creating user-config.py and second time for logging in.TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: DvorapaCc: Dvorapa, Aklapper,
Sc4s2cg added a comment.
I created the user-config.py file using the initial setup via "python3 pwb.py login". It prompts for the creation of the file. The contents were correct. It is in the core folder.TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
Dvorapa added a comment.
Also please make sure you have an updated version as today there was a major issue fixed with generate_user_files.pyTASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: DvorapaCc:
Dvorapa added a comment.
In T196683#4265784, @Sc4s2cg wrote:
What should the permission be? 777 results in pywikibot ignoring the user-config.py file because it is writeable.
Ideally 666TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
Dvorapa added a comment.
Where you run python3 generate_user_files.py? Or how do you create your user-config.py file? Is the contents of the file correct? In which folder you you store the file?TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
Sc4s2cg added a comment.
Hmm, is the problem then pywikibot incorrectly sets the permissions after creating the user-config.py wiki file?
I just tried again with a new install:
extract core.tar
python3 generate_family_file.py
python3 pwb.py login
ls -l
user-config.py default permission:
Dvorapa added a comment.
In T196683#4265649, @Aklapper wrote:
I'm not into Pywikibot but I wonder if
Skipped '/home/peter/NetShare/core/user-config.py': owned by someone else.
is relevant. Have you tried fixing the file permissions?
@Aklapper is correct, it seems pywikibot can not access
Aklapper added a comment.
Which MediaWiki version is used?TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL PREFERENCEShttps://phabricator.wikimedia.org/settings/panel/emailpreferences/To: AklapperCc: Aklapper, pywikibot-bugs-list, Sc4s2cg, Magul, Tbscho, MayS, Salgo60, Mdupont, JJMC89,
Aklapper added a comment.
I'm not into Pywikibot but I wonder if
Skipped '/home/peter/NetShare/core/user-config.py': owned by someone else.
is relevant. Have you tried fixing the file permissions?TASK DETAILhttps://phabricator.wikimedia.org/T196683EMAIL
45 matches
Mail list logo