Bug 806713 - REST API throws 500 when DNS service is unavailable due to outage
Summary: REST API throws 500 when DNS service is unavailable due to outage
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 1.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Abhishek Gupta
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-26 04:10 UTC by Clayton Coleman
Modified: 2012-06-25 18:26 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-25 18:26:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Clayton Coleman 2012-03-26 04:10:57 UTC
When attempting an operation that requires DNS, and DNS is down, the service throws a 500 exception and returns invalid output.  It should instead return an appropriate status code (service unavailable, 503?) and appropriate error message, since in production DYN has proven to be unreliable.  In general, when a distributed system is required but unavailable, and it can't be reached to complete an operation we should indicate that to the user.  

Broker exception trace was:
StickShift::DNSException (Error communicating with DNS system.  If the problem persists please contact Red Hat support.):
  lib/express/broker/dns_service.rb:152:in `raise_dns_exception'
  lib/express/broker/dns_service.rb:128:in `dyn_login'
  lib/express/broker/dns_service.rb:167:in `dyn_do'
  lib/express/broker/dns_service.rb:112:in `dyn_login'
  lib/express/broker/dns_service.rb:84:in `login'
  lib/express/broker/dns_service.rb:32:in `initialize'

Rest returned 500, HTML and an error page (a rails error page)

Possible error message in this case might be

"Your domain cannot be created because of a temporary outage.  Please check the OpenShift status page for information about when this outage will be resolved."

Returning a specific exit code would also be useful.

Comment 1 Abhishek Gupta 2012-06-18 23:34:37 UTC
Fixed in https://github.com/openshift/crankcase/pull/142
Waiting for merge

Comment 2 Abhishek Gupta 2012-06-19 00:43:46 UTC
We are now returning 503 instead of 500 for dns failures during application creation/deletion and domain creation/update/deletion.

Comment 3 Meng Bo 2012-06-19 06:58:38 UTC
Checked on devenv_1857, new errno. returned.

===development.log===

[REQ_ID=4fad49e95e6e477e8d885d3c06069e3f] ACTION=LEGACY_BROKER StickShift::DNSException for /broker/cartridge: Error communicating with DNS system.  If the problem persists please contact Red Hat support.
Completed 503 Service Unavailable in 30278ms (Views: 2.0ms)


Note You need to log in before you can comment on or make changes to this bug.