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

pipeline definition not found - branch name contains dashes #2454

Open ymettier opened 1 year ago

ymettier commented 1 year ago

Component

server, agent

Describe the bug

I have a git repo with a file .woodpecker.yml and Woodpecker works well with it.

I created a new branch with dashes in it (something like my-new-branch). I got this message in the UI (first line in French) :

Erreur d'execution
pipeline definition not found
  1. How can I debug this . Nothing in the server logs. Nothing in the agent logs.
  2. I pushed to another branch, without the dashes (e.g. my_new_branch) and it worked as expected.

What's wrong with dashes ?

System Info

`{"source":"https://github.com/woodpecker-ci/woodpecker","version":"1.0.2"}`

➜ kubectl -n woodpecker get pod -o yaml|grep image: | sort -u
      image: docker.io/woodpeckerci/woodpecker-agent:v1.0.2-alpine
      image: docker.io/woodpeckerci/woodpecker-server:v1.0.2-alpine
      image: woodpeckerci/woodpecker-agent:v1.0.2-alpine


### Additional context

_No response_

### Validations

- [X] Read the [Contributing Guidelines](https://github.com/woodpecker-ci/woodpecker/blob/main/CONTRIBUTING.md).
- [X] Read the [docs](https://woodpecker-ci.org/docs/intro).
- [X] Check that there isn't [already an issue](https://github.com/woodpecker-ci/woodpecker/issues) that reports the same bug to avoid creating a duplicate.
- [X] Checked that the bug isn't fixed in the `next` version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]
- [X] Check that this is a concrete bug. For Q&A join our [Discord Chat Server](https://discord.gg/fcMQqSMXJy) or the [Matrix room](https://matrix.to/#/#woodpecker:matrix.org).
math3vz commented 1 year ago

I'm also using 1.0 and could not reproduce this bug. Can you try again and check the output of the latest webhook?

smainz commented 1 year ago

We have a similar problem:

Sometimes we get a HTTP 500 response to our webhooks, but if we send the same webhook again (gitea has this option) it works. This happens occasionally, but we are not able to provide a reproducible example. This does occur independently if the branch has hyphens or not.

Currently we are investigating what is going on and if we can find a cause, #2230 would help, once 1.0.3 is released to sort that out.

qwerty287 commented 1 year ago

@smainz Can you check this behavior with debug logs enabled?

Even without the linked PR a message should appear then if the pipeline is skipped (branch does not match restrictions defined in yaml).

If there are any errors or warnings etc. in the logs this would be helpful too of course.

smainz commented 1 year ago

We do have trace logs enabled, but I was not able to correlate a lost webhook with the logs, as I do not have the exact time of a lost hook and no dates in the woodpecker logs.

I can not distinguish between webhooks, which are intentionally not handled by the pipeline and those getting lost.

$ docker compose logs | grep "branch does not match restrictions defined in yaml" | wc -l
918

Is there any way to change the log pattern to use ISO date/time? I see:

woodpecker-ci-v1-woodpecker-agent3-1  | 3:45PM TRC src/pipeline/backend/docker/docker.go:212 > wait for step wp_01hays1phzc4mr81b9kvqpreqg_0_step_1 taskUUID=19919
woodpecker-ci-v1-woodpecker-server-1  | 3:50PM TRC woodpecker/src/github.com/woodpecker-ci/woodpecker/server/cron/cron.go:48 > Cron: fetch next crons
woodpecker-ci-v1-woodpecker-agent2-1  | 12:14PM DBG src/agent/tracer.go:51 > update step status exit_code=0 exited=true id=19901 image=renovate/renovate:36.102.0 pipeline=1773 repo=renovate-bot/renovate-config stage=renovate
woodpecker-ci-v1-woodpecker-server-1  | 3:50PM TRC woodpecker/src/github.com/woodpecker-ci/woodpecker/server/cron/cron.go:48 > Cron: fetch next crons
woodpecker-ci-v1-woodpecker-server-1  | 3:51PM TRC woodpecker/src/github.com/woodpecker-ci/woodpecker/server/cron/cron.go:48 > Cron: fetch next crons
runephilosof-karnovgroup commented 1 year ago

The error is not caused by the dashes in the branch name. I saw the error on a branch with dashes and pushed the commit to another branch with dashes in it. It worked on the new branch.

I am running on {"source":"https://github.com/woodpecker-ci/woodpecker","version":"next-aeb7bcb26a"}

Did not notice any interesting details in the logs with log level trace