Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-13080

Log a WARN/ERROR when invalid blueprint is POST'ed

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.2
    • Component/s: blueprints
    • Labels:
      None

      Description

      Currently, if a invalid blueprint is posted no error is logged. It makes it difficult to debug issues.

      For example, the following type of error is not reported in the log file.

      The error I see is:

      root@headnode0:/home/hdiuser# curl -u admin:admin -H "X-Requested-By: ambari" -X POST -d @/tmp/spark.json http://localhost:8080/api/v1/blueprints/bp1
      {
        "status" : 400,
        "message" : "The component 'SPARK_CLIENT' in host group 'headnode0' is not valid for the specified stack"
      }
      

      The error is reported back to the caller but it should also be logged to the server log to make it easier to debug.

        Activity

        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Ambari-branch-2.1 #522 (See https://builds.apache.org/job/Ambari-branch-2.1/522/)
        AMBARI-13080. Log a WARN/ERROR when invalid blueprint is POST'ed (smohanty) (smohanty: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=ffb015f768f377b0364d34e196e8aab35fd7c3fd)

        • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Ambari-branch-2.1 #522 (See https://builds.apache.org/job/Ambari-branch-2.1/522/ ) AMBARI-13080 . Log a WARN/ERROR when invalid blueprint is POST'ed (smohanty) (smohanty: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=ffb015f768f377b0364d34e196e8aab35fd7c3fd ) ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Ambari-trunk-Commit #3434 (See https://builds.apache.org/job/Ambari-trunk-Commit/3434/)
        AMBARI-13080. Log a WARN/ERROR when invalid blueprint is POST'ed (smohanty) (smohanty: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=eb36305a342fcd32cc1d17fea15e7f2a00244e5c)

        • ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Ambari-trunk-Commit #3434 (See https://builds.apache.org/job/Ambari-trunk-Commit/3434/ ) AMBARI-13080 . Log a WARN/ERROR when invalid blueprint is POST'ed (smohanty) (smohanty: http://git-wip-us.apache.org/repos/asf?p=ambari.git&a=commit&h=eb36305a342fcd32cc1d17fea15e7f2a00244e5c ) ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintResourceProvider.java
        Hide
        sumitmohanty Sumit Mohanty added a comment -

        Committed to trunk and branch-2.1

        Show
        sumitmohanty Sumit Mohanty added a comment - Committed to trunk and branch-2.1
        Hide
        rnettleton Robert Nettleton added a comment -

        +1 for the patch, looks fine to me.

        Question: Is this an error condition that is not returned to the REST client when the Blueprint is posted? What kinds of errors are involved here?

        Thanks.

        Show
        rnettleton Robert Nettleton added a comment - +1 for the patch, looks fine to me. Question: Is this an error condition that is not returned to the REST client when the Blueprint is posted? What kinds of errors are involved here? Thanks.

          People

          • Assignee:
            sumitmohanty Sumit Mohanty
            Reporter:
            sumitmohanty Sumit Mohanty
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development