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

Can't create cluster #44

Open
plainspoken-chris opened this issue Aug 31, 2024 · 9 comments
Open

Can't create cluster #44

plainspoken-chris opened this issue Aug 31, 2024 · 9 comments

Comments

@plainspoken-chris
Copy link

plainspoken-chris commented Aug 31, 2024

"""Stand up the infrastructure for the application."""

import pulumi
import pulumiverse_cockroach as cockroach

project = pulumi.get_project()
p = project + "-"

cockroach_cluster = cockroach.Cluster(
    resource_name=p+"cockroach-cluster",
    name=p+"cockroach-cluster",
    cloud_provider="AWS",
    regions=[cockroach.ClusterRegionArgs(
        name="us-east-1",
        # node_count=0,
        # primary=True,
    )],
    # parent_id="root",
    # cockroach_version="24.1",
    serverless=cockroach.ClusterServerlessArgs(
        spend_limit=0,
    )
    )

pulumi.export("cluster_id", cockroach_cluster.id)

Results in

2024/08/30 20:15:06 [DEBUG] Waiting for state to become: [success]
2024/08/30 20:15:07 [TRACE] Waiting 500ms before next try
2024/08/30 20:15:07 [TRACE] Waiting 1s before next try
panic: fatal: An assertion has failed: Resource state did not contain an 'id' property. This is an error in the provider. Special identity handling may be needed. Consider setting ResourceInfo.ComputeID for the cockroach_cluster resource
goroutine 38 [running]:
github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.failfast(...)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/go/common/util/contract/failfast.go:23
github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.Assertf(0x0?, {0x10181701b?, 0x1017d3ccb?}, {0x14000673258?, 0x1?, 0x1400013b590?})
/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/go/common/util/contract/assert.go:35 +0xe0
github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge.extractID({0x101d77fa8?, 0x1400013aa50?}, {0x1017e5062?, 0x140006c3ea0?}, 0x0?, 0x0?)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/tfbridge/ids.go:41 +0x104
github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge.(*provider).CreateWithContext(0x1400001ee00, {0x101d77fa8?, 0x1400013a570?}, {0x1400004a230, 0x63}, 0x0?, 0x0?, 0x0)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/tfbridge/provider_create.go:126 +0x5e4
github.com/pulumi/pulumi-terraform-bridge/pf/internal/plugin.(*providerServer).Create(0x1400017c330, {0x101d77fa8, 0x1400013a570}, 0x140001feb90)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/[email protected]/internal/plugin/provider_server.go:351 +0x12c
github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler.func1({0x101d77fa8, 0x1400013a570}, {0x101c93ba0?, 0x140001feb90})
/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider_grpc.pb.go:593 +0x74
github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x101d77fa8, 0x1400013a1b0}, {0x101c93ba0, 0x140001feb90}, 0x1400003ae20, 0x14000226648)
/home/runner/go/pkg/mod/github.com/grpc-ecosystem/[email protected]/go/otgrpc/server.go:57 +0x2e8
github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler({0x101d24500?, 0x1400017c330}, {0x101d77fa8, 0x1400013a1b0}, 0x140003f4a00, 0x1400025e460)
/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/[email protected]/proto/go/provider_grpc.pb.go:595 +0x12c
google.golang.org/grpc.(*Server).processUnaryRPC(0x14000276400, {0x101d77fa8, 0x1400013a120}, {0x101d82520, 0x140000fe480}, 0x140004098c0, 0x1400017c3c0, 0x10270dfa0, 0x0)
/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1369 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x14000276400, {0x101d82520, 0x140000fe480}, 0x140004098c0)
/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1780 +0xc80
google.golang.org/grpc.(*Server).serveStreams.func2.1()
/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 61
/home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1030 +0x150

error: update failed
@adinhodovic
Copy link

Did you manage to resolve this?

@ringods
Copy link
Member

ringods commented Oct 31, 2024

@plainspoken-chris could you retry with provider version v0.4.0 or up?

@adinhodovic
Copy link

@plainspoken-chris could you retry with provider version v0.4.0 or up?

Same error:

    2024/10/31 21:05:34 [TRACE] Waiting 10s before next try
    2024/10/31 21:05:44 [TRACE] Waiting 10s before next try
    2024/10/31 21:05:55 [TRACE] Waiting 10s before next try
    2024/10/31 21:06:05 [TRACE] Waiting 10s before next try
    2024/10/31 21:06:16 [TRACE] Waiting 10s before next try
    2024/10/31 21:06:26 [TRACE] Waiting 10s before next try
    2024/10/31 21:06:36 [TRACE] Waiting 10s before next try

    error: update failed

  cockroach:index:Cluster (clusterResource):
    error: Could not find required property 'id' in state. This is an error in cockroach resource provider, please report at https://github.com/pulumiverse/pulumi-cockroach

