gocd: Mac Agent has an incorrect PATH variable values.

PATH variable for job executed by agent does not contain the same PATH values that actual go agent user has. So for example user’s values are:

gocdagent$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin

while when job executed values are:

[Debug Information] Environment variable PATH: /usr/bin:/bin:/usr/sbin:/sbin

There was no explicitly defined redefinition of PATH variable anywhere in go.cd configuration on my side. Is it expected behavior? Where and how it could be reconfigured to include /usr/local/bin as well?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (6 by maintainers)

Commits related to this issue

Most upvoted comments

Have you tried this? Mac apps don’t have the ability to control PATH, unfortunately. So, it’ll need to be overridden as mentioned in the link. That should work.

It seems that the bug still exists for 16.2.1.

I ran into the similar issue that the PATH was not set correctly when I launched Go Agent from Launchpad. But it was fine if I ran the agent from terminal by

cd /Applications/Go\ Agent.app/Contents/MacOS
./go-agent