woodpecker-ci/woodpecker

Pipeline fails without error in UI when using service without ports

Opened this issue · 0 comments

Component

server, agent, web-ui

Describe the bug

Running service without defined port on Kubernetes leads to failed pipeline with cancelled all steps. There is no error in UI explaining what happened.

Steps to reproduce

  1. Install Woodpecker and Gitea on Kubernetes
  2. Run test pipeline
skip_clone: true
services:
  database:
    image: alpine
    commands:
      - echo 'Running MySQL server'
      - sleep 300
steps:
  build:
    image: alpine
    commands:
      - echo 'Building the app'
  1. Get cancelled steps without errors
    Screenshot 2024-11-12 1
  2. Get failed pipeline
    Screenshot 2024-11-12 2
  3. See error in Agent logs:
{"level":"debug","repo":"wp/test","pipeline":"24","workflow_id":"131","error":"Service \"wp-svc-01jcfsknbyamqsmky9re1t47bq-database\" is invalid: spec.ports: Required value","canceled":false,"time":"2024-11-12T08:59:56Z","caller":"/src/agent/runner.go:170","message":"workflow finished"}

Expected behavior

Pipeline failed with errors visible in UI, like

  1. Oh no, we got some errors!
  2. Click Show errors
  3. On Errors tab see error like
[linter]woodpecker: steps.database cannot use service without defined ports

OR

Just on pipeline page instead of Oh no, we got some errors! something like

Service \"wp-svc-01jcfsknbyamqsmky9re1t47bq-database\" is invalid: spec.ports: Required value

Also mentioned error should be at error level instead of debug.

System Info

Woodpecker `next-f87e80381b`, Gitea `1.22.3`, Postgres `16`, Kubernetes `v1.30.6+k3s1`

Additional context

agent.log
server.log

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Checked that the bug isn't fixed in the next version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]