woodpecker
woodpecker copied to clipboard
Missing required Service.spec.ports in Kubernetes
Component
agent
Describe the bug
Service.spec.ports
is required and not being passed.
Same environment and pipeline of #1232. This time using agent version next-3130a1c5
. The error is:
default/woodpecker-woodpecker-agent-56df456494-b62fg[woodpecker-agent]: {
"level": "error",
"error": "rpc error: code = Unknown desc = Proc finished with exitcode 1, Service \"wp-0-3996753301819885534-services-0\" is invalid: spec.ports: Required value",
"time": "2022-10-07T21:27:22Z",
"message": "grpc error: wait(): code: Unknown: rpc error: code = Unknown desc = Proc finished with exitcode 1, Service \"wp-0-3996753301819885534-services-0\" is invalid: spec.ports: Required value"
}
I see that kubernetes.Service
has a ports
parameter but all calls are done with an empty array as its value.
System Info
{"source":"https://github.com/woodpecker-ci/woodpecker","version":"next-3130a1c5"}
Additional context
No response
Validations
- [X] Read the Contributing Guidelines.
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A join our Discord Chat Server or the Matrix room.
might could solve the open todo of #552
So you are trying to run a pipeline with this context (no ports defined)?:
services:
docker:
image: docker:22.06-rc-dind
pipeline:
build:
image: docker:22.06-rc-dind
commands:
- printenv | sort
I will try to debug it against a cluster again.
So you are trying to run a pipeline with this context (no ports defined)?:
Correct, no ports defined.
no ports defined
all calls are done with an empty array as its value
Service.spec.ports is required and not being passed
error: Service is invalid: spec.ports: Required value
@mmoya, what do you expect in that case?
I am not sure this applies anymore given it's age. Also so much has changed in the helm chart lately and nobody else reported similar issues.
I'd vote to close and re-evaluate if something similar comes up again?
I'm not actively using the CI these days. If I find time to test a more recent build I'll add a note with the results.
Although I second @pat-s's recommendation of closing this, I'll add an answer to @zc-devs for the record.
@mmoya, what do you expect in that case?
Expected behaviour:
The build
step runs and a sorted list of environment variables is printed to stdout.
Actual behaviour:
You get the following error "error": "rpc error: code = Unknown desc = Proc finished with exitcode 1, Service \"wp-0-3996753301819885534-services-0\" is invalid: spec.ports: Required value",
.
ci config:
services:
docker:
image: docker:22.06-rc-dind
pipeline:
build:
image: docker:22.06-rc-dind
commands:
- printenv | sort
this problem still exists. this problem has nothing todo with the helm-chart. it is more about the kubernetes backend and the service that should be created by a job
the service of the job awaits a port: https://github.com/woodpecker-ci/woodpecker/blob/next-release/1.0.3/pipeline/backend/kubernetes/service.go#L26
but there is no option to pass a service port into this by the .woodpecker.yml
and the job terminates on creation with the error of:
is invalid: spec.ports: Required value
please reopen the issue