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

error: objectEncoder failed on property "elasticsearch": objectEncoder failed on property "autoscale": Expected a Boolean #147

Closed
dermasmid opened this issue Sep 27, 2023 · 18 comments
Assignees
Labels
awaiting-feedback Blocked on input from the author kind/bug Some behavior is incorrect or out of spec resolution/no-repro This issue wasn't able to be reproduced

Comments

@dermasmid
Copy link

What happened?

getting this error since 0.6.0

Example

const esDeployment = new ec.Deployment(
'elasticsearch',
{
name: es,
region: gcp-${location},
version: '8.9.0',
deploymentTemplateId: 'gcp-compute-optimized-v2',
elasticsearch: {
autoscale: true,
hot: {
size: isProduction ? '16g' : '4g',
autoscaling: {},
},
},
kibana: {},
},
);

Output of pulumi about

CLI
Version 3.85.0
Go Version go1.21.1
Go Compiler gc

Plugins
NAME VERSION
cloudflare 5.11.0
cloudflare 5.9.0
datadog 4.22.0
datadog 4.22.0
ec 0.7.0
ec 0.5.1
gcp 6.66.0
gcp 6.65.0
google-native 0.31.1
google-native 0.31.1
kubernetes 4.3.0
kubernetes 4.1.1
mongodbatlas 3.10.1
mongodbatlas 3.10.0
nodejs unknown
random 4.14.0
random 4.13.2
slack 0.4.2
slack 0.4.2

Host
OS darwin
Version 14.0
Arch arm64

@pulumi/ec 0.7.0

Additional context

No response

Contributing

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).

@dermasmid dermasmid added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Sep 27, 2023
@mikhailshilkov
Copy link
Member

Hi @dermasmid thank you for reporting this. I tried to reproduce the issue with

import * as pulumi from "@pulumi/pulumi";
import * as ec from "@pulumi/ec";

const esDeployment = new ec.Deployment('elasticsearch', {
    region: "us-east-1",
    version: '8.9.0',
    deploymentTemplateId: 'aws-io-optimized-v2',
    elasticsearch: {
        autoscale: true,
        hot: {
            size: '4g',
            autoscaling: {},
        },
    },
    kibana: {},
});

but it succeeds for me on 0.7.0 version.

Could you please elaborate whether you get the error on preview, up, or some other combination of steps? Are you able to get the same error on my basic repro?

@mikhailshilkov mikhailshilkov added awaiting-feedback Blocked on input from the author needs-repro Needs repro steps before it can be triaged or fixed and removed needs-triage Needs attention from the triage team labels Sep 27, 2023
@dermasmid
Copy link
Author

could it be because it was created by an older version? prior to 0.6.0 autoscale was a string

@mikhailshilkov
Copy link
Member

Indeed! I got it reproduced, thank you.

So the steps are:

  1. Install pulumi/ec version 0.5.0.
  2. Deploy
import * as ec from "@pulumi/ec";

const esDeployment = new ec.Deployment('elasticsearch', {
    region: "us-east-1",
    version: '8.9.0',
    deploymentTemplateId: 'aws-io-optimized-v2',
    elasticsearch: {
        autoscale: "true",
    },
    kibana: {},
});
  1. Install the version 0.7.0.
  2. Change the program to
import * as pulumi from "@pulumi/pulumi";
import * as ec from "@pulumi/ec";

const esDeployment = new ec.Deployment('elasticsearch', {
    region: "us-east-1",
    version: '8.9.0',
    deploymentTemplateId: 'aws-io-optimized-v2',
    elasticsearch: {
        autoscale: true,
        hot: {
            size: '4g',
            autoscaling: {},
        },
    },
    kibana: {},
});
  1. pulumi preview
ec:index:Deployment (elasticsearch):
    error: objectEncoder failed on property "elasticsearch": objectEncoder failed on property "autoscale": Expected a Boolean

@mikhailshilkov mikhailshilkov removed awaiting-feedback Blocked on input from the author needs-repro Needs repro steps before it can be triaged or fixed labels Sep 27, 2023
@mikhailshilkov mikhailshilkov added this to the 0.95 milestone Sep 27, 2023
@dermasmid
Copy link
Author

i tried editing the state to change the autoscale field to a bool, but then i get this
` error: Unable to Upgrade Resource State: This resource was implemented without an UpgradeState() method, however Terraform was expecting an implementation for version 1 upgrade.

This is always an issue with the Terraform Provider and should be reported to the provider developer.`

@dermasmid
Copy link
Author

fixed it by changing the schema version in the state to 2

