Page MenuHomePhabricator

"mediawiki get-code" fails
Closed, InvalidPublicBUG REPORT

Assigned To
None
Authored By
Lectrician1
Mar 12 2023, 5:53 AM
Referenced Files
F36913501: image.png
Mar 15 2023, 8:58 PM
F36913494: image.png
Mar 15 2023, 8:58 PM
F36913490: image.png
Mar 15 2023, 8:58 PM
F36911296: image.png
Mar 14 2023, 3:39 PM
F36911220: image.png
Mar 14 2023, 1:55 PM
F36909371: image.png
Mar 13 2023, 2:40 PM

Description

Steps to replicate the issue (include links if applicable):

  • Delete your git directory created by mwcli
  • Run mw docker mediawiki get-code
  • use http or ssh option

What happens?:

lectrician1@SethLaptop:~$ mw docker mediawiki get-code
? MediaWiki code not detected in /home/lectrician1/git/gerrit/mediawiki/core. Do you want to clone it now? (Negative answers will abort this command) Yes
? Vector skin is not detected in /home/lectrician1/git/gerrit/mediawiki/core. Do you want to clone it now? Yes
If you want to clone more skins and extensions please use the --skin and --extension options...
? How do you want to interact with Gerrit for the cloned repositores? ssh
? What is your Gerrit username? lectrician1
Cloning repositories...
Cloning into '/home/lectrician1/git/gerrit/mediawiki/core'...
<username>@gerrit.wikimedia.org: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL exit status 128

And this happens even when I'm logged-in with SSH:

lectrician1@SethLaptop:~$ ssh -p 29418 lectrician1@gerrit.wikimedia.org

  ****    Welcome to Gerrit Code Review    ****

  Hi Lectrician1, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://lectrician1@gerrit.wikimedia.org:29418/REPOSITORY_NAME.git

Connection to gerrit.wikimedia.org closed.

What should have happened instead?:

The code should have been retrieved.

Software version (skip for WMF-hosted wikis like Wikipedia):

WSL

Other information (browser name/version, screenshots, etc.):

Related Objects

Event Timeline

The <username> bit looks interesting in the first block of output...

Addshore moved this task from Inbox to Priority Backlog on the mwcli board.

What version are you running?
I am also using WSL and this appear to work just fine for me

image.png (262×1 px, 46 KB)

Ohhhhhh. Whatever it works now. I think it was my stupid WiFi network which sometimes doesn't let me download certain stuff.

Well now it doesn't work again!

I even reinstalled mwcli this time and the problem still occurs. I also tried running with sudo and I get completely different behavior where the tool says that the mediawiki repository already exists when the git repository doesn't even exist!

image.png (355×1 px, 61 KB)

If you use sudo mwcli will use the configuration for your root user.
This may have different directories specified etc.
See /root/.config/mwcli i guess

Could you run it without sudo but with -v=2 and we can take a look at the extra output and see if I spot anything.
Otherwise I can add some additional verbose output for the next release and see if we can make some headway

idk I think my OS is screwed up. mwcli doesn't have permissions to write to anything.

image.png (735×1 px, 136 KB)

Hmm, I notice you chose ssh, but it seemed to try to clone via https.
mw is just running as your user, so if your user can write to these places, mwcli should be able to :/

Hmm, I notice you chose ssh, but it seemed to try to clone via https.

Ahh right, the clone always happens via HTTPS and then it just switches the remote to SSH after the fact.
So are you able to clone by hand from the https remote?

i.e. /usr/bin/git clone https://gerrit.wikimedia.org/r/mediawiki/core /home/lectrician1/git/gerrit/mediawiki/core

This is the exact command that the CLI runs, as it just shells out to git.
So this is the command that when mwcli runs it is giving you the error

git clone https failed:

image.png (204×1 px, 37 KB)

running git clone ssh with no /r/ in the address and no username just froze while cloning so I ctrl-C and exited:

image.png (207×1 px, 45 KB)

running git clone ssh with username and port succeeded. testing get-code after that failed:

image.png (735×1 px, 134 KB)

when I run git clone it asks me for my paraphrase before cloning over ssh but get-code does not.

I screwed up my ubuntu installation somehow and I reinstalled to OS and now it works.