Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing required Service.spec.ports in Kubernetes #1238

Closed
4 tasks done
mmoya opened this issue Oct 7, 2022 · 7 comments
Closed
4 tasks done

Missing required Service.spec.ports in Kubernetes #1238

mmoya opened this issue Oct 7, 2022 · 7 comments
Labels
backend/kubernetes bug Something isn't working

Comments

@mmoya
Copy link

mmoya commented Oct 7, 2022

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

@6543 6543 added bug Something isn't working backend/kubernetes and removed pending:bug labels Oct 7, 2022
@6543 6543 added this to the 1.0.0 milestone Oct 7, 2022
@6543
Copy link
Member

6543 commented Oct 7, 2022

might could solve the open todo of #552

@anbraten
Copy link
Member

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.

@mmoya
Copy link
Author

mmoya commented Oct 17, 2022

So you are trying to run a pipeline with this context (no ports defined)?:

Correct, no ports defined.

@6543 6543 modified the milestones: 1.0.0, 1.0.1 Jun 10, 2023
@6543 6543 modified the milestones: 1.0.1, 1.0.2 Aug 7, 2023
@qwerty287 qwerty287 modified the milestones: 1.0.2, v1.0.3, 1.0.3 Aug 8, 2023
@6543 6543 modified the milestones: 1.0.2, 1.0.3 Aug 16, 2023
@qwerty287 qwerty287 modified the milestones: 1.0.3, 1.0.4 Oct 15, 2023
@zc-devs
Copy link
Contributor

zc-devs commented Oct 17, 2023

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?

@pat-s
Copy link
Contributor

pat-s commented Oct 18, 2023

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?

@mmoya
Copy link
Author

mmoya commented Oct 19, 2023

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

@pat-s pat-s closed this as completed Oct 19, 2023
@J-Ha
Copy link
Contributor

J-Ha commented Oct 24, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/kubernetes bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants