buildkite-plugins / docker-compose-buildkite-plugin

🐳⚡️ Run build scripts, and build + push images, w/ Docker Compose
MIT License
171 stars 138 forks source link

pre-checkout hook failed to run because it was already open #434

Closed MathisWellmann closed 4 months ago

MathisWellmann commented 4 months ago

I'm trying to use this plugin in my pipeline as such:

steps:
  - label: ":docker: :rust: build"
    command: RUSTFLAGS="-D warnings" cargo build
    plugins:
      - docker-compose#v3.0.3:
          run: node
    agents:
      queue: nixos

Which is executed by the agent on a nixos host, which successfully runs all my other pipelines, but this setup fails to run with the following message.

$ /var/buildkite/plugins/github-com-buildkite-plugins-docker-compose-buildkite-plugin-v3-0-3/hooks/pre-checkout
🚨 Error: The plugin docker-compose pre-checkout hook failed to run because it was already open. We couldn't find out what process had the hook open
🚨 Error: error running "/tmp/buildkite-agent-bootstrap-hook-runner-1100140013": fork/exec /tmp/buildkite-agent-bootstrap-hook-runner-1100140013: no such file or directory

What could cause this failure?

tomowatt commented 4 months ago

Hey @MathisWellmann

We have recently became aware of this as an issue that's more related to the obscure error messages from the Agent than the Plugin itself.

The Plugin hooks themselves are run as scripts and the shebang used for the scripts in the Docker Compose plugin is #!/bin/bash. As you are using NixOS I believe the path to bash is different and results in the errors you are seeing.

This error being seen is raised from the Agent here: https://github.com/buildkite/agent/blob/81a3b1402613c527c1671e7ad6c15b2b96f03c2c/internal/job/executor.go#L399-L423

As our Agent repository is Public, coud I ask you to raise the issue here for increased visibility? https://github.com/buildkite/agent/issues

MathisWellmann commented 4 months ago

Thanks for the useful response. Will open an issue in the other repo as well. I believe I can come up with a solution knowing this :+1: Feel free to close this Issue here as its more related to the buildkite-agent.

tomowatt commented 4 months ago

Thank you very much, if there is anything else we can do let us know! 🙇