Bamboo Specs scan fails with java.io.IOException: No such file or directory
問題
The Bamboo Specs scan fails when Processing Specs within Docker container and after clicking View Error Log the below is present in the log:
16-Oct-2019 06:32:54 Unable to scan repository REPO (1111111) for Bamboo Specs
16-Oct-2019 06:32:54 com.atlassian.bamboo.repository.RepositoryException: Unable to scan repository REPO (1111111) for Bamboo Specs
16-Oct-2019 06:32:54 at com.atlassian.bamboo.configuration.external.RepositoryStoredSpecsServiceImpl.lambda$runSpecsWithDocker$9(RepositoryStoredSpecsServiceImpl.java:924)
16-Oct-2019 06:32:54 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
16-Oct-2019 06:32:54 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
16-Oct-2019 06:32:54 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
16-Oct-2019 06:32:54 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)
16-Oct-2019 06:32:54 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)
16-Oct-2019 06:32:54 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)
16-Oct-2019 06:32:54 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)
16-Oct-2019 06:32:54 at java.lang.Thread.run(Thread.java:748)
16-Oct-2019 06:32:54 Caused by: com.spotify.docker.client.exceptions.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException: No such file or directory
診断
環境
Bamboo administration > Security Settings > Process Bamboo Specs in Docker is enabled
原因
There can be a number of reasons:
- Docker is not installed on the Bamboo Server
- Docker is not started on the Bamboo Server
回避策
Processing Bamboo Specs in a Docker container is a security feature as it isolates the environment in which the Java code which is in a Bamboo Spec is executed. This is an added layer of security and should only be disabled as a workaround if you understand the risk and trust Bamboo Spec code being committed to your repositories.
Disable Bamboo administration > Security Settings > Process Bamboo Specs in Docker
ソリューション
Docker is not installed on the Bamboo Server
Docker only needs to be installed on the Bamboo Server for Bamboo Specs processing within Docker to work. It does not need to be installed on agents for this purpose.
- Install Docker on the Bamboo Server: https://docs.docker.com/install/
- Ensure that the user that you use to run Bamboo is a member of the
docker
group: https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user - Ensure the path to Docker is correctly defined at Bamboo Administration >> Server Capabilities
Docker is not started on the Bamboo Server
Start the Docker daemon: https://docs.docker.com/config/daemon/systemd/