Bamboo: Cannot run program "/bin/go", Permission denied
Asked by Vadim Raksha:

Also, I tried run like:

```
sudo bin/start-bamboo.sh
```

When I run build, I have exception:

(Debian 9)

```
2018-07-21 19:25:23,735 INFO [18-BAM::Default Agent::Agent:pool-32-thread-1] [TaskResultBuilder] Process exception: 

com.atlassian.utils.process.ProcessNotStartedException: /bin/go could not be started

 at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:342)

 at com.atlassian.utils.process.ExternalProcessImpl.execute(ExternalProcessImpl.java:113)

 at com.handcraftedbits.bamboo.plugin.go.task.common.ProcessHelper.executeProcess(ProcessHelper.java:95)

 at com.handcraftedbits.bamboo.plugin.go.task.common.ProcessHelper.executeProcess(ProcessHelper.java:60)

 at com.handcraftedbits.bamboo.plugin.go.task.build.GoBuildTaskType.execute(GoBuildTaskType.java:62)

 at com.atlassian.bamboo.task.TaskExecutorImpl.lambda$executeTasks$2(TaskExecutorImpl.java:286)

 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTaskWithPrePostActions(TaskExecutorImpl.java:221)

 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:286)

 at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:110)

 at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:71)

 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.executeBuildPhase(DefaultBuildAgent.java:203)

 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:175)

 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.lambda$waitAndPerformBuild$0(BuildAgentControllerImpl.java:122)

 at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:185)

 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:117)

 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:126)

 at com.atlassian.bamboo.utils.BambooRunnables$1.run(BambooRunnables.java:48)

 at com.atlassian.bamboo.security.ImpersonationHelper.runWith(ImpersonationHelper.java:26)

 at com.atlassian.bamboo.security.ImpersonationHelper.runWithSystemAuthority(ImpersonationHelper.java:17)

 at com.atlassian.bamboo.security.ImpersonationHelper$1.run(ImpersonationHelper.java:41)

 at java.lang.Thread.run(Thread.java:748)

Caused by: java.io.IOException: Cannot run program "/bin/go" (in directory "/root/bamboo/xml-data/build-dir/FBACKEND-MAIN-JOB1/src/FBackend"): error=13, Permission denied

 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

 at com.atlassian.utils.process.ExternalProcessImpl.createDefaultProcess(ExternalProcessImpl.java:377)

 at com.atlassian.utils.process.ExternalProcessImpl.createProcess(ExternalProcessImpl.java:385)

 at com.atlassian.utils.process.ExternalProcessImpl.start(ExternalProcessImpl.java:339)

 ... 20 more

Caused by: java.io.IOException: error=13, Permission denied

 at java.lang.UNIXProcess.forkAndExec(Native Method)

 at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)

 at java.lang.ProcessImpl.start(ProcessImpl.java:134)

 at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

 ... 23 more
```


Answers:
author: Chris Johnston
body: builds are run as the user configured to run the bamboo service (or whichever account started bamboo if you are not running it as a background service)

Figure out what user ID the bamboo process is owned by, and then make sure that same process id has permissions to execute whatever script/binary you are trying to use in a build plan -- in your example /bin/go.

If need be, fix the permissions on /bin/go so that they can be executed by the appropriate user.


author: Foong
body: Try running the following command in the directory "**/root/bamboo/xml-data/build-dir/FBACKEND-MAIN-JOB1/src/FBackend**"

```
sudo?/bin/go
```