Search code examples
ruby-on-railsopen-uri

Getting OpenURI::HTTPError: 503 Service Temporarily Unavailable in server


I'm trying to parse a feed:

SimpleRSS.parse open('https://catracalivre.com.br/feed/', :allow_redirections => :all)

and it works on localhost but when I deploy to my server, I get the following error:

OpenURI::HTTPError: 503 Service Temporarily Unavailable.

Any ideas on why it works only on localhost? Ps: it works with other URLs. The problem happens only with "https://catracalivre.com.br/feed/".


Solution

  • The site uses Cloudflare as a CDN. The site owner has configured their "DDoS protection" service which partly requires the client (i.e. your feedreader) to execute Javascript or solve certain captcha challenges.

    This is certainly an error on their side since an RSS feed is intended to be consumed by machines. You should contact the site owner and ask then to exempt their RSS feed from the protection.