Build agent appears disconnected...
I have a local TortoiseSVN repository which I am building using a local TeamCity buildserver session. When I set up the properties for the buildserver I indicated as the local port for my computer Port:9090. Now as I attempt to execute the runner it complains about "No enabled compatible agents for this build". Under Compatible Agents it shows that my local machine is disconnected. Therefore I think Port:9090 is busy. How can I change the port number to something that works?
Thanks.
Please sign in to leave a comment.
Hi,
If I understood you properly, you configured the server to use port 9090, while the agent uses the same port by default. You can simply change any of the two.
Changing the port for the server is described here: https://confluence.jetbrains.com/display/TCD10/Installing+and+Configuring+the+TeamCity+Server#InstallingandConfiguringtheTeamCityServer-ChangingServerPort
Changing it for the agent here (Optional properties): https://confluence.jetbrains.com/display/TCD10/Build+Agent+Configuration
Hope this helps.
Hi Dennis thanks for your response. I would like to follow the second option (changing the port for the agent). I saw on your link that the agent properties are contained within the <TeamCityHome>\buildAgent\conf\buildAgent.properties file. I went to this file and changed the ownPort field to a different port
ownPort = 1110
I then saved the file and run my localhost again, but it still shows the agent under port 9090 and it is disconnected. I then checked the log files:
[2017-08-01 08:56:45,705] FileTaskSettings [Info] Parsing service settings
[2017-08-01 08:56:45,705] FileTaskSettings [Info] Program to execute: C:\WINDOWS\system32\cmd.exe
[2017-08-01 08:56:45,705] FileTaskSettings [Info] Program arguments: /c teamcity-server.bat run service
[2017-08-01 08:56:45,705] FileTaskSettings [Info] Program work dir: D:\TeamCity\bin
[2017-08-01 08:56:45,705] FileTaskSettings [Info] Program stop timeout: 900000
[2017-08-01 08:56:45,705] CreateServiceSettingsAction [Info] Service log file is set to: D:\TeamCity\logs\teamcity-winservice.log
[2017-08-01 08:56:45,705] CreateServiceSettingsAction [Info] Installing service under aboufira (domain=DIRECTORY) account
[2017-08-01 08:56:45,757] LogonUserCommand [Error] Failed to Logon user DIRECTORY\aboufira. Logon failure: the user has not been granted the requested logon type at this computer. (1385)
[2017-08-01 08:56:45,757] LSAPolicyCommand [Error] Failed to open LSAPolicy with Change privileges right.. Error code -1073741790
[2017-08-01 08:56:45,757] CheckAndGrantLogOnAsServiceComma [Info] Failed to give user enough rights to run as server
[2017-08-01 08:56:45,758] CreateServiceCheckAccountAction [Info] Failed to give user enough rights to run as server
[2017-08-01 08:56:45,758] CreateServiceCheckAccountAction [Info] Give user enough rights or add '/giveUserRights=false' commandline argument
[2017-08-01 08:56:50,476] FileTaskSettings [Info] Parsing service settings
[2017-08-01 08:56:50,476] FileTaskSettings [Info] Program to execute: C:\WINDOWS\system32\cmd.exe
[2017-08-01 08:56:50,476] FileTaskSettings [Info] Program arguments: /c teamcity-server.bat run service
[2017-08-01 08:56:50,476] FileTaskSettings [Info] Program work dir: D:\TeamCity\bin
[2017-08-01 08:56:50,476] FileTaskSettings [Info] Program stop timeout: 900000
[2017-08-01 08:56:50,476] CreateServiceSettingsAction [Info] Service log file is set to: D:\TeamCity\logs\teamcity-winservice.log
[2017-08-01 08:56:50,476] CreateServiceSettingsAction [Info] Installing service unser LOCAL_SYSTEM account
[2017-08-01 08:56:50,477] ServiceControlManagerCommand [Error] Failed to open Service Control Manager with Create service permissions. Not enough rights
It appears I don't have enough rights. Is administrator privilege required to run local servers with TeamCity?
No, it doesn't require admin rights, but a number of ports are usually restricted for non-admin applications.
This said, this error message doesn't seem to relate to the agent start, but to the agent installation process, it couldn't be installed as a service, probably because the user wasn't an admin. If you check the date, it comes from August 1st, not recently. If you want to check for current errors, please try running the agent, then checking the teamcity-agent.log file from the logs folder. If you can't find relevant information, please send it to us via the "Submit a request" button on top of this page to see whether we can help with that.
I ended up fixing this by actually re-running the Agent.bat file in the TeamCity\buildAgent\bin directory. Then the agent was successfully connected and the localhost webpage was synchronized.