question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CustomResource update fails with "the body of the request was in an unknown format" error

See original GitHub issue

Hello!

  • Vote on this issue by adding a 👍 reaction
  • To contribute a fix for this issue, leave a comment (and link to your pull request, if you’ve opened one already)

Issue details

When running pulumi up for the second time, CustomResource fails to update with the error:

error: 1 error occurred:
        * the Kubernetes API server reported that "sidetrek-webapp-staging-cd3aydbs/frontend-svc" failed to fully initialize or become live: the body of the request was in an unknown format - accepted media types include: application/json-patch+json, application/merge-patch+json, application/apply-patch+yaml

Currently using @pulumi/pulumi ^3.10.1 and @pulumi/kubernetes ^3.6.0

Steps to reproduce

Run pulumi up with a CustomResource for Knative service (runs fine the first time the resource is created but fails for every subsequent pulumi up):

const KService = new k8s.apiextensions.CustomResource('api-svc', {
  apiVersion: 'serving.knative.dev/v1',
  kind: 'Service',
  metadata: {
    namespace,
    name,
  },
  spec: {
    template: {
      spec: {
        containers: [
          {
            image
          }
        ],
      }
    },
  },
}, { provider: k8sProvider })

Expected: Expected the CustomResource to be updated without error Actual: Works fine on first pulumi up but fails on update (i.e. every subsequent pulumi up)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
seunggscommented, Oct 29, 2021

Awesome! 🎉

I can confirm that Knative revisions are now getting created properly on code update:

NAME            CONFIG NAME   K8S SERVICE NAME   GENERATION   READY   REASON   ACTUAL REPLICAS   DESIRED REPLICAS
app-svc-00001   app-svc                          1            True             1                 1
app-svc-00002   app-svc                          2            True             1                 1

Thanks for the quick turnaround on this!

0reactions
lblackstonecommented, Oct 29, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

CustomResource update fails with "the body of the request ...
Vote on this issue by adding a reaction To contribute a fix for ... with "the body of the request was in an...
Read more >
Error while applying JSON Patch to Kubernetes Custom ...
I'm fairly certain that my request body is a valid JSON patch, and I've previously already successfully updated core (non-CRD) API resources ...
Read more >
kubectl patch the body of the request was in an unknown ...
Get error Failed to patch object when using the k8s command for a resource that already exists. ISSUE TYPE. Bug Report. COMPONENT NAME....
Read more >
1619869 – oc patch on custom resource returns error
Bug 1619869 - oc patch on custom resource returns error ... the body of the request was in an unknown format - accepted...
Read more >
Custom resource response objects - AWS CloudFormation
The status value sent by the custom resource provider in response to an AWS CloudFormation-generated request. Must be either SUCCESS or FAILED ....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found