MetricsGrimoire / Bicho

Bicho is a command line based tool used to parse bug/issue tracking systems
http://metricsgrimoire.github.com/Bicho/
GNU General Public License v2.0
68 stars 30 forks source link

Error 403 on github issues retrieval #146

Closed jsmanrique closed 9 years ago

jsmanrique commented 9 years ago

While retrieving issues, it gets an error and then, next issues fetching gets a 403 (Forbidden) error:

Traceback (most recent call last):
  File "/usr/local/bin/bicho", line 25, in <module>
    retval = bicho.main.main()
  File "/usr/local/lib/python2.7/dist-packages/bicho/main.py", line 56, in main
    backend.run()
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/github.py", line 590, in run
    bugs = self.__get_batch_bugs()
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/github.py", line 549, in __get_batch_bugs
    since=self.mod_date_open)
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/github.py", line 538, in __get_batch_bugs_state
    result = urllib2.urlopen(request)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden
[10:55:14] /usr/local/bin/bicho --db-user-out=***** --db-password-out=***** --db-database-out=cp_bicho_CoreOS -d 1 -b github --backend-user=***** --backend-password=***** -u "https://api.github.com/repos/coreos/nova-agent-watcher/issues"  -g >> /home/azureuser/Automator/manrique/CoreOS//log/launch_bicho.log 2>&1
The server could not fulfill the request Forbidden(403)
albertinisg commented 9 years ago

After the issue 147 was solved, I've updated bicho and run the process again. I'm reproducing the same error as jsmanrique described (launching Bicho with automator):

DBG: [01/Apr/2015-00:02:41] Last open bug already cached: None
DBG: [01/Apr/2015-00:02:41] Last closed bug already cached: 2015-01-30T09:00:41
Traceback (most recent call last):
  File "/usr/local/bin/bicho", line 25, in 
    retval = bicho.main.main()
  File "/usr/local/lib/python2.7/dist-packages/bicho/main.py", line 56, in main
    backend.run()
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/github.py", line 592, in run
    bugs = self.__get_batch_bugs()
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/github.py", line 551, in __get_batch_bugs
    since=self.mod_date_open)
  File "/usr/local/lib/python2.7/dist-packages/bicho/backends/github.py", line 540, in __get_batch_bugs_state
    result = urllib2.urlopen(request)
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 407, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 445, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 403: Forbidden

This is not related with the rate, all the queries sent by Bicho using automator are failing.

jgbarah commented 9 years ago

Did you try using curl on the url Bicho is trying to retrieve just after the error? If you can do so, please use "curl -v", and post the result.

albertinisg commented 9 years ago

Thanks for the hint Jesus! Finally I understood what's happening. Using the right credentials it works with the rate limit expected so, the problem is just what it is, Error 403: Forbidden because the API rate limit was exceeded. For anyone having this issue, check https://developer.github.com/v3/rate_limit/ for further information.

sduenas commented 9 years ago

I can't reproduce the error, are you sure you did not exceed the rate limit?

sduenas commented 9 years ago

Ok. I close it, then.