From b0bc37c101c913a5494139157f71a15a3e0ca99a Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 9 Nov 2017 14:36:49 -0800 Subject: [PATCH 1/3] Try fixing the 'brew update' issue in bootstrap script --- tools/installpsh-osx.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/installpsh-osx.sh b/tools/installpsh-osx.sh index 62a6fca1706..3d1ca29ba80 100755 --- a/tools/installpsh-osx.sh +++ b/tools/installpsh-osx.sh @@ -127,10 +127,21 @@ fi # Suppress output, it's very noisy on travis-ci echo "Refreshing Homebrew cache..." -if ! brew update > /dev/null; then - echo "ERROR: Refreshing Homebrew cache failed..." >&2 - exit 2 -fi +for count in {1..2}; do + # Try the update twice if the first time fails + brew update > /dev/null && break + + # If the update fails again after increasing the Git buffer size, exit with error. + if [[ $count == 2 ]]; then + echo "ERROR: Refreshing Homebrew cache failed..." >&2 + exit 2 + fi + + # The update failed for the first try. An error we see a lot in our CI is "RPC failed; curl 56 SSLRead() return error -36". + # A potential solution is to increase the Git buffer size to a larger number, say 150 mb. The default buffer size is 1 mb. + git config --global http.postBuffer 157286400 + sleep 5 +done # Suppress output, it's very noisy on travis-ci if [[ ! -d $(brew --prefix cask) ]]; then From cceb23603efe8691b89ece9e7bebb750659c7d1a Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Thu, 9 Nov 2017 15:43:54 -0800 Subject: [PATCH 2/3] Add a log message --- tools/installpsh-osx.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/installpsh-osx.sh b/tools/installpsh-osx.sh index 3d1ca29ba80..51ca98e201b 100755 --- a/tools/installpsh-osx.sh +++ b/tools/installpsh-osx.sh @@ -139,6 +139,7 @@ for count in {1..2}; do # The update failed for the first try. An error we see a lot in our CI is "RPC failed; curl 56 SSLRead() return error -36". # A potential solution is to increase the Git buffer size to a larger number, say 150 mb. The default buffer size is 1 mb. + echo "First attempt of update failed. Increase Git buffer size and try again ..." git config --global http.postBuffer 157286400 sleep 5 done From bd67554e22ee8348d25b94180fab5284540563bc Mon Sep 17 00:00:00 2001 From: Dongbo Wang Date: Fri, 10 Nov 2017 13:50:23 -0800 Subject: [PATCH 3/3] Add a comment --- tools/installpsh-osx.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/installpsh-osx.sh b/tools/installpsh-osx.sh index 51ca98e201b..8576dfbb671 100755 --- a/tools/installpsh-osx.sh +++ b/tools/installpsh-osx.sh @@ -138,6 +138,7 @@ for count in {1..2}; do fi # The update failed for the first try. An error we see a lot in our CI is "RPC failed; curl 56 SSLRead() return error -36". + # What 'brew update' does is to fetch the newest version of Homebrew from GitHub using git, and the error comes from git. # A potential solution is to increase the Git buffer size to a larger number, say 150 mb. The default buffer size is 1 mb. echo "First attempt of update failed. Increase Git buffer size and try again ..." git config --global http.postBuffer 157286400