gousiosg / github-mirror

Scripts to mirror Github in a cloudy fashion
BSD 2-Clause "Simplified" License
559 stars 106 forks source link

premisson denied #98

Open AimerYi opened 4 years ago

AimerYi commented 4 years ago

when I use this command to start my ghtorrent:ruby -Ilib bin/ght-retrieve-repo -c config.yaml gousiosg github-mirror; It will generate this warning: WARN, 2020-10-15T18:29:16+08:00, ghtorrent -- api_client.rb: Failed request. URL: https://api.github.com/users/gousiosg?per_page=100, Status code: 401, Status: Unauthorized, Access: place your , IP: 0.0.0.0, Remaining: 59 WARN, 2020-10-15T18:29:16+08:00, ghtorrent -- api_client.rb: Unauthorised request with token: place your github token here WARN, 2020-10-15T18:29:16+08:00, ghtorrent -- ghtorrent.rb: Transaction failed (989 ms) 401 Unauthorized seems like Permissions issue

stuartbates commented 3 years ago

It looks like you haven't added your own GitHub API token to your config.

That error message comes from here: https://github.com/gousiosg/github-mirror/blob/5f001e57264ffb25b6b8add50732758574b52480/lib/ghtorrent/api_client.rb#L205

You can either update the settings directly here: https://github.com/gousiosg/github-mirror/blob/8f2fdc3f2ae2eb45156b3dcee6af9e94bd2cdf04/lib/ghtorrent/settings.rb#L62

Or a better idea would be to enter the token key inside your config.yaml like this:

https://github.com/gousiosg/github-mirror/blob/master/config.yaml.tmpl#L43

Hope that helps.