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

cf4k8s: POST /v3/builds gives a weird error message #1774

Closed
ericpromislow opened this issue Aug 6, 2020 · 3 comments
Closed

cf4k8s: POST /v3/builds gives a weird error message #1774

ericpromislow opened this issue Aug 6, 2020 · 3 comments
Labels

Comments

@ericpromislow
Copy link
Contributor

Thanks for submitting an issue to cloud_controller_ng. We are always trying to improve! To help us, please fill out the following template.

Issue

Creating a package failed with an unexpected error message

Context

We're exploring how much of CATs will be runnable on cf4k8s

Steps to Reproduce

Focus https://github.com/cloudfoundry/cf-acceptance-tests/blob/7f4027c7a0b2c00f8e56a6d40904b8f65b4ed485/v3/deployment.go#L84

Modify https://github.com/cloudfoundry/cf-acceptance-tests/blob/7f4027c7a0b2c00f8e56a6d40904b8f65b4ed485/helpers/v3_helpers/v3.go#L412 to not specify a list of buildpacks when no buildpacks are passed in

Expected result

We were hoping this would just work

Current result

We got this error:

  "errors": [
      {
         "detail": "Package guid can't be blank, Package guid must be a string, Package guid must be between 1 and 200 characters, Lifecycle data must be an object",
         "title": "CF-UnprocessableEntity",
         "code": 10008
      }
   ]

Pertinent logs:

\"backtrace\"=>[\"/cloud_controller_ng/app/controllers/v3/application_controller.rb:18:in
`unprocessable!'\",
\"/cloud_controller_ng/app/controllers/v3/builds_controller.rb:32:in
`create'\",
@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/174224146

The labels on this github issue will be updated when the story is started.

@cwlbraa
Copy link
Contributor

cwlbraa commented Sep 14, 2020

plan:

  • follow repro instructions
  • make lifecycle: buildpack invalid on cf-for-k8s (it never works anyways)
  • investigate space_manifests_spec test cruft

@cwlbraa
Copy link
Contributor

cwlbraa commented Sep 14, 2020

when trying to repro, I found that this bug doesn't exist in this exact form any more. There is a similar class of errors that occur when a cf-for-k8s CC tries to handle build requests with "lifecycle":{ "type": "buildpack" }. To mitigate that, I'm adding some validation that will error if the default app lifecycle is kpack but a user requests a buildpack lifecycle.

the new, undesirable errors look roughly like this:

cf curl /v3/builds -X POST -d {"lifecycle":{ "type": "buildpack", "data": { "buildpacks": ["paketo-community/ruby"] } }, "package": { "guid" : "3516e484-e4bc-4e57-adcd-1f6c873f3fa0"}}
{
   "errors": [
      {
         "detail": "Buildpack \"paketo-community/ruby\" must be an existing admin buildpack or a valid git URI",
         "title": "CF-UnprocessableEntity",
         "code": 10008
      }
   ]
}

the improved ones should look roughly like:

{
    "errors": [
       {
          "detail": "this installation does not support the "buildpack" lifecycle, try "kpack" instead",
          "title": "CF-UnprocessableEntity",
          "code": 10008
       }
}

see fix commit here: 3946106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants