pulumiverse / pulumi-scaleway

Pulumi provider for Scaleway
Apache License 2.0
35 stars 11 forks source link

create Loadbalancer fails at preview #252

Open hyper-ricardo opened 1 year ago

hyper-ricardo commented 1 year ago

Hello !

I am trying to create a load balance via a NPM projet with the fallowing code and encouter this error : panic: HasAttribute on non-object Type

The Node.js code (from the documentation):

import * as pulumi from "@pulumi/pulumi";
import * as scaleway from "@lbrlabs/pulumi-scaleway";

const main = new scaleway.LoadbalancerIp("main", {zone: "fr-par-1"});
const base = new scaleway.Loadbalancer("base", {
    ipId: main.id,
    zone: main.zone,
    type: "LB-S",
});

Is there any way I miss a mandatory attribute?

Thanks!!


Pulumi version: 3.80.0 @lbrlabs/pulumi-scaleway: ^1.10.0

Full stacktrace:

Diagnostics:
  scaleway:index:Loadbalancer (base):
    error: Preview failed: error reading from server: EOF

  pulumi:pulumi:Stack (cluster-base-prod):
    error: preview failed

    panic: HasAttribute on non-object Type
    goroutine 87 [running]:
    github.com/hashicorp/go-cty/cty.Type.HasAttribute({{0x0?, 0x0?}}, {0x17c62a3?, 0x40d5bf?})
        /home/runner/go/pkg/mod/github.com/hashicorp/go-cty@v1.4.1-0.20200414143053-d3edf31b6320/cty/object_type.go:104 +0x8b
    github.com/scaleway/terraform-provider-scaleway/v2/scaleway.getLocality(0xc000b0dc80?, 0x0?)
        /home/runner/go/pkg/mod/github.com/scaleway/terraform-provider-scaleway/v2@v2.22.0/scaleway/helpers.go:915 +0x45
    github.com/scaleway/terraform-provider-scaleway/v2/scaleway.customizeDiffLocalityCheck.func1({0x1c5a158?, 0xc0000500b8?}, 0x17d49ae?, {0x1505b00?, 0xc00017a3c0?})
        /home/runner/go/pkg/mod/github.com/scaleway/terraform-provider-scaleway/v2@v2.22.0/scaleway/helpers.go:932 +0x71
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.schemaMap.Diff(0xc0002acae0, {0x1c5a158, 0xc0000500b8}, 0xc000663ee0, 0xc000b0ce70, 0xc00034dc60, {0x1505b00, 0xc00017a3c0}, 0x0)
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20230327102345-3fa930f86570/helper/schema/schema.go:699 +0x4d4
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).SimpleDiff(0x0?, {0x1c5a158?, 0xc0000500b8?}, 0xc000663ee0, 0xc000b0ce70?, {0x1505b00?, 0xc00017a3c0?})
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20230327102345-3fa930f86570/helper/schema/resource.go:895 +0x6c
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.simpleDiff({0x0?, {0xffffffffffffffff?, 0xc00070f4d0?, 0xe39ae9?}}, 0x15bf0a0?, 0xc000b0ce40?, 0xc000663e10, 0xc00070f538?, {{{0x1c5b038, 0xc00011a408}}, ...}, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.53.0/pkg/tfshim/sdk-v2/provider_diff.go:87 +0x785
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Diff({0xc000522120?, {0x0?, 0xc0001e0b00?, 0xc0009a34d0?}}, {0x17d1ec2, 0xb}, {0x0?, 0x0}, {0x1c51140, 0xc000b0ce70})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.53.0/pkg/tfshim/sdk-v2/provider_diff.go:63 +0x30c
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Create(0xc0001e0b00, {0x1c5a1c8?, 0xc000b0cd20?}, 0xc000661a40)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.53.0/pkg/tfbridge/provider.go:721 +0x41d
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler.func1({0x1c5a1c8, 0xc000b0cd20}, {0x16f4080?, 0xc000661a40})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.74.0/proto/go/provider_grpc.pb.go:573 +0x78
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x1c5a1c8, 0xc000b0cc60}, {0x16f4080, 0xc000661a40}, 0xc000655340, 0xc000011b60)
        /home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x3f9
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler({0x17866e0?, 0xc0001e0b00}, {0x1c5a1c8, 0xc000b0cc60}, 0xc000529490, 0xc0005482a0)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.74.0/proto/go/provider_grpc.pb.go:575 +0x138
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc0009ca000, {0x1c618c0, 0xc00018a820}, 0xc000673e60, 0xc0009b85a0, 0x28e8e60, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.55.0/server.go:1337 +0xdf0
    google.golang.org/grpc.(*Server).handleStream(0xc0009ca000, {0x1c618c0, 0xc00018a820}, 0xc000673e60, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.55.0/server.go:1714 +0xa2f
    google.golang.org/grpc.(*Server).serveStreams.func1.1()
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.55.0/server.go:959 +0x98
    created by google.golang.org/grpc.(*Server).serveStreams.func1
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.55.0/server.go:957 +0x18c
JesusTheHun commented 1 year ago

I've got the same error for a scaleway.Function.

Last version that works is 1.7.0