Agent cannot connect to Server when installed via docker image on a Synology NAS

Answered

I have recently installed both the Team City Server and a Team City Agent, on my personal Synology NAS, via a docker image. The docker container on the Synology software didn't allow for installing via a command line. Instead it had a install wizard instead, where you could add environment variables. Therefore, I have added the SERVER_URL, that way and can confirm that the agent is finding the url for the server. However, when attempting to setup the agent, I am getting a java.net.ConnectException, when the agent attempts to cal <url>/app/agents/protocols. There's no real explanation beyond that, and the stack just states enable debug for the full stack trace. 

Has anyone else, installed team city and an agent successfully on their Synology NAS this way and got this error, then resolved it? Also how would I enable debug for this?

Any help would be greatfully appreciated.

Full error message

[2023-03-14 00:00:58,440]   WARN - buildServer.AGENT.registration - Error while asking server for the communication protocols via URL https://<SERVER_URL>:<Port Number>/app/agents/protocols. Will try later: java.net.ConnectException: Connection refused (Connection refused) (enable debug to see stacktrace)

0
4 comments
This message means that the severance isn't available. In other words, most likely, the container simply doesn't have access to the outside hosts on the network. You might need additional configuration when starting a container, for example, starting it with the `--network=host` argument. See more info in the Docker documentation: https://docs.docker.com/engine/reference/run/#network-settings
1
Hi Nick! The java.net.ConnectException error indicates that there is a connectivity issue. To troubleshoot it, you can try logging into the agent container and checking if you can connect to the server URL you specified via the environment variable, e.g. with `curl -i https://:/`. This command should give you the HTTP 401 code unless you provide valid credentials (but even if you don't provide them, it should be enough to test the connectivity). Once you make sure you can connect to the server URL manually from inside the docker container, the agent should be able to do so as well.
0

Hi Anatoly, I think I get what you mean and I've given it a try. Unfortunately I did not recieve a 401 error. Instead I just get : "Failed to connect to X: conection refused".

 

 

Does this look as you expected? You mention passing credentials: How do I go about doing that?

0

Hi Anatoly, apologies for my slow reply to this. I've only just got chance to rerun through this in my spare time. I can confirm that, moving the network to host and away from the bridge version, fixed the problem. Thank you very much, for your help.

0

Please sign in to leave a comment.