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

error while uploading #14

Closed
DonDavici opened this issue Nov 4, 2012 · 17 comments
Closed

error while uploading #14

DonDavici opened this issue Nov 4, 2012 · 17 comments

Comments

@DonDavici
Copy link

Hi

i was searching for a long time for script as yours. Thank you very much for your efforts on this.

unfortnuately it does not work for me.

i get always the following error:

{"message":"Not Found"}GitHub doesn't want us to upload the file.

message not found comes from "print res.body one line before the error message itself in your script.

any ideas on this?

thx in advance

@wereHamster
Copy link
Owner

Try to capture the actual response code from github. It's not returning a 2xx response, it would be much useful to know what the code actually is.

@DonDavici
Copy link
Author

any idea how to find out :-)

i am not familiar with ruby.

@wereHamster
Copy link
Owner

Just before this line:

die("GitHub doesn't want us to upload the file.") unless res.class == Net::HTTPCreated

add:

puts res.inspect
puts res.body.inspect

@DonDavici
Copy link
Author

this is the output

Net::HTTPNotFound 404 Not Found readbody=true
"{"message":"Not Found"}"
GitHub doesn't want us to upload the file.

@wereHamster
Copy link
Owner

What is the output from this command?

git config --get remote.origin.url

@DonDavici
Copy link
Author

@wereHamster
Copy link
Owner

I just pushed a change (f8cf726), does it work now?

@DonDavici
Copy link
Author

sorry. still the same problem :-(

@wereHamster
Copy link
Owner

Did you supply a valid token to the script? (see the readme)

@DonDavici
Copy link
Author

sure. i tried also manually within the script. the token is available.

@wereHamster
Copy link
Owner

More debugging. In the get_http_request function (line 38+) add:

puts uri.inspect
puts req.inspect

@DonDavici
Copy link
Author

you mean puts request.inspect ... right?

this ist the output:

URI::HTTPS:0x8fa8c34 URL:https://api.github.com/repos/DonDavici/DreamPlex/downloads>
Net::HTTP::Post POST>
Net::HTTPNotFound 404 Not Found readbody=true>
"{"message":"Not Found"}"
GitHub doesn't want us to upload the file.

@wereHamster
Copy link
Owner

Yes. Add also this:

puts params.inspect

@DonDavici
Copy link
Author

URI::HTTPS:0x8a17f54 URL:https://api.github.com/repos/DonDavici/DreamPlex/downloads>
Net::HTTP::Post POST>
"{"name":"DP_MainMenu.py","size":"34713","description":"","content_type":"text/x-python"}"
Net::HTTPNotFound 404 Not Found readbody=true>
"{"message":"Not Found"}"
GitHub doesn't want us to upload the file.

@pengwynn
Copy link

pengwynn commented Nov 4, 2012

If using OAuth, you'll need a token with 'public_repo' scope for a user with push access to the repo in order to create a download via the API.

@DonDavici
Copy link
Author

@pengwynn

thank you very much. that solved the problem for me. :-)

@wereHamster
Copy link
Owner

I've added a note to the readme which scopes the OAuth token must include.

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

No branches or pull requests

3 participants