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

MacOS: group 'wait docker running' SOMETIMES fails due to timeout #34

Open
marcopaglio opened this issue Oct 24, 2023 · 0 comments
Open

Comments

@marcopaglio
Copy link

marcopaglio commented Oct 24, 2023

I'm using docker-practice/actions-setup-docker@master on macos-12.

Sometimes the actions fails with error: Error: The process '/usr/bin/sudo' failed with exit code 1 during the execution of wait docker running group for timing out as follows (I removed intermediate output because it is repetitive):

wait docker running
  /usr/bin/sudo bash -c 
  set -x
  command -v docker || echo 'test docker command 1: not found'
  i=0
  while ! /Applications/Docker.app/Contents/Resources/bin/docker system info &>/dev/null; do
  (( i++ == 0 )) && printf %s '-- Waiting for Docker to finish starting up...' || printf '.'
  command -v docker || echo 'test docker command loop: not found'
  sleep 1
  # wait 180s(3min)
  if [ $i -gt 180 ];then exit 1;sudo /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check;uname -a;system_profiler SPHardwareDataType;echo "::error::-- Wait docker start $i s too long, exit"; exit 1; fi
  done
  echo "::notice::-- Docker is ready.Wait time is $i s"
  uname -a || true
  system_profiler SPHardwareDataType || true
  
  + command -v docker
  + echo 'test docker command 1: not found'
  + i=0
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  test docker command 1: not found
  + ((  i++ == 0  ))
  + printf %s '-- Waiting for Docker to finish starting up...'
  + command -v docker
  -- Waiting for Docker to finish starting up...+ echo 'test docker command loop: not found'
  + sleep 1
  test docker command loop: not found
  + '[' 1 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  ./usr/local/bin/docker
  + sleep 1
  + '[' 2 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  ./usr/local/bin/docker
  + sleep 1
  + '[' 3 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  + sleep 1
  ./usr/local/bin/docker
  + '[' 4 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  + sleep 1
  ./usr/local/bin/docker
  + '[' 5 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  ./usr/local/bin/docker
  + sleep 1
  + '[' 6 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  ./usr/local/bin/docker
  
 [... same output here ...]

  + sleep 1
  + '[' 177 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  ./usr/local/bin/docker
  + sleep 1
  + '[' 178 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  .+ command -v docker
  + sleep 1
  /usr/local/bin/docker
  + '[' 179 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  ./usr/local/bin/docker
  + sleep 1
  + '[' 180 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  ./usr/local/bin/docker
  + sleep 1
  + '[' 181 -gt 180 ']'
  + exit 1
  Error: Error: The process '/usr/bin/sudo' failed with exit code 1

Then, if I try to re-run the job, it might pass. Below is the output of the same failed job when it is run again and succeeds:

wait docker running
  /usr/bin/sudo bash -c 
  set -x
  command -v docker || echo 'test docker command 1: not found'
  i=0
  while ! /Applications/Docker.app/Contents/Resources/bin/docker system info &>/dev/null; do
  (( i++ == 0 )) && printf %s '-- Waiting for Docker to finish starting up...' || printf '.'
  command -v docker || echo 'test docker command loop: not found'
  sleep 1
  # wait 180s(3min)
  if [ $i -gt 180 ];then exit 1;sudo /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check;uname -a;system_profiler SPHardwareDataType;echo "::error::-- Wait docker start $i s too long, exit"; exit 1; fi
  done
  echo "::notice::-- Docker is ready.Wait time is $i s"
  uname -a || true
  system_profiler SPHardwareDataType || true
  
  + command -v docker
  + echo 'test docker command 1: not found'
  test docker command 1: not found
  + i=0
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf %s '-- Waiting for Docker to finish starting up...'
  + command -v docker
  + echo 'test docker command loop: not found'
  + sleep 1
  -- Waiting for Docker to finish starting up...test docker command loop: not found
  + '[' 1 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  .+ command -v docker
  + sleep 1
  /usr/local/bin/docker
  + '[' 2 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker

  [... same output here ...]

  + sleep 1
  + '[' 154 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  ./usr/local/bin/docker
  + sleep 1
  + '[' 155 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + ((  i++ == 0  ))
  + printf .
  + command -v docker
  + sleep 1
  ./usr/local/bin/docker
  + '[' 156 -gt 180 ']'
  + /Applications/Docker.app/Contents/Resources/bin/docker system info
  + echo '::notice::-- Docker is ready.Wait time is 156 s'

As you notice, it succeeds after more than 150 seconds of the 180 seconds available before it is considered a failure. I think the problem is probably the value. Could you consider increasing the timeout time or replacing the hard-coded value with a custom definable value (not required and with 180 seconds by default, of course)?

I notice the issue #24 referrring to the same error, but I prefer to create another one because the title was misleading
for other who will face it.
If there are others details to share for resolving this issue, please let me know.

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

No branches or pull requests

1 participant