title: How to fix "Client Request Interrupted" error in Heroku (with a rails app)?
body: <ol>
  <li>I deployed my rails app on Heroku. </li>
  <li><p>When I try to create a new profile, my app crashes. My logs display a Client Request Interrupted error. You can see my logs below.</p></li>
  <li><p>I searched this error on heroku dev center: <a href="https://devcenter.heroku.com/changelog-items/662" rel="nofollow noreferrer">https://devcenter.heroku.com/changelog-items/662</a></p></li>
  </ol>
  
  <p>On this page (<a href="https://devcenter.heroku.com/changelog-items/662" rel="nofollow noreferrer">https://devcenter.heroku.com/changelog-items/662</a>): </p>
  
  <p>It said : "This error will be logged if the client socket was closed either in the middle of the request or before a response could be returned."</p>
  
  <p>Then </p>
  
  <p>"This error condition caused an H18 to be logged and the sock field could be used to differentiate between what are now H18 and H27 errors. "</p>
  
  <p>H18 - Server Request Interrupted</p>
  
  <p>The backend socket, belonging to your app’s web process was closed before the backend returned an HTTP response.</p>
  
  <pre><code>2019-02-05T15:53:19.905345+00:00 app[web.1]: bundler: failed to load command: puma (/app/vendor/bundle/ruby/2.5.0/bin/puma)
  2019-02-05T15:53:19.905399+00:00 app[web.1]: SignalException: SIGTERM
  2019-02-05T15:53:19.905401+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/launcher.rb:398:in `block in setup_signals'
  2019-02-05T15:53:19.905406+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/single.rb:115:in `join'
  2019-02-05T15:53:19.905407+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/single.rb:115:in `run'
  2019-02-05T15:53:19.905409+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/launcher.rb:184:in `run'
  2019-02-05T15:53:19.905410+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/lib/puma/cli.rb:78:in `run'
  2019-02-05T15:53:19.905412+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/gems/puma-3.12.0/bin/puma:10:in `&lt;top (required)&gt;'
  2019-02-05T15:53:19.905414+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in `load'
  2019-02-05T15:53:19.905415+00:00 app[web.1]: /app/vendor/bundle/ruby/2.5.0/bin/puma:23:in `&lt;top (required)&gt;'
  2019-02-05T21:33:39.526627+00:00 heroku[web.1]: Unidling
  2019-02-05T21:33:53.579585+00:00 app[web.1]: Puma starting in single mode...
  2019-02-05T21:33:53.579631+00:00 app[web.1]: * Version 3.12.0 (ruby 2.5.3-p105), codename: Llamas in Pajamas
  2019-02-05T21:33:53.579632+00:00 app[web.1]: * Min threads: 5, max threads: 5
  2019-02-05T21:33:53.579634+00:00 app[web.1]: * Environment: production
  2019-02-05T21:34:00.063370+00:00 heroku[web.1]: State changed from starting to up
  2019-02-05T21:33:59.640588+00:00 app[web.1]: * Listening on tcp://0.0.0.0:11397
  2019-02-05T21:33:59.642173+00:00 app[web.1]: Use Ctrl-C to stop
  2019-02-05T21:34:02.204235+00:00 heroku[router]: sock=client at=warning code=H27 desc="Client Request Interrupted" method=GET path="/" host=agora-challenge.herokuapp.com request_id=9d994b8b-eff4-4088-b2be-a42b14fec708 fwd="209.17.96.226" dyno=web.1 connect=1ms service=119ms status=499 bytes= protocol=https
  </code></pre>
  
  <p>The important part to notice is the sock=client which means that the request was interrupted at the request of the client: </p>
  
  <pre><code>2019-02-05T21:34:02.204235+00:00 heroku[router]: sock=client at=warning code=H27 desc="Client Request Interrupted" method=GET path="/" host=agora-challenge.herokuapp.com request_id=9d994b8b-eff4-4088-b2be-a42b14fec708 fwd="209.17.96.226" dyno=web.1 connect=1ms service=119ms status=499 bytes= protocol=https
  </code></pre>
  
  <p>I didn't understand either Heroku dev center explanations nor previous Stack Overflow questions. </p>
  
  <p>Thanks a lot for your answers.  </p>