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

Importing ruleset cause panic #553

Closed
ami-descope opened this issue Nov 6, 2023 · 0 comments
Closed

Importing ruleset cause panic #553

ami-descope opened this issue Nov 6, 2023 · 0 comments
Labels
kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team

Comments

@ami-descope
Copy link

What happened?

I am trying to import a manually created rule fro rate limiting on the WAF

even with no code at all and importing it fails on this panic

export CLOUDFLARE_API_TOKEN=wzfqC4XXXXXXXX

pulumi import cloudflare:index/ruleset:Ruleset descope-domain-rate-limit zone/b0568fbe68169ce1aec3c6f82fca4d6b/f0e0c05c1fde4deaa7eec31c75c905e

 panic: DefaultValue() should not be called during schema generation
    goroutine 58 [running]:
    github.com/pulumi/pulumi-terraform-bridge/pf/internal/schemashim.(*blockSchema).DefaultValue(0x101221e40)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/pf@v0.13.0/internal/schemashim/block_schema.go:123 +0x2c
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.getDefaultValue(...)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.54.1/pkg/tfbridge/schema.go:1367
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.isDefaultOrZeroValue({0x101448300, 0x140004d38a0}, 0x101448300?, {{0x101191b80?, 0x14000cf3458?}})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.54.1/pkg/tfbridge/schema.go:1378 +0x40
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.extractSchemaInputs({{0x1013a5e60?, 0x140010e8e40?}}, {0x101448540, 0x140010829c0}, 0x140007fd290?, 0x0)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.54.1/pkg/tfbridge/schema.go:1455 +0x308
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.ExtractInputsFromOutputs(0x10143fa70?, 0x1400067ae60?, {0x10143d6a8?, 0x14000599320}, 0x14000011620, 0x0)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.54.1/pkg/tfbridge/schema.go:1485 +0x134
    github.com/pulumi/pulumi-terraform-bridge/pf/tfbridge.(*provider).ReadWithContext(0x1400026f600, {0x101439948?, 0x1400089f6e0?}, {0x14000c5ccc0, 0x59}, {0x14000c77540, 0x45}, 0x1011b14a0?, 0x1400089f710)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/pf@v0.13.0/tfbridge/provider_read.go:69 +0x204
    github.com/pulumi/pulumi-terraform-bridge/pf/internal/plugin.(*providerServer).Read(0x1400089e570, {0x101439948, 0x1400089f6e0}, 0x14000c97440)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/pf@v0.13.0/internal/plugin/provider_server.go:370 +0x198
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Read.func1({0x1014472f0?, 0x1400089e570?})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.4/muxer.go:350 +0x3c
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.resourceMethod[...](0x1400055a550?, 0x14000933778, 0x14000933758?)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.4/muxer.go:303 +0xc4
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Read(0x140009337b8?, {0x101439948?, 0x1400089f6e0?}, 0x1011badc0?)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.4/muxer.go:349 +0x5c
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Read_Handler.func1({0x101439948, 0x1400089f6e0}, {0x101364fa0?, 0x14000c97440})
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.75.0/proto/go/provider_grpc.pb.go:591 +0x74
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x101439948, 0x1400089f440}, {0x101364fa0, 0x14000c97440}, 0x14000443a80, 0x14000c8d8d8)
    	/home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x2f4
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Read_Handler({0x1013e9b80?, 0x1400055a550}, {0x101439948, 0x1400089f440}, 0x140004ddea0, 0x140003576e0)
    	/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.75.0/proto/go/provider_grpc.pb.go:593 +0x12c
    google.golang.org/grpc.(*Server).processUnaryRPC(0x14000505680, {0x101441820, 0x14000cb21a0}, 0x14000968120, 0x1400089e600, 0x101f03098, 0x0)
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.56.1/server.go:1337 +0xc28
    google.golang.org/grpc.(*Server).handleStream(0x14000505680, {0x101441820, 0x14000cb21a0}, 0x14000968120, 0x0)
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.56.1/server.go:1714 +0x80c
    google.golang.org/grpc.(*Server).serveStreams.func1.1()
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.56.1/server.go:959 +0x84
    created by google.golang.org/grpc.(*Server).serveStreams.func1
    	/home/runner/go/pkg/mod/google.golang.org/grpc@v1.56.1/server.go:957 +0x164

    error: preview failed

  cloudflare:index:Ruleset (descope-domain-rate-limit):
    error: Preview failed: error reading from server: EOF

can't figure this out, even if the rule does not exist it fails.

Example

no code, just try to import any ruleset, exists or not exists.

Output of pulumi about

CLI
Version 3.92.0
Go Version go1.21.3
Go Compiler gc

Plugins
NAME VERSION
nodejs unknown

Host
OS darwin
Version 13.6
Arch arm64

This project is written in nodejs: executable='/opt/homebrew/bin/node' version='v20.5.1'

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

@ami-descope ami-descope added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team
Projects
None yet
Development

No branches or pull requests

1 participant