question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Panic when updating code in a callbackFunction

See original GitHub issue

Issue details

I’m using a callbackFunction to create a lambda with the code in a separate file. When I update the code of the lambda and do an update I get the following error:

panic: interface conversion: interface {} is []interface {}, not *schema.Set
    goroutine 79 [running]:
    github.com/terraform-providers/terraform-provider-aws/aws.resourceAwsLambdaFunctionUpdate(0xc001958400, 0x7955220, 0xc001176000, 0x0, 0x0)
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-provider-aws@v1.38.1-0.20211004122636-8966d24576a0/aws/resource_aws_lambda_function.go:1199 +0x522d
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).update(0xc000d405b0, 0x9563138, 0xc0001a0008, 0xc001958400, 0x7955220, 0xc001176000, 0x0, 0x0, 0x0)
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20210629210550-59d24255d71f/helper/schema/resource.go:342 +0x1ee
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc000d405b0, 0x9563138, 0xc0001a0008, 0xc001081ea0, 0xc000199520, 0x7955220, 0xc001176000, 0x8, 0x10, 0xfd73108, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20210629210550-59d24255d71f/helper/schema/resource.go:454 +0x390
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Apply(0xc001567f90, 0x88c73c1, 0x13, 0x9564088, 0xc00194bc40, 0x958a710, 0xc000199520, 0x0, 0x958a710, 0xc000199520, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.8.2-0.20210930033847-5bba386a0e79/pkg/tfshim/sdk-v2/provider.go:112 +0x210
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Update(0xc00000a3c0, 0x95631a8, 0xc001937b30, 0xc001483980, 0xc00000a3c0, 0x78a7a01, 0xc00193bb00)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.8.2-0.20210930033847-5bba386a0e79/pkg/tfbridge/provider.go:1038 +0x9a3
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Update_Handler.func1(0x95631a8, 0xc001937b30, 0x866eb00, 0xc001483980, 0x8622fa0, 0xe182db8, 0x95631a8, 0xc001937b30)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.13.2/proto/go/provider.pb.go:2638 +0x8b
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1(0x95631a8, 0xc001937590, 0x866eb00, 0xc001483980, 0xc00109b8c0, 0xc0018f1ef0, 0x0, 0x0, 0x9475f00, 0xc0001179d0)
        /home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x30a
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Update_Handler(0x8762ac0, 0xc00000a3c0, 0x95631a8, 0xc001937590, 0xc001b03200, 0xc0015b5ea0, 0x95631a8, 0xc001937590, 0xc00177ad80, 0xd08)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.13.2/proto/go/provider.pb.go:2640 +0x150
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc00072b6c0, 0x958b0d8, 0xc000562180, 0xc0019407e0, 0xc0016cec90, 0xe13dbd0, 0x0, 0x0, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.37.0/server.go:1217 +0x52b
    google.golang.org/grpc.(*Server).handleStream(0xc00072b6c0, 0x958b0d8, 0xc000562180, 0xc0019407e0, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.37.0/server.go:1540 +0xd0c
    google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000550030, 0xc00072b6c0, 0x958b0d8, 0xc000562180, 0xc0019407e0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.37.0/server.go:878 +0xab
    created by google.golang.org/grpc.(*Server).serveStreams.func1
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.37.0/server.go:876 +0x1fd

Steps to reproduce

  1. Clone this project: https://github.com/pierskarsenbarg/callbacklambda-panic
  2. Run pulumi up
  3. Uncomment this line
  4. Run pulumi up
  5. See error

Expected: Code in lambda should update Actual: Error occurs

From pulumi about:

CLI          
Version      3.14.0
Go Version   go1.16.8
Go Compiler  gc

Plugins
NAME    VERSION
aws     4.23.0
docker  3.1.0
nodejs  unknown

Host     
OS       darwin
Version  11.6
Arch     x86_64

This project is written in nodejs (/Users/piers/.nvm/versions/node/v16.3.0/bin/node v16.3.0)

Current Stack: dev

TYPE                                               URN
pulumi:pulumi:Stack                                urn:pulumi:dev::callbacklambda-panic::pulumi:pulumi:Stack::callbacklambda-panic-dev
pulumi:providers:aws                               urn:pulumi:dev::callbacklambda-panic::pulumi:providers:aws::default_4_23_0
aws:iam/role:Role                                  urn:pulumi:dev::callbacklambda-panic::aws:iam/role:Role::lambdaRole
aws:iam/rolePolicyAttachment:RolePolicyAttachment  urn:pulumi:dev::callbacklambda-panic::aws:iam/rolePolicyAttachment:RolePolicyAttachment::lambdaRoleAttachment
aws:lambda/function:Function                       urn:pulumi:dev::callbacklambda-panic::aws:lambda/function:Function::mylambdaHandler


Found no pending operations associated with dev

Backend  
Name     pulumi.com
URL      https://app.pulumi.com/pierskarsenbarg
User     pierskarsenbarg

NAME            VERSION
@pulumi/aws     4.23.0
@pulumi/awsx    0.30.0
@pulumi/pulumi  3.14.0
@types/node     10.17.60

Pulumi locates its logs in /var/folders/69/3w1gr05s2pq36wn49bhyknym0000gn/T/ by default

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
aureqcommented, Oct 8, 2021

Also from another customer, we can confirm both v4.22.0 and v4.22.1 are working.

0reactions
pierskarsenbargcommented, Oct 7, 2021

Agree with @vinid223 - downgrading to v4.22.1 of the AWS provider works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Scope is not updating if used inside of callback function
Here is my code: HTML <div ng-app="myApp"> <div ng-controller="MainCtrl as mainCtrl"> Main {{mainCtrl.foo}} <br/> </div> </div>.
Read more >
FFI - The Rustonomicon
The callback function can then be sent through a registration call to the C library and afterwards be invoked from there. A basic...
Read more >
[Released] Panic Button - stop infinite loops in 1 second
Basically, it solves what you encounter when you accidentally enter an infinite loop during development. When it happens, the Unity editor ...
Read more >
BLE Disconnect error from within timers timeout callback ...
I use nRF5340 in the BLE Central role, I'm using a similar code like ... BLE Disconnect error from within timers timeout callback...
Read more >
What the Tick is Vue.nextTick? - Vue.js Developers
So we know that we can use nextTick() to pass a callback function that is executed right after the data is set and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found