woodpecker-ci / woodpecker

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

Starting a simple stack result in "forge not configured" #4191

Closed rossm-mf closed 1 month ago

rossm-mf commented 1 month ago

Component

server

Describe the bug

starting a simple stack gets me the following error. I can't find any info about forge relevant to my error.

woodpecker-server  | {"level":"info","time":"2024-10-05T13:55:30Z","message":"log level: info"}
woodpecker-server  | {"level":"error","error":"can't setup globals: could not setup service manager: forge not configured","time":"2024-10-05T13:55:30Z","message":"error running server"}
dependency failed to start: container woodpecker-server exited (0)

Steps to reproduce

docker-compose up of this

  woodpecker-server:
    container_name: woodpecker-server
    image: woodpeckerci/woodpecker-server:latest
    ports:
      - 8333:8000
    volumes:
      - woodpecker-config:/var/lib/woodpecker/
    environment:
      - WOODPECKER_OPEN=true
      - WOODPECKER_ADMIN=aname
      - WOODPECKER_HOST=http://internal_url:8000
      - WOODPECKER_AGENT_SECRET=SECRET
  woodpecker-agent:
    container_name: woodpecker-agent
    image: woodpeckerci/woodpecker-agent:latest
    depends_on:
      woodpecker-server:
        condition: service_healthy
    volumes:
      - woodpecker-agent-config:/etc/woodpecker
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - WOODPECKER_SERVER=woodpecker-server:9000
      - WOODPECKER_AGENT_SECRET=SECRET

Expected behavior

I would image that is a simple docker compose to start but I get an error

System Info

> ...:~/stack$ docker version
Client: Docker Engine - Community
 Version:           27.3.1
 API version:       1.47
 Go version:        go1.22.7
 Git commit:        ce12230
 Built:             Fri Sep 20 11:41:00 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          27.3.1
  API version:      1.47 (minimum version 1.24)
  Go version:       go1.22.7
  Git commit:       41ca978
  Built:            Fri Sep 20 11:41:00 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.7.22
  GitCommit:        7f7fdf5fed64eb6a7caf99b3e12efcf9d60e311c
 runc:
  Version:          1.1.14
  GitCommit:        v1.1.14-0-g2c9f560
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

> ...:~/stack$ docker compose version
Docker Compose version v2.29.7

Additional context

No response

Validations

pat-s commented 1 month ago

As the error states: You didn't configure your forge. E.g. for GitHub: https://woodpecker-ci.org/docs/next/administration/forges/github

qwerty287 commented 1 month ago

Closing as you need to setup a forge as @pat-s said

rossm-mf commented 1 month ago

I see. there is no other way to have it exposed in a way that Gitlab or Github can reach then?

qwerty287 commented 1 month ago

What do you mean? Should your WP instance be unreachable from outside?

rossm-mf commented 1 month ago

yeah. We use Gitlab Cloud. I wanted to explore the WP to see how it worked but can only spin on the internal network.

The way I saw Gitlab forge work is I need to create an oauth app that have a public url. (maybe I missed something)

rossm-mf commented 1 month ago

but then I stumble upon https://forgejo.org/ maybe I can manage with that

qwerty287 commented 1 month ago

Yes, you have to, because Gitlab sends a webhook to woodpecker. So Gitlab must be able to reach woodpecker.

There are some ways to configure that you have different domains/urls for webhooks and web ui, but still the webhooks must be available.

(In theory, it's also possible to work without webhooks but that's not officially supported)

but then I stumble upon https://forgejo.org/ maybe I can manage with that

Yes, you can self-host forgejo and make it also available internally to your network only, so forgejo and woodpecker can still connect to each other.

rossm-mf commented 1 month ago

(In theory, it's also possible to work without webhooks but that's not officially supported)

I guess even if it works. I will not get the full potentials of WP to triggers actions from people doing pushes and PR?

qwerty287 commented 1 month ago

I guess even if it works. I will not get the full potentials of WP to triggers actions from people doing pushes and PR?

Indeed. You can still use it to trigger manual pipelines, but there won't be anything triggered on actions in gitlab.

rossm-mf commented 1 month ago

Considering I found WP as an alternative to semaphore (https://pat-s.me/ansible-using-woodpecker-as-an-alternative-to-semaphore/) I might work for me.

Thank you all for your time. I have enough to dive I think

qwerty287 commented 1 month ago

You're welcome, if you have other question just ask