"__meta": "{"dddd":{"create":2400000000000,"default":2400000000000,"delete":3600000000000,"read":2400000000000,"update":3600000000000},"schema_version":"1"}",

@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Oct 25, 2023
@mikhailshilkov mikhailshilkov removed the needs-triage Needs attention from the triage team label Oct 26, 2023
@mikhailshilkov mikhailshilkov removed this from the 0.95 milestone Oct 26, 2023
@perevernihata
Copy link

fixed it by changing the schema version in the state to 2

"__meta": "{"dddd":{"create":2400000000000,"default":2400000000000,"delete":3600000000000,"read":2400000000000,"update":3600000000000},"schema_version":"1"}",

did you do it by manually tweaking state? would pulumi state upgrade do same job?

@dermasmid
Copy link
Author

i did it manually

@perevernihata
Copy link

thanks for responding, did not help for me, fails with a different message after I change field to bool and update metadata:

  ec:index:Deployment (ami-search-staging):
    error: ec:index/deployment:Deployment resource '*****' has a problem: Missing required property 'elasticsearch.hot': 'hot' topology element

I upgraded from 0.5.1 to 0.7.0. I guess I will experiment with state until it works.
Btw, I am considering removing whole thing from state and then importing using pulumi import https://www.pulumi.com/docs/cli/commands/pulumi_import/. Did you try this? Any pitfalls you know about?

@dermasmid
Copy link
Author

there are some other changes that you need to make to the pulumi code, besides this bug, look at my code example above

@perevernihata
Copy link

I changed pulumi code, its the old state that causes error.

@dermasmid
Copy link
Author

sorry i dont remember exactly what i did

@thovden
Copy link

thovden commented Jan 2, 2024

I'm also getting this error going from 0.5.1 to 0.7.0. The following steps worked:

  1. pulumi export --file stack.json
  2. Edit stack.json and change:
    a. "__meta": "...schema_version to 2
    b. Change "autoscale": 'false' to "autoscale": false
  3. pulumi import --file stack.json

@mjeffryes
Copy link
Member

Unfortunately, it looks like this issue hasn't seen any updates in a while. If you're still encountering this problem, could you leave a quick comment to let us know so we can prioritize it? (Commenting will bump it back into our triage queue.)

@mjeffryes mjeffryes added the awaiting-feedback Blocked on input from the author label Sep 27, 2024
@perevernihata
Copy link

I ended up messing up with internal state in some way which I do not remember anymore, but I made the problem go away and we were able to upgrade.
Unfortunately as a consequence of doing so, right now we see a diff every time we run pulumi update it gives us false-positive diff with no change:
Image
and I have no good idea on how to fix it. Pulumu refresh does not help

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Sep 27, 2024
@guineveresaenger
Copy link
Contributor

hi @perevernihata - that does potentially sound like a different issue.

Would you be able to provide us with your program so we can run some reproductions on our end? Thank you very much!

@guineveresaenger guineveresaenger removed the needs-triage Needs attention from the triage team label Sep 27, 2024
@guineveresaenger guineveresaenger added the awaiting-feedback Blocked on input from the author label Sep 27, 2024
@mjeffryes
Copy link
Member

hi @perevernihata - that does potentially sound like a different issue.

Would you be able to provide us with your program so we can run some reproductions on our end? Thank you very much!

To tag on here, it would be best I think if you can open this as a separate bug report. It looks like an independent problem and the comment history will only get in the way of the new investigation.

@perevernihata
Copy link

I am not trying to report the issue, I only mentioned it cause it happened in relation to original problem - but it was me causing it and I will not be able to reproduce this on new repository since I do not remember how exactly state was manually tweaked.
Moral of the story is - do not mess with state manually.

@pulumi-bot pulumi-bot added needs-triage Needs attention from the triage team and removed awaiting-feedback Blocked on input from the author labels Sep 28, 2024
@VenelinMartinov VenelinMartinov added awaiting-feedback Blocked on input from the author and removed needs-triage Needs attention from the triage team labels Sep 30, 2024
@mjeffryes mjeffryes added the resolution/no-repro This issue wasn't able to be reproduced label Oct 11, 2024
@mjeffryes mjeffryes self-assigned this Oct 11, 2024
@mjeffryes
Copy link
Member

It sounds like we probably won't be able to get a repro of this issue for now then; we'll close and wait to see any new reports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-feedback Blocked on input from the author kind/bug Some behavior is incorrect or out of spec resolution/no-repro This issue wasn't able to be reproduced
Projects
None yet
Development

No branches or pull requests

8 participants