ovh/cds

Hatchery/swarm, error raised for TCP CDN access

b2p-fred opened this issue · 4 comments

In the swarm hatchery log, an error is raised because no configuration exists in the CDN microservice for a TCP connection:

2021-11-12 10:25:00 [INFO] hatchery> swarm> connecting to sample-docker-engine: tcp://dockerhost:2375 caller=github.com/ovh/cds/engine/hatchery/swarm.(*HatcherySwarm).InitHatchery service=hatchery:swarm source_file=/tmp/790ad7b9a1a85167593986ed564384b7/run/engine/hatchery/swarm/swarm.go source_line=67
2021-11-12T10:25:00.024854549Z 2021-11-12 10:25:00 [INFO] hatchery> swarm> connected to sample-docker-engine (tcp://dockerhost:2375) caller=github.com/ovh/cds/engine/hatchery/swarm.(*HatcherySwarm).InitHatchery service=hatchery:swarm source_file=/tmp/790ad7b9a1a85167593986ed564384b7/run/engine/hatchery/swarm/swarm.go source_line=163
2021-11-12T10:25:00.039597786Z 2021-11-12 10:25:00 [ERROR] Hatchery> swarm> Cannot get cdn configuration : resource not found (from: unable to find any tcp configuration in CDN Uservice, request_id: 62bdfbf2-fe4b-4e23-879f-c685c8b65478) caller=github.com/ovh/cds/engine/hatchery/swarm.(*HatcherySwarm).InitHatchery service=hatchery:swarm source_file=/tmp/790ad7b9a1a85167593986ed564384b7/run/engine/hatchery/swarm/swarm.go source_line=178
2021-11-12T10:25:00.051371437Z 2021-11-12 10:25:00 [INFO] cds-hatchery-swarm-stoic_and_romantic_mclaren> Starting service cds-hatchery-swarm-stoic_and_romantic_mclaren (0.49.0+cds.16178)... caller=github.com/ovh/cds/engine/hatchery.(*Common).CommonServe service=hatchery:swarm source_file=/tmp/790ad7b9a1a85167593986ed564384b7/run/engine/hatchery/serve.go source_line=55
2021-11-12T10:25:00.052255493Z 2021-11-12 10:25:00 [INFO] cds-hatchery-swarm-stoic_and_romantic_mclaren> Starting HTTP Server on port 8086 caller=github.com/ovh/cds/engine/hatchery.(*Common).CommonServe service=hatchery:swarm source_file=/tmp/790ad7b9a1a85167593986ed564384b7/run/engine/hatchery/serve.go source_line=80
2021-11-12T10:25:10.053311144Z 

but when I check in my configuration file, I have:

[cdn]
  # Private URL for communication with API
  URL = "http://localhost:8089"
  # Name of this CDS CDN Service
  # Enter a name to enable this service
  name = "cds-cdn"
  # Public address to access to CDN HTTP server
  publicHTTP = "http://localhost:8089"
  # Public address to access to CDN TCP server
  publicTCP = "172.17.0.1:8090"
  # Enable TLS on public address to access to CDN TCP server
  publicTCPEnableTLS = false

Perharps something to deal with public_tcp compared with publicTCP ?

@b2p-fred did you get this resolved? I'm seeing the same error.

No. For me this project looks dead ... where as I found it a very good solution :(

ok I got the whole stuff working.
CDN service was not starting properly. that's why hatchery was not able to connect.
best way to debug this is to start api , ui , vcs, repositories, hatchery all separately one after the other.
look at the logs for each individual service and resolve them. in my case CDN was not started because it could not connect to redis because I forgot to set the password.

Hi,

The CDN, desribed here is used to manage logs and artifacts. This is needed by Hatcheries to give some configuration to workers at startup. The CDN service must be started and running to let Hatcheries start normally.

In any case, if you have any doubts about the configuration or the possible values, you can run the command
./engine config new cdn for CDN Configuration and ./engine config new hatchery:swarm for the swarm configuration.

In your case (with probably the version 0.49.0), it seems that the cdn configuration is missing from your swarm hatchery.

If it's for testing purpose only, you can run the whole platform with docker-compose locally https://ovh.github.io/cds/hosting/ready-to-run/docker-compose/docker-compose/.

We are sorry for the delay in response, I am closing this ticket, do not hesitate to open a new ticket if you have other issues.