Docker Swarm Teamcity Agent not found

Hi, folks, I have a Docker Swarm(mode) Cluster and wanted to use Teamcity as a ci pipeline. The problem is: Teamcity can't find any agent.
Here is the log file of the agent-container: 
[2023-07-20 21:35:36,584]   WARN - buildServer.AGENT.registration - 
            Error while asking server for the communication protocols via URL http://"teamcity"/app/agents/protocols. Will try later: java.lang.IllegalArgumentException: 
              Invalid uri 'http://"teamcity"/app/agents/protocols': Invalid authority (enable debug to see stacktrace)
and here is my stack-config: 
----------------------------
services:
  teamcity:
    image: jetbrains/teamcity-server
    volumes:
      - tc_data:/data/teamcity_server/datadir
    - tc_logs:/opt/teamcity/logs
    deploy:
      placement:
        constraints:
          - node.labels.dbs==true
      labels:
        - traefik.enable=true
        - traefik.docker.network=traefik-public
        - traefik.constraint-label=traefik-public
        - traefik.http.routers.teamcity-http.rule=Host(`tc.xxxxxxxxxx.com`)
        - traefik.http.routers.teamcity-http.entrypoints=http
        - traefik.http.routers.teamcity-http.middlewares=https-redirect
        - traefik.http.routers.teamcity-https.rule=Host(`tc.xxxxxxxxxx.com`)
        - traefik.http.routers.teamcity-https.entrypoints=https
        - traefik.http.routers.teamcity-https.tls=true
        - traefik.http.routers.teamcity-https.tls.certresolver=le
        - traefik.http.services.teamcity.loadbalancer.server.port=8111
    networks:
      - traefik-public
      - tc-net

  tc_agent:
    image: jetbrains/teamcity-agent
    deploy:
      placement:
        constraints:
          - node.labels.dbs==true
    environment:
      - SERVER_URL="http://teamcity:8111"
    volumes:
      - tc_agent:/data/teamcity_agent/conf
    networks:
      - tc-net

networks:
  traefik-public:
    external: true
  tc-net:
    external: false


volumes:
  tc_data:
  tc_logs:
  tc_agent:
0
1 comment

Hi! Please try specifying the value of the SERVER_URL variable without quotes: 
- SERVER_URL=http://teamcity:8111

0

Please sign in to leave a comment.