Open yegor256 opened 1 week ago
@yegor256 As I see this error refers to this project, see this line:
/home/judges/add-user-names/add-user-names.rb:31:in `block (2 levels) in <top (required)>'Octokit::Forbidden
Maybe this issue needs to be transferred to that project?
If I understand it correctly, then it is necessary to ignore Octokit::ClientError
exception here
Can i fix it?
@Yegorov you are right, transferred
@Yegorov maybe it's possible to check the presence of a user via GitHub API? Just ignoring all client errors is not a good idea.
@yegor256 it was a false assumption that the user was deleted or not found
octo.user(29139614)
GET https://api.github.com/user/29139614
D: Octokit::Client.user(29139614) in 512ms
=>
{:login=>"renovate[bot]",
:id=>29139614,
If the user does not exist, then there must be an error: 404 - Not Found
octo.user(11)
D: Octokit::Client.user(11) in 454ms
/home/artem/.rvm/gems/ruby-3.3.4/gems/octokit-9.1.0/lib/octokit/response/raise_error.rb:14:in `on_complete': GET https://api.github.com/user/11: 404 - Not Found // See: https://docs.github.com/rest (Octokit::NotFound)
from /home/artem/.rvm/gems/ruby-3.3.4/gems/faraday-2.10.1/lib/faraday/middleware.rb:57:in `block in call'
from /home/artem/.rvm/gems/ruby-3.3.4/gems/faraday-2.10.1/lib/faraday/response.rb:42:in `on_complete'
from /home/artem/.rvm/gems/ruby-3.3.4/gems/faraday-2.10.1/lib/faraday/middleware.rb:56:in `call'
from /home/artem/.rvm/gems/ruby-3.3.4/gems/faraday-http-cache-2.5.1/lib/faraday/http_cache.rb:286:in `fetch'
from /home/artem/.rvm/gems/ruby-3.3.4/gems/faraday-http-cache-2.5.1/lib/faraday/http_cache.rb:190:in `process'
from /home/artem/.rvm/gems/ruby-3.3.4/gems/faraday-http-cache-2.5.1/lib/faraday/http_cache.rb:141:in `call!'
from /home/artem/.rvm/gems/ruby-3.3.4/gems/faraday-http-cache-2.5.1/lib/faraday/http_cache.rb:121:in `call'
from /home/artem/projects2/zerocracy/fbe/lib/fbe/middleware/quota.rb:48:in `call'
Error 403 - Resource not accessible by integration
based on the documentation is related to rate limiting:
If you exceed your primary rate limit, you will receive a 403 Forbidden or 429 Too Many Requests response, and the x-ratelimit-remaining header will be 0. If you exceed a secondary rate limit, you will receive a 403 Forbidden or 429 Too Many Requests response and an error message that indicates that you exceeded a secondary rate limit.
We cannot find out why Github answered with this 403 Forbidden
error and not 429 Too Many Requests
because there was no logger
I propose to implement logging only answers with statuses of more than 400 to find out the cause of this error. What do you think?
@Yegorov I like the idea of making logging more verbose. Now, we use Loog::NULL
, while loog
is provided as an argument of Fbe.octo
. This looks wrong. However, just passing loog
instead of Loog::NULL
may lead to very verbose log output. Try to fix this, but be aware of the problem: logs must not be noisy when loog
is Loog::REGULAR
.
@rultor release, tag is 0.0.35
I found this problem here:
Probably, the user is deleted and that's why we fail.