Bug 1089697 - When nsupdate fails, no useful diagnostic information is reported
Summary: When nsupdate fails, no useful diagnostic information is reported
Keywords:
Status: CLOSED EOL
Alias: None
Product: OKD
Classification: Red Hat
Component: Pod
Version: 2.x
Hardware: x86_64
OS: Linux
high
high
Target Milestone: ---
: 2.x
Assignee: Abhishek Gupta
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1118396
TreeView+ depends on / blocked
 
Reported: 2014-04-21 17:12 UTC by Timothy Williams
Modified: 2018-12-05 18:15 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1118396 (view as bug list)
Environment:
Last Closed: 2017-01-25 06:39:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Timothy Williams 2014-04-21 17:12:37 UTC
Description of problem:
When an app DNS record fails to be created/deleted for some reason, there is no useful output. Only an error 'error adding app record GEARUUID-domain.example.com`. This does not give any information on why the nsupdate command that the broker uses to create DNS entries failed.

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

How reproducible:
Always

Steps to Reproduce:
1. Temporarily take down the DNS server for an OpenShift instance
2. Attempt to create a gear
3.

Actual results:
2014-03-22 18:07:58.290 [ERROR] Reference ID: 20101eec951f6f326a628e8aa3dfd1db - error adding app record 5i7z05icq-comp.prd-platform.ficoanalyticcloud.com

Expected results:
2014-03-22 18:07:58.290 [ERROR] Reference ID: 20101eec951f6f326a628e8aa3dfd1db - error adding app record 5i7z05icq-comp.prd-platform.ficoanalyticcloud.com - nsupdate output: example error output

Additional info:
Current code:
=======================
    def register_application(app_name, namespace, public_hostname)
      # create an A record for the application in the domain
      fqdn = "#{app_name}-#{namespace}.#{@domain_suffix}"

      cmd = add_cmd(fqdn, public_hostname)    <--- nsupdate command is created through add_cmd method and assigned to `cmd`

      success = system cmd     <--- `cmd` is run
      if not success        <--- if `cmd` returns false, raise error
        raise DNSException.new("error adding app record #{fqdn}")    <---- here is the error
      end
    end
=======================

Using `system` to run a command doesn't return the output, but just true or false, depending on the exit code of the command. It would be useful to use the backticks instead so that output from nsupdate is returned. Then, we can return the output in the error reported.

Comment 1 Timothy Williams 2014-05-13 16:42:10 UTC
https://github.com/openshift/origin-server/pull/5408

Comment 2 Luke Meyer 2014-07-10 17:57:35 UTC
For some reason, when the PR merged, no note was made here, and the state wasn't changed. It should be QEed just to be sure.


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