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

scylla_setup: `NTP setup failed.` is raised even the setup is good #3485

Closed
amoskong opened this Issue Jun 4, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@amoskong
Contributor

amoskong commented Jun 4, 2018

Installation details
Scylla version (or git commit hash): 666.development-0.20180603.6f2d3b7f9
Cluster size: 1
OS (RHEL/CentOS/Ubuntu/AWS AMI): CentOS7

  • Description
    Currently even the scylla_ntp_setup script was executed successfully, we can still see error: NTP setup failed. in scylla_setup.

This is a regression introduced by commit 300af65

diff --git a/dist/common/scripts/scylla_setup b/dist/common/scripts/scylla_setup
index 5a8c18215..821b33aeb 100755
--- a/dist/common/scripts/scylla_setup
+++ b/dist/common/scripts/scylla_setup
@@ -116,6 +116,9 @@ run_setup_script() {
 run_setup_script() {
     name=$1
     shift 1
     $* &&:
     if [ $? -ne 0 ] && [ $INTERACTIVE -eq 1 ]; then
         printf "${RED}$name setup failed. press any key to continue...${NO_COLOR}\n"
         read
         return 1
+    else
+        printf "$name setup failed.\n"
+        exit 1
     fi
     return 0
 }
2018-06-04 04:01:52,532 process          L0333 INFO | Running 'sudo /usr/lib/scylla/scylla_setup --nic eth0 --disks /dev/vdb --no-cpuscaling-setup'
2018-06-04 04:01:52,542 process          L0420 DEBUG| [stdout] �[0;32mSkip any of the following steps by answering 'no'�[0m
2018-06-04 04:01:54,936 process          L0420 DEBUG| [stdout] This is a supported kernel version.
2018-06-04 04:01:54,986 process          L0420 DEBUG| [stderr] Created symlink from /etc/systemd/system/multi-user.target.wants/scylla-server.service to /usr/lib/systemd/system/scylla-server.service.
2018-06-04 04:01:55,034 process          L0420 DEBUG| [stderr] Created symlink from /etc/systemd/system/multi-user.target.wants/collectd.service to /usr/lib/systemd/system/collectd.service.
2018-06-04 04:01:56,452 process          L0420 DEBUG| [stdout] Unable to retrieve version information
2018-06-04 04:01:56,530 process          L0420 DEBUG| [stdout] Loaded plugins: fastestmirror
2018-06-04 04:01:56,561 process          L0420 DEBUG| [stdout] Loading mirror speeds from cached hostfile
2018-06-04 04:01:56,565 process          L0420 DEBUG| [stdout]  * base: mirror.isoc.org.il
2018-06-04 04:01:56,565 process          L0420 DEBUG| [stdout]  * epel: mirror.nonstop.co.il
2018-06-04 04:01:56,567 process          L0420 DEBUG| [stdout]  * extras: mirror.isoc.org.il
2018-06-04 04:01:56,567 process          L0420 DEBUG| [stdout]  * updates: mirror.isoc.org.il
2018-06-04 04:01:56,687 process          L0420 DEBUG| [stdout] Package ntpdate-4.2.6p5-28.el7.centos.x86_64 already installed and latest version
2018-06-04 04:01:56,688 process          L0420 DEBUG| [stdout] Resolving Dependencies
2018-06-04 04:01:56,688 process          L0420 DEBUG| [stdout] --> Running transaction check
2018-06-04 04:01:56,688 process          L0420 DEBUG| [stdout] ---> Package ntp.x86_64 0:4.2.6p5-28.el7.centos will be installed
2018-06-04 04:01:57,145 process          L0420 DEBUG| [stdout] --> Finished Dependency Resolution
2018-06-04 04:01:57,245 process          L0420 DEBUG| [stdout] 
2018-06-04 04:01:57,245 process          L0420 DEBUG| [stdout] Dependencies Resolved
2018-06-04 04:01:57,246 process          L0420 DEBUG| [stdout] 
2018-06-04 04:01:57,246 process          L0420 DEBUG| [stdout] ================================================================================
2018-06-04 04:01:57,246 process          L0420 DEBUG| [stdout]  Package     Arch           Version                          Repository    Size
2018-06-04 04:01:57,246 process          L0420 DEBUG| [stdout] ================================================================================
2018-06-04 04:01:57,246 process          L0420 DEBUG| [stdout] Installing:
2018-06-04 04:01:57,246 process          L0420 DEBUG| [stdout]  ntp         x86_64         4.2.6p5-28.el7.centos            base         549 k
2018-06-04 04:01:57,246 process          L0420 DEBUG| [stdout] 
2018-06-04 04:01:57,246 process          L0420 DEBUG| [stdout] Transaction Summary
2018-06-04 04:01:57,247 process          L0420 DEBUG| [stdout] ================================================================================
2018-06-04 04:01:57,247 process          L0420 DEBUG| [stdout] Install  1 Package
2018-06-04 04:01:57,247 process          L0420 DEBUG| [stdout] 
2018-06-04 04:01:57,248 process          L0420 DEBUG| [stdout] Total download size: 549 k
2018-06-04 04:01:57,248 process          L0420 DEBUG| [stdout] Installed size: 1.4 M
2018-06-04 04:01:57,248 process          L0420 DEBUG| [stdout] Downloading packages:
2018-06-04 04:01:59,029 process          L0420 DEBUG| [stdout] Running transaction check
2018-06-04 04:01:59,036 process          L0420 DEBUG| [stdout] Running transaction test
2018-06-04 04:01:59,065 process          L0420 DEBUG| [stdout] Transaction test succeeded
2018-06-04 04:01:59,065 process          L0420 DEBUG| [stdout] Running transaction
2018-06-04 04:01:59,334 process          L0420 DEBUG| [stdout]   Installing : ntp-4.2.6p5-28.el7.centos.x86_64                             1/1 
2018-06-04 04:01:59,334 process          L0420 DEBUG| [stdout]   Verifying  : ntp-4.2.6p5-28.el7.centos.x86_64                             1/1 
2018-06-04 04:01:59,334 process          L0420 DEBUG| [stdout] 
2018-06-04 04:01:59,334 process          L0420 DEBUG| [stdout] Installed:
2018-06-04 04:01:59,334 process          L0420 DEBUG| [stdout]   ntp.x86_64 0:4.2.6p5-28.el7.centos                                            
2018-06-04 04:01:59,334 process          L0420 DEBUG| [stdout] 
2018-06-04 04:01:59,335 process          L0420 DEBUG| [stdout] Complete!
2018-06-04 04:02:05,554 process          L0420 DEBUG| [stdout]  4 Jun 04:02:05 ntpdate[1193]: adjust time server 109.226.40.40 offset -0.000178 sec
2018-06-04 04:02:05,562 process          L0420 DEBUG| [stderr] Created symlink from /etc/systemd/system/multi-user.target.wants/ntpd.service to /usr/lib/systemd/system/ntpd.service.
2018-06-04 04:02:05,653 process          L0420 DEBUG| [stdout] NTP setup failed.
@amoskong

This comment has been minimized.

Contributor

amoskong commented Jun 4, 2018

@syuu1228
A fix draft, it fixed this issue in my testing:

diff --git a/dist/common/scripts/scylla_setup b/dist/common/scripts/scylla_setup
index 2a2be4c36..3c515dc62 100755
--- a/dist/common/scripts/scylla_setup
+++ b/dist/common/scripts/scylla_setup
@@ -112,13 +112,15 @@ run_setup_script() {
     name=$1
     shift 1
     $* &&:
-    if [ $? -ne 0 ] && [ $INTERACTIVE -eq 1 ]; then
-        printf "${RED}$name setup failed. Press any key to continue...${NO_COLOR}\n"
-        read
-        return 1
-    else
-        printf "$name setup failed.\n"
-        exit 1
+    if [ $? -ne 0 ]; then
+        if [ $INTERACTIVE -eq 1 ]; then
+            printf "${RED}$name setup failed. Press any key to continue...${NO_COLOR}\n"
+            read
+            return 1
+        else
+            printf "$name setup failed.\n"
+            exit 1
+        fi
     fi
     return 0
 }

Posted the fix to https://groups.google.com/forum/#!topic/scylladb-dev/E8XJM5vRUII
[PATCH scylla] scylla_setup: fix conditional statement of silent mode

@amoskong

This comment has been minimized.

Contributor

amoskong commented Jun 4, 2018

duplicate with issue #3479

@syuu1228

This comment has been minimized.

Contributor

syuu1228 commented Jun 4, 2018

@amoskong same patch already on the ml "[PATCH scylla] dist/common/scripts/scylla_setup: Show setup failed message only when one of setup failed"

avikivity added a commit that referenced this issue Jul 25, 2018

scylla_setup: fix conditional statement of silent mode
Commit 300af65 introdued a problem in
conditional statement, script will always abort in silent mode, it doesn't
care about the return value.

Fixes #3485

Signed-off-by: Amos Kong <amos@scylladb.com>
Message-Id: <1c12ab04651352964a176368f8ee28f19ae43c68.1528077114.git.amos@scylladb.com>
(cherry picked from commit 364c255)

avikivity added a commit that referenced this issue Jul 25, 2018

scylla_setup: fix conditional statement of silent mode
Commit 300af65 introdued a problem in
conditional statement, script will always abort in silent mode, it doesn't
care about the return value.

Fixes #3485

Signed-off-by: Amos Kong <amos@scylladb.com>
Message-Id: <1c12ab04651352964a176368f8ee28f19ae43c68.1528077114.git.amos@scylladb.com>
(cherry picked from commit 364c255)

avikivity added a commit that referenced this issue Jul 25, 2018

scylla_setup: fix conditional statement of silent mode
Commit 300af65 introdued a problem in
conditional statement, script will always abort in silent mode, it doesn't
care about the return value.

Fixes #3485

Signed-off-by: Amos Kong <amos@scylladb.com>
Message-Id: <1c12ab04651352964a176368f8ee28f19ae43c68.1528077114.git.amos@scylladb.com>
(cherry picked from commit 364c255)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment