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

Unmarshalling error in cloudflare client when creating a CertifcatePack #167

Closed
bruno-morel opened this issue Aug 3, 2021 · 6 comments
Closed
Assignees
Labels
area/providers kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed

Comments

@bruno-morel
Copy link

It worked 3 days ago, now it doesnt...

I I try to create a CertificatePack from pulumi, here is what I get:
failed to fetch certificate pack: error unmarshalling the JSON response: json: cannot unmarshal string into Go struct field CertificatePack.result.primary_certificate of type int

Steps to reproduce

  1. Create a Certificate Pack using https://www.pulumi.com/docs/reference/pkg/cloudflare/certificatepack/
  2. We use the advanced type, for an active zone using digicert
  3. Watch it fail after having created the pack in CloudFlare (so it does create it, but fail after)

Expected: no failure
Actual: full failure of the update + impossible to rely on the created object in subsequent flow

@bruno-morel bruno-morel added the kind/bug Some behavior is incorrect or out of spec label Aug 3, 2021
@tricky42
Copy link

tricky42 commented Aug 5, 2021

I ran into the same problem. When refreshing our Pulumi stack we get the same error:

error: refreshing urn:pulumi:staging::loadbalancer::cloudflare:index/certificatePack:CertificatePack::certPack_staging_domain: 

failed to fetch certificate pack: error unmarshalling the JSON response: json: 
cannot unmarshal string into Go struct field CertificatePack.result.primary_certificate of type int

@tricky42
Copy link

@stack72 Can you provide any update on this issue. I would be willing help fixing the issue, but I think I need some pointers to get started what introduced the issue in the first place.

@tricky42
Copy link

Here is the related issue in the Cloudflare Terraform Provider:

This issue has been closed and I see that in the last release of the Cloudflare Terraform Provider this has been fixed:

I can see you updated to v.2.25.0 before releasing v3.4.0, but I am still getting the error although I ensured I am using v3.4.0: "@pulumi/cloudflare": "3.4.0".

Any tip how I can resolve the issue @stack72?

@tricky42
Copy link

tricky42 commented Aug 23, 2021

I further looked into this and found a workaround for our setup.

In our scripts we are first running pulumi refresh before pulumi up and the error happened during the refresh. I first ensured that I am using the latest version of Pulumi / Pulumi Cloudflare Provider (you can check the plugin version by calling pulumi plugin ls).

Then I temporarily disabled the pulumi refresh call and just ran pulumi up, which completed without problems. I think this updated the stored state (we are using Pulumi Cloud) and now I was able to enable pulumi refresh again, which now runs without problems.

@bruno-morel can you check if this works for you as well?

@bruno-morel
Copy link
Author

It looks like it's working, I have a bunch of service to check, but the first one was happy with it. I'll keep you updated if I encounter more trouble, but thanks for finding a working fix!

@mikhailshilkov mikhailshilkov self-assigned this Nov 29, 2023
@mikhailshilkov mikhailshilkov added the resolution/fixed This issue was fixed label Nov 29, 2023
@mikhailshilkov
Copy link
Member

The upstream issue has been fixed and nobody commented on this issue since 2021, so I'll go ahead and close it as fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/providers kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

4 participants