openhatch / open-source-comes-to-campus

Planning for improving Open Source Comes to Campus
31 stars 22 forks source link

Error with bin/setup_practicing_git: Permission denied (publickey). #101

Closed benmarwick closed 9 years ago

benmarwick commented 9 years ago

Could @paulproteus or @shaunagm please have a look at my output below and give me some tips about how to workaround the Permission denied (publickey). error? This is from the third try of that script. I'm on Ubuntu 14.04. Thanks!

two@two:~/Downloads/open-source-comes-to-campus/scripts$ bin/setup_practicing_git
Testing that your credentials work...
Good.

What is the event shortname? This is the name used on the web, e.g. for columbia.openhatch.org, type columbia here. >uw
How many git repositories do you want? I recommend no fewer than 3. Up to you, though. >5
What git repo do you want to clone, issues and all? Press enter to accept the default, which is openhatch/github-website-editing-demo, or provide your own. >
Now is a good time to go create 5 Github organizations, starting with 'uw-'.
Press enter when you have done that...
Great! Now I will go copy GitHub issues from the openhatch organization and its github-website-editing-demo repo.
First, I will download them...
And then, I will copy them...
Weirdly, uw-1/uw-1.github.io already exists. Skipping this number.
Weirdly, uw-2/uw-2.github.io already exists. Skipping this number.
Weirdly, uw-3/uw-3.github.io already exists. Skipping this number.
Weirdly, uw-4/uw-4.github.io already exists. Skipping this number.
Weirdly, uw-5/uw-5.github.io already exists. Skipping this number.
Now I will make sure they all have the content from the template repository.
Using /tmp/git_clone_RrmZFC as temp directory for clone...
Cloning into '/tmp/git_clone_RrmZFC'...
remote: Counting objects: 345, done.
remote: Total 345 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (345/345), 175.11 KiB | 0 bytes/s, done.
Resolving deltas: 100% (197/197), done.
Checking connectivity... done.

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Traceback (most recent call last):
  File "bin/setup_practicing_git", line 9, in <module>
    load_entry_point('CloneGithubIssues==0.01', 'console_scripts', 'setup_practicing_git')()
  File "/home/two/Downloads/open-source-comes-to-campus/scripts/clone_github_issues/__init__.py", line 177, in main
    from_repo)
  File "/home/two/Downloads/open-source-comes-to-campus/scripts/clone_github_issues/__init__.py", line 134, in interactive_prepare_event
    cwd=tempdir)
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['git', 'push', '1', 'HEAD:master']' returned non-zero exit status 128
two@two:~/Downloads/open-source-comes-to-campus/scripts$ 
shaunagm commented 9 years ago

I'm getting a different error. My guess is that this is simply due to my not having write access to the uw repos, because @benmarwick made them, but will leave the output here in case I'm misinterpreting it. So: Ben, can you give me permissions? Alternatively, Asheesh can try to debug the error Ben's getting.

And then, I will copy them...
Weirdly, uw-1/uw-1.github.io already exists. Skipping this number.
Weirdly, uw-2/uw-2.github.io already exists. Skipping this number.
Weirdly, uw-3/uw-3.github.io already exists. Skipping this number.
Weirdly, uw-4/uw-4.github.io already exists. Skipping this number.
Weirdly, uw-5/uw-5.github.io already exists. Skipping this number.
Traceback (most recent call last):
  File "bin/setup_practicing_git", line 9, in <module>
    load_entry_point('CloneGithubIssues==0.01', 'console_scripts', 'setup_practicing_git')()
  File "/home/shauna/Desktop/shared/git/oh/open-source-comes-to-campus/scripts/clone_github_issues/__init__.py", line 177, in main
    from_repo)
  File "/home/shauna/Desktop/shared/git/oh/open-source-comes-to-campus/scripts/clone_github_issues/__init__.py", line 101, in interactive_prepare_event
    make_repo(org_name, repo_name)
  File "/home/shauna/Desktop/shared/git/oh/open-source-comes-to-campus/scripts/clone_github_issues/__init__.py", line 46, in make_repo
    assert response.status_code == 201, response.status_code
AssertionError: 403
benmarwick commented 9 years ago

Thanks for looking into this! I think I've made you (@shaunagm) an owner of all ten uw-x repos now.

shaunagm commented 9 years ago

Still getting the error, so I'm not sure what's going wrong. :/

benmarwick commented 9 years ago

Righto, perhaps @paulproteus can shed some light on it... I tried changing one of the org names to washington-1, but that made no difference.

benmarwick commented 9 years ago

Seems that I have the issues in each repo, but no files to edit

benmarwick commented 9 years ago

I wrote a bit of shell script to copy this repo into my uw-n repos, which this python code seems to fail at, so I'm good to go for the UW workshop. I have ten repos that show the website to edit, and the issues for students to work on.

shaunagm commented 9 years ago

Great!

Can you put the text of the shell script here, in case anyone else runs into this issue before we have a chance to fix the Python code?

benmarwick commented 9 years ago

I think it was something like this that I did to populate the repos with files:

#!/bin/bash

git clone --mirror https://github.com/openhatch/github-website-editing-demo.git
# Make a bare mirrored clone of the repository

cd github-website-editing-demo.git
# go into dir

# loop over our uw-n repos, where n=10 in this case
for i in {1..10}
do

git remote set-url --push origin https://github.com/uw-$i/uw-$i.github.io.git
# connect to remote to copy it to

git push
# copy it out to that remote

done
paulproteus commented 9 years ago

Weird. I'm going to try using the script and seeing if I get any problems.

paulproteus commented 9 years ago

Hey all,

For @benmarwick -- you need to set up an SSH key on your computer. The script doesn't say so, but I now believe that's the reason it failed.

For @shaunagm -- from chatting on IRC, it seems that you needed to generate a GitHub API key with more permissions.

Cheerio!

benmarwick commented 9 years ago

Righto, thanks for looking into it. Hope that helps the next person to use it!