Hacktoberfest / hacktoberfest-2020

Hacktoberfest - App to manage the annual open-source challenge, used for the 2019 & 2020 seasons.

Home Page:https://hacktoberfest.digitalocean.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Airbrake] [Production] the server responded with status 502

mkcode opened this issue Β· comments

Airbrake error: #7391
Airbrake project: Hacktoberfest

Error type: Faraday::ClientError
Error message: the server responded with status 502
Where: users#register
Occurred at: Oct 03, 2019 14:48:38 UTC
First seen at: Sep 25, 2019 23:30:48 UTC
Occurrences: 14914 (0 since last deploy on <no information>)
Severity: error

URL: https://hacktoberfest.digitalocean.com/register
File: /GEM_ROOT/gems/faraday-0.15.4/lib/faraday/response/raise_error.rb

Backtrace:

/GEM_ROOT/gems/faraday-0.15.4/lib/faraday/response/raise_error.rb:13:in on_complete
/GEM_ROOT/gems/faraday-0.15.4/lib/faraday/response.rb:9:in block in call
/GEM_ROOT/gems/faraday-0.15.4/lib/faraday/response.rb:61:in on_complete
/GEM_ROOT/gems/faraday-0.15.4/lib/faraday/response.rb:8:in call

@MattIPv4 - This is the error that is causing the 500 errors on the profile and register pages. IMO - the best thing we can do is show an error page saying something to effect of 'We had a problem communicating with am external API. Please refresh the page. If problems persist, contact support'

Some of these users were accessing their profile, not registering. Is it still the same error?
One or two could not get past this error until they used a fresh browser, refreshing didn't fix it?

Yes. Here is the tally per page:
image

The Jobs are in run in background and produce no user facing error. They will be retried automatically.

Ah yeah, makes sense. We should stick a friendly error page in then. I wonder why GitHub is throwing back 502s?

It's just somewhat unreliable 😞

Do we record the response body for these, I'd be interested to know if GitHub has any actual reason for erroring.

'Something went wrong while executing your query. This is most likely a GitHub bug.' is the error message. :-)

Ah yes GitHub, very helpful as always πŸ˜‚

@MattIPv4 - It would be helpful if you could provide the copy of exactly what to say on this page.

We want to use the rescue_from pattern in the controller to handle these: https://api.rubyonrails.org/classes/ActiveSupport/Rescuable/ClassMethods.html

<div class="section">
  <div class="container">
    <div class="details">

      <h1 class="title is-1">Uh oh... this doesn't seem right.</h1>
      <p>
        Well, something has gone wrong and it's our fault.
        I wish I could tell you more but all I've got is <code>Error 500</code>.
      </p>

      <br/>
      <br/>
      <div class="line-br">
        <span class="line-br-1">-</span>
        <span class="line-br-2">-</span>
      </div>
      <br/>

      <h3 class="title is-3">
        Here's what you should try doing to see if we can get this sorted:
      </h3>

      <p>
        <span class="highlight">●</span> Try refreshing this page. It might just start working!
      </p>
      <p>
        <span class="highlight">●</span> Head to the <%= link_to "homepage", root_path %> and try again from there.
      </p>
      <p>
        <span class="highlight">●</span>
        <a href="https://www.whatismybrowser.com/guides/how-to-clear-cookies-browsing-history-and-cache/auto"
           target="_blank" rel="noopener">Clear your cookies and cache</a> (if you’d like to give that a shot), then
        reload the page.
      </p>
      <p>
        <span class="highlight">●</span> Give this a few minutes to get itself together. Try again in 5?
      </p>
      <p>
        <span class="highlight">●</span> If all else fails and this page still isn't working for you after 30 minutes,
        please let us know by emailing
        <a href="mailto:hacktoberfest@digitalocean.com">hacktoberfest@digitalocean.com</a>.
      </p>

    </div>
  </div>
</div>

The Error 500 text can be made dynamic with whatever error code we're displaying this content for :)

image

@MattIPv4 - This is great. Thanks. It can serve as our generic 500 error page. We are also able to show a specific message on the API failure messages, where we could be more focused on just retrying. What do you think?

Seeing some of the 500 reports, reloading wasn't working for some, across multiple browsers. As reload is the first item here, I think this should be fine for everything?

It will work fine for everything. OK

@fridaland - Disregard my message for using rescue_from above. Follow this to setup a generic 500 error page: https://guides.rubyonrails.org/action_controller_overview.html#the-default-500-and-404-templates

Note that this page needs to be just static html, no ERB <% %> are allowed here.

I took this template and made a 500, 404, and specific api error page in #294.