Doron Yaacoby
Doron Yaacoby

Reputation: 9760

Teamcity Max OS X Agent - Incompatible runner: Command Line

I am running TeamCity 7.1.3 (yeah, I know it's an oldie). I have a Mac OS X Yosemite build agent. I started the agent in the recommended way, sh bin/agent.sh start.

My build configuration contains one command line build step, but it can't run, because I get the following message on my agent:

Incompatible runner: Command line

I think it is a permission issue, because if I start the agent with sudo sh bin/agent.sh start it works. I don't want to run it with sudo though. Is there a permission I can give my agent account to make this work?

Update: it seems "chmod 777" on the buildAgent folder solved the problem. Of course, it is not the most secure idea. Would be happy to know the lowest permissions I need to apply.

Upvotes: 2

Views: 1297

Answers (2)

NorseGaud
NorseGaud

Reputation: 771

First, check buildAgent/logs/teamcity-agent.log and look for failures (your path may differ).

My problem was that my name was too long and it couldn't register the agent:

[2024-01-11 11:07:19,462]   INFO - buildServer.AGENT.registration - Registering on server via URL "http://anka.teamcity:8094": AgentDetails{Name='mgmtManaged-14.2-arm64-openjdk-11.0.14.1-teamcity-s-Mac-mini.local-1704999437815861000', AgentId=null, BuildId=null, AgentOwnAddress='null', AlternativeAddresses=[], Port=9090, Version='147412', PluginsVersion='NA', AvailableRunners=[], AvailableVcs=[], AuthorizationToken='', PingCode='LsmHy5Qt8GvZo40k16FjyAQ4FAIaetp6'}
[2024-01-11 11:07:19,469]   INFO - buildServer.AGENT.registration - Server supports the following communication protocols: [polling]
[2024-01-11 11:07:19,469]   INFO - buildServer.AGENT.registration - Trying to register on server using 'polling' protocol.
[2024-01-11 11:07:19,488]   INFO - buildServer.AGENT.registration - Registration using 'polling' protocol failed: TeamCityRuntimeException: Agent name is too long, the maximum allowed length is: 80
[2024-01-11 11:07:19,488]   WARN - buildServer.AGENT.registration - Error registering on the server via URL http://anka.teamcity:8094. Will continue repeating connection attempts.

After editing my buildAgent/conf/buildAgent.properties and shortening name=, it registered and worked.

Upvotes: 0

danieljimenez
danieljimenez

Reputation: 1430

When you installed the agent, did you use the Mac setup script in the agent's bin directory? I believe it's called mac.launchd.sh. You can't run it via remote terminal or Apple's Remote Desktop or you'll have issues. From the machine (or via VNC) login as the user you want to run TeamCity and run that script from Terminal. Then the agent will start on user login, and will properly upgrade itself when you finally get to upgrading to the latest TeamCity.

My experience with Mac OS X TeamCity agents improved greatly when I stopped trying to run it in the background as a 'daemon' (launchd's term for a boot service) similar to Linux, and instead ran it as an 'agent' (on login service). Typically on a Mac OS build agent you'll want auto login enabled for bits of Xcode to work correctly. Then you just lock it with a screen saver.

Upvotes: 2

Related Questions