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 wont connect to server: rpc error #2575

Closed beatjaeckle closed 9 months ago

beatjaeckle commented 9 months ago

Component

agent

Describe the bug

I followed the guide from @6543: https://tube.tchncs.de/videos/watch/04ca97a3-bc01-47bd-9084-179135290693 I'm not used to docker. I'm still learnig.

I already fixed some settings, f.e. I set WOODPECKER_SERVER=172.23.0.2:9000

But now I'm stuck with following errorcode in the agent log:

rpc error: code = DeadlineExceeded desc = context deadline exceeded

and the agent wont connect to the server.

PS: In the OAth of my forgejo i had to specify the prt in the redirect url.

System Info

{"source":"https://github.com/woodpecker-ci/woodpecker","version":"next-0623eefd3b"}

Additional context

# docker-compose.yml
version: '3'

services:
  woodpecker-server:
    image: woodpeckerci/woodpecker-server:next
    ports:
      - 8000:8000
    volumes:
      - woodpecker-server-data:/var/lib/woodpecker/
    environment:
      - WOODPECKER_OPEN=true
      - WOODPECKER_HOST=${WOODPECKER_HOST}
      - WOODPECKER_GITEA=true
      - WOODPECKER_GITEA_URL=${WOODPECKER_GITEA_URL}
      - WOODPECKER_GITEA_CLIENT=${WOODPECKER_GITEA_CLIENT}
      - WOODPECKER_GITEA_SECRET=${WOODPECKER_GITEA_SECRET}
      - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}
      - WOODPECKER_ADMIN=${WOODPECKER_ADMIN}
      - WOODPECKER_GRPC_ADDR=:9000

  woodpecker-agent:
    image: woodpeckerci/woodpecker-agent:next
    command: agent
    restart: always
    depends_on:
      - woodpecker-server
    volumes:
      - woodpecker-agent-config:/etc/woodpecker
      - /var/run/docker.sock:/var/run/docker
    environment:
      - WOODPECKER_SERVER=172.23.0.2:9000
      - WOODPECKER_AGENT_SECRET=${WOODPECKER_AGENT_SECRET}
      - WOODPECKER_BACKEND=docker

volumes:
  woodpecker-server-data:
  woodpecker-agent-config:
# .env
WOODPECKER_GITEA_CLIENT=***
WOODPECKER_HOST=https://ci.example.com:443
WOODPECKER_GITEA_SECRET=***
WOODPECKER_GITEA_URL=https://git.example.com:443
WOODPECKER_ADMIN=test
WOODPECKER_AGENT_SECRET=***

Validations

qwerty287 commented 9 months ago

I'm also not an expert in docker/compose, but if I look at our documentation the WOODPECKER_SERVER var is set to woodpecker-server:9000. Did you try this? You can also tale a look at other parts that are different in the docs.

beatjaeckle commented 9 months ago

I'm also not an expert in docker/compose, but if I look at our documentation the WOODPECKER_SERVER var is set to woodpecker-server:9000. Did you try this? You can also tale a look at other parts that are different in the docs.

Thank you. It works now!