woodpecker-ci / autoscaler

Scale your woodpecker agents automatically to the moon and back based on the current load.
Apache License 2.0
30 stars 5 forks source link

Error "Please select a provider" #18

Closed maltejur closed 1 year ago

maltejur commented 1 year ago

A few days ago I started having problems with the autoscaler, so I pulled the latest image and tried that one. Now I have the problem though that every time I want to start the autoscaler, I get the following error:

➜  docker compose up woodpecker-autoscaler
[+] Building 0.0s (0/0)                                                                                                                                                                                            
[+] Running 2/0
 ✔ Container woodpecker-woodpecker-server-1      Running                                                                                                                                                      0.0s 
 ✔ Container woodpecker-woodpecker-autoscaler-1  Created                                                                                                                                                      0.0s 
Attaching to woodpecker-woodpecker-autoscaler-1
woodpecker-woodpecker-autoscaler-1  | {"time":"2023-09-02T09:34:43Z","message":"Starting autoscaler with log-level=info"}
woodpecker-woodpecker-autoscaler-1  | {"level":"fatal","error":"Please select a provider","time":"2023-09-02T09:34:43Z"}
woodpecker-woodpecker-autoscaler-1 exited with code 0

The same configuration worked perfectly fine previously. Here it is:

# docker-compose.yml
version: '3'

services:
  woodpecker-server:
    image: woodpeckerci/woodpecker-server:v1.0.2
    ports:
      - 8000:8000
      - 9000:9000
    volumes:
      - woodpecker-server-data:/var/lib/woodpecker/
      - /home/ubuntu/woodpecker/custom.css:/etc/custom.css
    environment:
      - WOODPECKER_OPEN=true
      - WOODPECKER_ORGS=...
      - WOODPECKER_ADMIN=...
      - WOODPECKER_HOST=...
      - WOODPECKER_GITEA=true
      - WOODPECKER_GITEA_URL=https://codeberg.org
      - WOODPECKER_GITEA_CLIENT=...
      - WOODPECKER_GITEA_SECRET=...

  woodpecker-autoscaler:
    image: woodpeckerci/autoscaler:next
    restart: always
    depends_on:
      - woodpecker-server
    environment:
      - WOODPECKER_SERVER=...
      - WOODPECKER_TOKEN=...
      - WOODPECKER_MIN_AGENTS=0
      - WOODPECKER_MAX_AGENTS=15
      - WOODPECKER_WORKFLOWS_PER_AGENT=1
      - WOODPECKER_GRPC_ADDR=...
      - WOODEPCKER_GRPC_SECURE=true
      - WOODPECKER_HETZNERCLOUD_API_TOKEN=...
      - WOODPECKER_HETZNERCLOUD_SERVER_TYPE=cpx51
      - WOODPECKER_HETZNERCLOUD_SSH_KEYS=...
      - WOODPECKER_ENVIRONMENT=...

volumes:
  woodpecker-server-data:

Have I configured something wrong, or is this a bug?

anbraten commented 1 year ago

You need to set the provider to Hetzner using WOODPECKER_PROVIDER=hetznercloud

maltejur commented 1 year ago

Thanks, thats it.