ravsamhq / notify-slack-action

🔔 Send a Slack Notification from Github Actions regarding failure, warnings, or even success.
https://ravsam.in/blog/send-slack-notification-when-github-actions-fails/
MIT License
173 stars 57 forks source link

randomly the pre-action docker build fails #56

Closed kwavnet closed 2 years ago

kwavnet commented 2 years ago

Once in a while Build ravsamhq/notify-slack-action@v1 fails with the following

  /usr/bin/docker build -t 5eae13:03b041c796e34d099842964119063d7c -f "/path/actions-runner/_actions/ravsamhq/notify-slack-action/v1/Dockerfile" "/path/actions-runner/_actions/ravsamhq/notify-slack-action/v1"
  #1 [internal] load build definition from Dockerfile
  #1 sha256:76500476c126f4b5da5ec50421f6358c73853c0dbe71984004e53b6c61712ad7
  #1 transferring dockerfile: 38B done
  #1 DONE 0.0s

  #2 [internal] load .dockerignore
  #2 sha256:b78347fbd62912480d9947bb0aeef597af6c1ea1d2cd959bdcca6fed7f3e9e50
  #2 transferring context: 2B done
  #2 DONE 0.0s

  #4 [internal] load metadata for public.ecr.aws/docker/library/python:3-slim
  #4 sha256:88f83c7105d19eeb7cd4d26d9ce011e2df8ab9dd0dad2e9ce84771f012f3b2e0
  #4 ERROR: unexpected status code [manifests 3-slim]: 400 Bad Request

  #3 [internal] load metadata for gcr.io/distroless/python3-debian10:latest
  #3 sha256:847d648b5ae1c07de239ad1cf534dcbbc90f051f65da51ccb91ed47a5bce342c
  #3 CANCELED
  ------
   > [internal] load metadata for public.ecr.aws/docker/library/python:3-slim:
  ------
  failed to solve with frontend dockerfile.v0: failed to create LLB definition: unexpected status code [manifests 3-slim]: 400 Bad Request
  Warning: Docker build failed with exit code 1, back off 7.569 seconds before retry.
  /usr/bin/docker build -t 5eae13:03b041c796e34d099842964119063d7c -f "/path/actions-runner/_actions/ravsamhq/notify-slack-action/v1/Dockerfile" "/path/actions-runner/_actions/ravsamhq/notify-slack-action/v1"
  #1 [internal] load build definition from Dockerfile
  #1 sha256:d08f37c7dc52a4acce3f973a8fc7e2cd213ce57277830df51bc2006e3e390f0b
  #1 transferring dockerfile: 38B done
  #1 DONE 0.0s

  #2 [internal] load .dockerignore
  #2 sha256:cd044e6bb5820c413cbbf9ac9ce721aba7162651f3994d5eecaabcd0413ba007
  #2 transferring context: 2B done
  #2 DONE 0.0s

  #4 [internal] load metadata for public.ecr.aws/docker/library/python:3-slim
  #4 sha256:88f83c7105d19eeb7cd4d26d9ce011e2df8ab9dd0dad2e9ce84771f012f3b2e0
  #4 ERROR: unexpected status code [manifests 3-slim]: 400 Bad Request

  #3 [internal] load metadata for gcr.io/distroless/python3-debian10:latest
  #3 sha256:847d648b5ae1c07de239ad1cf534dcbbc90f051f65da51ccb91ed47a5bce342c
  #3 CANCELED
  ------
   > [internal] load metadata for public.ecr.aws/docker/library/python:3-slim:
  ------
  failed to solve with frontend dockerfile.v0: failed to create LLB definition: unexpected status code [manifests 3-slim]: 400 Bad Request
  Warning: Docker build failed with exit code 1, back off 2.354 seconds before retry.

Is there any way (like back off and retry) to work around this temporary issue (seems to be a network issue)

ravsam-bot[bot] commented 2 years ago

Hello and welcome to RavSam :purple_heart:. Thanks for opening your first issue. I will assign one of our team members to take a look at the problem you have raised. Make sure to include as much information as possible to help our team diagnose the issue and solve it quickly.

If the problem is related to a security concern, then please delete this issue and send us an email at info@ravsam.in.

kwavnet commented 2 years ago

I had a deeper look into this issue and it seems to be a "local docker daemon" issue without a proper fix so far. Currently we are firing hundreds of pipelines using this action and each of them builds a fresh container - would it an option to use a pre-made and pre-published container for this action, which is pulled once on a runner and then make use of the local container caching?

ravgeetdhillon commented 2 years ago

@witekio-kwe To get rid of the slow build speeds of Docker, we have released v2 which is written in Typescript. See this comment for more information.

kwavnet commented 2 years ago

@ravgeetdhillon will give it a try - thanks a lot