@ringods
Copy link
Member

ringods commented Oct 31, 2024

@adinhodovic would it be possible to generate a log file for me?

Instructions can be found here:
https://www.pulumi.com/docs/iac/support/troubleshooting/#verbose-logging

So do max level 10 (not including secrets) and given this is a TF bridged provider, set TF_LOG to TRACE as in the docs example above.

@ringods
Copy link
Member

ringods commented Nov 1, 2024

@adinhodovic I changed something in the mapping of the Cluster resource from the underlying TF provider:

de88ea4#diff-34c57e622183cb0d8dd0d3f9eaa0861b3340120e9b2ad811bac7ac7be4cea4b1

I accidentally remapped the id to clusterId for the Cluster resource itself. While this is required for resources taking a cluster ID as an input, it prevented the Cluster resource to expose its own ID as a proper output.

Included in release v0.6.0.
https://github.com/pulumiverse/pulumi-cockroach/releases/tag/v0.6.0

Can you retest with this version?

@adinhodovic
Copy link

adinhodovic commented Nov 1, 2024

@adinhodovic I changed something in the mapping of the Cluster resource from the underlying TF provider:

de88ea4#diff-34c57e622183cb0d8dd0d3f9eaa0861b3340120e9b2ad811bac7ac7be4cea4b1

I accidentally remapped the id to clusterId for the Cluster resource itself. While this is required for resources taking a cluster ID as an input, it prevented the Cluster resource to expose its own ID as a proper output.

Included in release v0.6.0. https://github.com/pulumiverse/pulumi-cockroach/releases/tag/v0.6.0

Can you retest with this version?

That worked. Thanks!

However, need the same fix for the Prometheus config resource. Also, ran with debug logs if needed.

  provider/metric_export_prometheus_config_resource.go:140: provider: enable prometheus metric export response: {
 "cluster_id": "redacted",
 "status": "ENABLED",
 "targets": {
   "us-east-1": "redacted"
 },
 "user_message": "This integration is active."
}: [email protected]
error: Could not find required property 'id' in state. This is an error in cockroach resource provider, please report at https://github.com/pulumiverse/pulumi-cockroach
error: update failed

@adinhodovic
Copy link

Does #51 fix this for remainder of resources?

@adinhodovic
Copy link

Also this fails in a similar way:

 cockroach:index:UserRoleGrant (abc):
    error: Could not find required property 'id' in state. This is an error in cockroach resource provider, please report at https://github.com/pulumiverse/pulumi-cockroach

@adinhodovic
Copy link

adinhodovic commented Nov 25, 2024

The last errors we hit are:

@ Updating........
    pulumi:pulumi:Stack <stack> running 2024/11/25 10:51:30 [DEBUG] Waiting for state to become: [success]
@ Updating....
    pulumi:pulumi:Stack <stack> running 2024/11/25 10:51:31 [DEBUG] Waiting for state to become: [success]
 +  cockroach:index:UserRoleGrant <stack> creating (5s) error: Could not find required property 'id' in state. This is an error in cockroach resource provider, please re
port at https://github.com/pulumiverse/pulumi-cockroach
 +  cockroach:index:UserRoleGrant <stack> **creating failed** error: Could not find required property 'id' in state. This is an error in cockroach resource provider, ple
ase report at https://github.com/pulumiverse/pulumi-cockroach
    pulumi:pulumi:Stack <stack> running 2024/11/25 10:51:31 [TRACE] Waiting 500ms before next try
@ Updating....
    pulumi:pulumi:Stack <stack> running 2024/11/25 10:51:32 [TRACE] Waiting 1s before next try
@ Updating.....
    pulumi:pulumi:Stack <stack> running 2024/11/25 10:51:34 [TRACE] Waiting 2s before next try
@ Updating.....
 +  cockroach:index:MetricExportPrometheusConfig <stack> creating (11s) error: Could not find required property 'id' in state. This is an error in cockroach resource provider, please report at https://github.com/pulumiverse/pulumi-cockroach
 +  cockroach:index:MetricExportPrometheusConfig <stack> **creating failed** error: Could not find required property 'id' in state. This is an error in cockroach resource provider,
 please report at https://github.com/pulumiverse/pulumi-cockroach

Also, debug/trace logs seem to be on by default for the provider?

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

No branches or pull requests

3 participants