DiscourseApi::TooManyRequests: <html>

Open
#13,094 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
15/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Active
Tech stack
rails, ruby
Domain
backend

Research direction

The failure is raised in discourse_api/client.rb (handle_error, request, get) during a lookup in discourse_api/api/users.rb by_external_id, called from app/models/badges/discourser_badge.rb has_discourse_account? and award_to?, and reached through app/commands/user/acquired_badge/create.rb and app/jobs/award_badge_job.rb. Start by reading those call sites to see how a 429 response from the Discourse forum is currently handled. The issue does not say what the fix should be, so confirm the intended behaviour (retry, back off, or skip) with maintainers before changing code.

Written by the indexing model from the issue text.

Description

Error

<html>
 (DiscourseApi::TooManyRequests)
<head><title>429 Too Many Requests</title></head>
<body><a href="https://forum.exercism.org/cdn-cgi/content?id=1q3LRQnLczn_V33aX7X8S6s8TTC.nkpb3wykP5Ggk2Q-1794602375.6566021-1.2.1.1-603kAONu4YkP2VpliJ0Aw96Qh48yhY5ILIIVjXCuuM1sDPNFDrC4P4JShzMWLJxc" aria-hidden="true" rel="nofollow noopener" style="display: none !important; visibility: hidden !important"></a>
<center><h1>429 Too Many Requests</h1></center>
<hr><center>nginx</center>
<script>(function(){function c(){var b=a.contentDocument||(a.contentWindow&&a.contentWindow.document);if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'a5a0962fda5c579e',t:'MTc5NDYwMjM3NQ=='};var l=window.parent.location,o;try{o=new URL(l.origin).origin}catch(e){try{o=new URL(new URL(l.href).origin).origin}catch(e){o=''}}var u='/cdn-cgi/challenge-platform/scripts/jsd/main.js?ray=a5a0962fda5c579e',a=document.createElement('script');a.src=o?new URL(u,o).href:u;document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();</script></body>
</html>

Stack trace

discourse_api/client.rb:184 in handle_error
discourse_api/client.rb:167 in request
discourse_api/client.rb:97 in get
discourse_api/api/users.rb:93 in by_external_id
app/models/badges/discourser_badge.rb:14 in has_discourse_account?
app/models/badges/discourser_badge.rb:8 in award_to?
app/commands/user/acquired_badge/create.rb:14 in call
mandate/call_injector.rb:10 in User::AcquiredBadge::Create.call
app/jobs/award_badge_job.rb:13 in perform
active_job/execution.rb:68 in block in ActiveJob::Execution#_perform_job

Tracking Details

Dominant language
Ruby
Stars
554
Forks
172
Avg merge
20h 23m
Merged PRs (30d)
73

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from exercism/website

All issues in exercism/website

Similar issues

More Ruby issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.