TeamCity build agent disconnected

前端 未结 7 1615
无人及你
无人及你 2021-02-03 19:16

I installed a build agent on Windows 7 and always have the agent show up as \"disconnected\". The log teamcity-agent.txt shows below information

 If this is the          


        
相关标签:
7条回答
  • 2021-02-03 19:48

    First, make sure in the TeamCity website dashboard to authorize the agent if you haven't done so already.

    Next, make sure the agents "ownPort" is not blocked by a firewall on the agent. This is the port that TeamCity will use to send messages to the agent. The value can be defined in "${agent.home}/conf/buildAgent.properties".

    As of TeamCity 2017.2.1, the "ownPort" is not present, nor is there any embedded documentation (i.e. commented out examples). The default value is 8080, but you can just add the property and value you want like this:

    ## Defines which port the agent will use to receive messages from TeamCity.
    ## Defaults to 8080 if not present.
    ownPort=9091
    
    0 讨论(0)
  • 2021-02-03 19:50

    In my case the agent was started but listed as disconnected, after waiting several minutes it was still disconnect. So I went to the bin directory on the build agent like Peter suggested and ran the following two commands

    ./agent.sh stop
    ./agent.sh start
    

    essentially just restarting the build agent. That did the trick for me.

    0 讨论(0)
  • 2021-02-03 19:50

    Starting the TeamCity Agent manually in the Services panel resolved the issue for me (on a Windows machine).

    Problem was indicated in the upgrade.log (in BuildAgent\logs directory):

    ERROR - r.agent.upgrade.UpgradeRunBase - Failed to start agent after upgrade: java.io.IOException: Failed to start TeamCity build agent service. Please check TeamCity build agent service user have enough permissions to stop and start the service. 
    
    0 讨论(0)
  • 2021-02-03 19:50

    I ran into this problem when working remotely over VPN and my IP address changed. In the conf/buildAgent.properties file, I changed my assigned IP for the serverURL property to use localhost instead, and the agent connected right up.

    ## The address of the TeamCity server. The same as is used to open 
    TeamCity web interface in the browser.
    #serverUrl=http://111.222.333.444:8111
    serverUrl=http://localhost:8111
    
    0 讨论(0)
  • 2021-02-03 19:56

    Here is a very comprehensive blog on re-connecting disconnected agents

    http://michaelbarnesjr.wordpress.com/2012/10/18/teamcity-build-agent-disconnected/

    Here are the steps (copied from the above link)

    If an agent becomes disconnected for whatever reason, you can follow these steps to re-connect it:

    • ssh to the server that the disconnected agent is on.
    • go to the build agent’s bin directory (i.e. /opt/teamcity/buildagent/buildagent01/bin/)
    • su to the user that the agent runs as (i.e. appBuilder)
    • run agent.sh start

    That will start the agent, and after a few seconds or so, the next time you go to TeamCity, it will be connected.

    If Team City is running on a windows server, you can connect to that server, go to Services and restart the build agent that has become disconnected. Team City

    0 讨论(0)
  • 2021-02-03 19:56

    In my case under Windows 8 Professional:

    TC build agent upgrade failed

    1. I checked out BuildAgent\logs\teamcity-agent.log, there was trouble with the "upgrade process".

    2. I checked out BuildAgent\logs\upgrade.log, there were more detailed "DEBUG" messages. The problem was "access denied" on shutting down service.

    3. I added the user account of the TC server service to "Administrators" to let it stop the agent service.

    4. I removed the user account of the TC server service from "Administrators" user group.

    5. Restarting both service (TC server + Agent) led finally to have:

      BuildAgent\logs\buildAgent.port
      

      file: the agent was finally connected after successfull.

    0 讨论(0)
提交回复
热议问题