0
votes

I've done quite some research, to find other people with similar problems, but the closest I came to was people who were using TeamCity on just platform (either Mac OS X or Windows) and thus could afford to use the full path to p4 (e.g. /usr/local/bin/p4 or C:\Program Files (x86\Perforce\p4.exe).

However, my server runs on Mac OS X and I have agents on both OSX and Windows 8. So here is where my problem starts.

When running my Team City under the normal user account, let's call him 'joe', via launchctl, there is a VCS problem.

Failed to collect changes, error: Unable to find P4 command-line client at path 'p4' on joe-his-computer for user joe

Note that p4 is the path to my p4 executable in all my build configuration VCS settings. (the default)

Another gotcha is that I use my VCS as agent-checkout rather then server-checkout.

When I'm running my server not as a daemon and instead login as 'joe' via ssh and start it via <TeamCity Server Data Dir>/bin/teamcity-server.sh then there isn't a problem and he can access p4 on both my server and agents.

This frustrates me a lot as I can't seem to find why it would have this problem. Another thing I tried is to define the path in my build configurations as %env.P4PATH and make sure that all my agents have the full path to perforce (even though that is ridiculous as it's clearly my server having problems and not my agents).

Sadly that doesn't work either as %env.P4PATH isn't defined on my server.

For now I'm just using my TeamCity server via the only way I know it works, but I would really like to run it as a daemon (launchagent) as it would make sure my server is always active even after a power let out.

If you need more details in order to help me, let me know.

EDIT: After starting my TeamCity manually again I discovered that my OS X build agent has the same issue. That agent is running on the same OS X computer as the server and is also started via launchctl.

The error message of that agent says:

Failed to perform checkout on agent: Unable to find P4 command-line client at path 'p4' on joe-his-computer for user joe
1
To mark the question as solved, you can post your solution as an answer instead of in the question body, then "accept" it by clicking on the green tick.GS - Apologise to Monica

1 Answers

1
votes

Thanks to a colleague I found the issue. On that specific machine, p4 was in /usr/local/bin but /usr/local/bin wasn't in my PATH. By moving p4 to /usr/bin I resolved the issue for both my OSX Agent and OSX Server.