Bug 1012328

Summary: Broker returns user-unfriendly error messages when Dynect is in maintenance
Product: OpenShift Online Reporter: Zhe Wang <zhewang>
Component: PodAssignee: Lili Nader <lnader>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: medium    
Version: 2.xCC: lnader, mfisher, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-24 03:23:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Zhe Wang 2013-09-26 09:49:34 UTC
Description of problem:
Dynect was in maintenance from September 26, 2013 at 09:00 UTC until 10:00 UTC, causing its APIs to be unavailable. Moreover, the error was actually recorded in development.log:

^[[0;37m2013-09-26 05:01:56.865^[[0m [^[[0;37mDEBUG^[[0m] Retrying dyn_login after exception caught from DNS request: Login failed: Net::HTTPServiceUnavailable (pid:18844)
^[[0;37m2013-09-26 05:01:56.865^[[0m [^[[0;37mDEBUG^[[0m] DYNECT Login with path: /REST/Session/ (pid:18844)
^[[0;37m2013-09-26 05:01:56.955^[[0m [^[[0;37mDEBUG^[[0m] Execute DeregisterDnsOp (pid:8343)
^[[0;37m2013-09-26 05:01:56.969^[[0m [^[[0;37mDEBUG^[[0m] DYNECT Login with path: /REST/Session/ (pid:8343)
^[[0;37m2013-09-26 05:01:57.430^[[0m [^[[0;37mDEBUG^[[0m] Response code: 503 (pid:18844)
^[[0;37m2013-09-26 05:01:57.430^[[0m [^[[0;37mDEBUG^[[0m] Response body: {"status": "failure", "data": {}, "job_id": null, "msgs": [{"INFO": "The Dynect API is currently in maintenance mode.  Please try again later.", "SOURCE": "API-A", "LVL": "ERROR"}]} (pid:18844)
^[[0;37m2013-09-26 05:01:57.439^[[0m [^[[31mERROR^[[0m] Login failed: Net::HTTPServiceUnavailable (pid:18844)

However, the CLI only prompted the following error message when using rhc commands:

Login failed: Net::HTTPServiceUnavailable

which is very technical and user-unfriendly. It would be better if we could return a more readable and specific message.

Version-Release number of selected component (if applicable):
devenv_3832

How reproducible:
when Dynect is in maintenance

Steps to Reproduce:
1. Create an app via RHC when Dynect is in maintenance
2.
3.

Actual results:
The creation fails with the error:

[zhe@fedora runtst]$ rhc app create srb8 ruby-1.8
Application Options
-------------------
  Namespace:  test
  Cartridges: ruby-1.8
  Gear Size:  default
  Scaling:    no

Creating application 'srb8' ... Login failed: Net::HTTPServiceUnavailable


Expected results:
It could be better if the error message is more specific and user-friendly.

Additional info:

Comment 1 Lili Nader 2013-10-15 23:08:29 UTC
https://github.com/openshift/li/pull/1999

Comment 3 Zhe Wang 2013-10-18 05:29:01 UTC
The updated exception msg looks good friendly enough, and move the bug to VERIFIED.