Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-1937. Acceptance tests fail if scm webui shows invalid json #1256

Closed
wants to merge 1 commit into from

Conversation

elek
Copy link
Member

@elek elek commented Aug 8, 2019

Acceptance test of a nightly build is failed with the following error:

{code}
Creating ozonesecure_datanode_3 ...
�[7A�[2K
Creating ozonesecure_kdc_1 ... �[32mdone�[0m
�[7B�[6A�[2K
Creating ozonesecure_om_1 ... �[32mdone�[0m
�[6B�[8A�[2K
Creating ozonesecure_scm_1 ... �[32mdone�[0m
�[8B�[1A�[2K
Creating ozonesecure_datanode_3 ... �[32mdone�[0m
�[1B�[5A�[2K
Creating ozonesecure_kms_1 ... �[32mdone�[0m
�[5B�[4A�[2K
Creating ozonesecure_s3g_1 ... �[32mdone�[0m
�[4B�[2A�[2K
Creating ozonesecure_datanode_2 ... �[32mdone�[0m
�[2B�[3A�[2K
Creating ozonesecure_datanode_1 ... �[32mdone�[0m
�[3Bparse error: Invalid numeric literal at line 2, column 0
{code}

https://raw.githubusercontent.com/elek/ozone-ci/master/byscane/byscane-nightly-5b87q/acceptance/output.log

The problem is in the script which checks the number of available datanodes.

If the HTTP endpoint of the SCM is already started BUT not ready yet it may return with a simple HTML error message instead of json. Which can not be parsed by jq:

In testlib.sh:

{code}
37 │ if [[ "${SECURITY_ENABLED}" == 'true' ]]; then
38 │ docker-compose -f "${compose_file}" exec -T scm bash -c "kinit -k HTTP/scm@EXAMPL
│ E.COM -t /etc/security/keytabs/HTTP.keytab && curl --negotiate -u : -s '${jmx_url}'"
39 │ else
40 │ docker-compose -f "${compose_file}" exec -T scm curl -s "${jmx_url}"
41 │ fi
42 │ | jq -r '.beans[0].NodeCount[] | select(.key=="HEALTHY") | .value'
{code}

One possible fix is to adjust the error handling (set +x / set -x) per method instead of using a generic set -x at the beginning. It would provide a more predictable behavior. In our case count_datanode should not fail evert (as the caller method: wait_for_datanodes can retry anyway).

See: https://issues.apache.org/jira/browse/HDDS-1937

@elek elek added the ozone label Aug 8, 2019
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's simpler to add || true after jq:

  fi \
    | jq -r '.beans[0].NodeCount[] | select(.key=="HEALTHY") | .value' \
    || true

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 45 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
0 shelldocs 0 Shelldocs was not available.
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 mvninstall 603 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 791 branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 mvninstall 561 the patch passed
+1 mvnsite 0 the patch passed
+1 shellcheck 1 There were no new shellcheck issues.
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 673 patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 unit 100 hadoop-hdds in the patch passed.
+1 unit 295 hadoop-ozone in the patch passed.
+1 asflicense 46 The patch does not generate ASF License warnings.
3311
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/1/artifact/out/Dockerfile
GITHUB PR #1256
Optional Tests dupname asflicense mvnsite unit shellcheck shelldocs
uname Linux 6ca32bad8052 4.4.0-157-generic #185-Ubuntu SMP Tue Jul 23 09:17:01 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 63161cf
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/1/testReport/
Max. process+thread count 447 (vs. ulimit of 5500)
modules C: hadoop-ozone/dist U: hadoop-ozone/dist
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/1/console
versions git=2.7.4 maven=3.3.9 shellcheck=0.4.6
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 47 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
0 shelldocs 1 Shelldocs was not available.
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 mvninstall 580 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 731 branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 mvninstall 585 the patch passed
+1 mvnsite 0 the patch passed
+1 shellcheck 1 There were no new shellcheck issues.
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 648 patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 unit 94 hadoop-hdds in the patch passed.
+1 unit 275 hadoop-ozone in the patch passed.
+1 asflicense 39 The patch does not generate ASF License warnings.
3166
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/2/artifact/out/Dockerfile
GITHUB PR #1256
Optional Tests dupname asflicense mvnsite unit shellcheck shelldocs
uname Linux 4d0c5be8a8d7 4.4.0-139-generic #165-Ubuntu SMP Wed Oct 24 10:58:50 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 9b8359b
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/2/testReport/
Max. process+thread count 412 (vs. ulimit of 5500)
modules C: hadoop-ozone/dist U: hadoop-ozone/dist
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/2/console
versions git=2.7.4 maven=3.3.9 shellcheck=0.4.6
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 80 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
0 shelldocs 0 Shelldocs was not available.
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 mvninstall 634 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 888 branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 mvninstall 630 the patch passed
+1 mvnsite 0 the patch passed
+1 shellcheck 1 There were no new shellcheck issues.
+1 whitespace 1 The patch has no whitespace issues.
+1 shadedclient 845 patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 unit 121 hadoop-hdds in the patch passed.
+1 unit 332 hadoop-ozone in the patch passed.
+1 asflicense 50 The patch does not generate ASF License warnings.
3781
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/3/artifact/out/Dockerfile
GITHUB PR #1256
Optional Tests dupname asflicense mvnsite unit shellcheck shelldocs
uname Linux 69dc1990686e 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 6244502
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/3/testReport/
Max. process+thread count 310 (vs. ulimit of 5500)
modules C: hadoop-ozone/dist U: hadoop-ozone/dist
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/3/console
versions git=2.7.4 maven=3.3.9 shellcheck=0.4.6
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@elek
Copy link
Member Author

elek commented Aug 21, 2019

I think it's simpler to add || true after jq:

  fi \
    | jq -r '.beans[0].NodeCount[] | select(.key=="HEALTHY") | .value' \
    || true

Yes, it's also possible. But my feeling is that set -e on the top level is dangerous and can be better remove it.

  1. It's hard to follow the sections where set -e/+e are enabled. With the new approach they set in the scope of the selected methods. I think it's easier to understand that which methods can fail

  2. It's hard to debug the script locally with source testlib.sh and execute the command because most of the time the shell can be exited and hard to follow why...

@adoroszlai
Copy link
Contributor

  1. It's hard to follow the sections where set -e/+e are enabled. With the new approach they set in the scope of the selected methods. I think it's easier to understand that which methods can fail

True, but I have two concerns about the new approach, not sure how real in practice they are:

  1. The functions assume the flag was off previously (in case of success, they turn off the flag, regardless of its prior value)
  2. Flag is not reset if the function returns due to error
  1. It's hard to debug the script locally with source testlib.sh and execute the command because most of the time the shell can be exited and hard to follow why...

Agreed. Maybe it should be set in the caller scripts (test.sh) instead of the library.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 88 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
0 shelldocs 0 Shelldocs was not available.
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 mvninstall 652 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 935 branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 mvninstall 666 the patch passed
+1 mvnsite 0 the patch passed
+1 shellcheck 1 There were no new shellcheck issues.
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 788 patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 unit 101 hadoop-hdds in the patch passed.
+1 unit 286 hadoop-ozone in the patch passed.
+1 asflicense 41 The patch does not generate ASF License warnings.
3800
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/4/artifact/out/Dockerfile
GITHUB PR #1256
Optional Tests dupname asflicense mvnsite unit shellcheck shelldocs
uname Linux b18a0849526b 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 10ec31d
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/4/testReport/
Max. process+thread count 341 (vs. ulimit of 5500)
modules C: hadoop-ozone/dist U: hadoop-ozone/dist
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/4/console
versions git=2.7.4 maven=3.3.9 shellcheck=0.4.6
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 42 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
0 shelldocs 1 Shelldocs was not available.
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 mvninstall 590 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 729 branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 mvninstall 564 the patch passed
+1 mvnsite 0 the patch passed
+1 shellcheck 0 There were no new shellcheck issues.
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 636 patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 unit 90 hadoop-hdds in the patch passed.
+1 unit 281 hadoop-ozone in the patch passed.
+1 asflicense 41 The patch does not generate ASF License warnings.
3146
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/5/artifact/out/Dockerfile
GITHUB PR #1256
Optional Tests dupname asflicense mvnsite unit shellcheck shelldocs
uname Linux ea20617ee6ab 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / ee7c261
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/5/testReport/
Max. process+thread count 446 (vs. ulimit of 5500)
modules C: hadoop-ozone/dist U: hadoop-ozone/dist
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/5/console
versions git=2.7.4 maven=3.3.9 shellcheck=0.4.6
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@elek
Copy link
Member Author

elek commented Aug 24, 2019

Ok. Let's fix this problem with the suggested || true to quickly fix the problem and discuss further how the set -x usage can be used safely...

@elek
Copy link
Member Author

elek commented Aug 24, 2019

/retest

1 similar comment
@elek
Copy link
Member Author

elek commented Aug 24, 2019

/retest

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 134 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
0 shelldocs 0 Shelldocs was not available.
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 mvninstall 847 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 1090 branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 mvninstall 598 the patch passed
+1 mvnsite 0 the patch passed
+1 shellcheck 1 There were no new shellcheck issues.
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 764 patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 unit 128 hadoop-hdds in the patch passed.
+1 unit 327 hadoop-ozone in the patch passed.
+1 asflicense 48 The patch does not generate ASF License warnings.
4171
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/6/artifact/out/Dockerfile
GITHUB PR #1256
Optional Tests dupname asflicense mvnsite unit shellcheck shelldocs
uname Linux 9d874a11e5ed 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / d2225c8
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/6/testReport/
Max. process+thread count 305 (vs. ulimit of 5500)
modules C: hadoop-ozone/dist U: hadoop-ozone/dist
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/6/console
versions git=2.7.4 maven=3.3.9 shellcheck=0.4.6
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @elek for making this change.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 88 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
0 shelldocs 0 Shelldocs was not available.
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 mvninstall 625 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 878 branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+1 mvninstall 643 the patch passed
+1 mvnsite 0 the patch passed
+1 shellcheck 1 There were no new shellcheck issues.
+1 whitespace 0 The patch has no whitespace issues.
+1 shadedclient 799 patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 unit 103 hadoop-hdds in the patch passed.
+1 unit 308 hadoop-ozone in the patch passed.
+1 asflicense 43 The patch does not generate ASF License warnings.
3684
Subsystem Report/Notes
Docker Client=19.03.0 Server=19.03.0 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/7/artifact/out/Dockerfile
GITHUB PR #1256
Optional Tests dupname asflicense mvnsite unit shellcheck shelldocs
uname Linux 75b9c8ff02d4 4.15.0-52-generic #56-Ubuntu SMP Tue Jun 4 22:49:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 3329257
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/7/testReport/
Max. process+thread count 305 (vs. ulimit of 5500)
modules C: hadoop-ozone/dist U: hadoop-ozone/dist
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1256/7/console
versions git=2.7.4 maven=3.3.9 shellcheck=0.4.6
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@adoroszlai
Copy link
Contributor

/retest

@anuengineer
Copy link
Contributor

+1, Thanks for the review @adoroszlai .

@anuengineer
Copy link
Contributor

Committed to the trunk. Thank for the contribution @elek

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants