woodpecker-ci / woodpecker

Woodpecker is a simple yet powerful CI/CD engine with great extensibility.
https://woodpecker-ci.org
Apache License 2.0
3.95k stars 351 forks source link

Agent Cannot Connect To Server #3231

Closed TheDarkula closed 6 months ago

TheDarkula commented 6 months ago

Component

server, agent

Describe the bug

The server seems to refuse connections on port 9000, even though it says it is listening.

System Info

2.1.1

This is running in kubernetes via a custom helm chart.

I have the server available through a traefik ingress.

The gRPC service is available to the agent as a clusterIP.

I did also try this with the `latest` image tag for both the server and the agent.

Additional context

Agent logs:

{"level":"info","time":"2024-01-20T15:16:24Z","caller":"/src/cmd/common/logger.go:100","message":"LogLevel = trace"}
{"level":"info","time":"2024-01-20T15:16:24Z","caller":"/src/cmd/agent/config.go:45","message":"no agent config found at '/etc/woodpecker/agent.conf', start with defaults"}
rpc error: code = DeadlineExceeded desc = context deadline exceeded

Given that there is no shell (scratch image) on either the server or the agent, I could not exec in and do any diagnostics.

I did run a kubectl exec ... /bin/woodpecker-server:

3:26PM INF LogLevel = info
3:26PM FTL failed to listen on grpc-addr error="listen tcp :9000: bind: address already in use"

I have also written an initContainer for the agent:

while ! nc -z woodpecker.woodpecker.svc.cluster.local 9000; do
  echo "Waiting for port 9000 to be available..."
  sleep 2
done

Unfortunately, this hangs indefinitely.

Also, your Contributing Guidelines link does not exist.

Validations

zc-devs commented 6 months ago

there is no shell

There are Alpine images:

docker run -it --entrypoint=/bin/sh woodpeckerci/woodpecker-server:v2.1.1-alpine
  1. Both Server and Agent work. In Kubernetes too. Should be question in Discussions.
  2. You have not provided configuration. And I mean not Values of your custom Heml, but raw yamls deployed in cluster.
  3. Network policies?