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

[Bug]: ec2 instance not ready and not syncing with Observed a panic: value is null #1579

Open
1 task done
tyu0912 opened this issue Nov 28, 2024 · 3 comments
Open
1 task done
Labels
bug Something isn't working impact:medium is:triaged Indicates that an issue has been reviewed.

Comments

@tyu0912
Copy link

tyu0912 commented Nov 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Affected Resource(s)

ec2.aws.upbound.io/v1beta1 - Instance

Resource MRs required to reproduce the bug

apiVersion: ec2.aws.upbound.io/v1beta1
kind: Instance
metadata:
  labels:
    testing.upbound.io/example-name: platform-demo-test
  name: platform-demo-test
spec:
  # Instance configuration
  forProvider:
    ami: ami-0453ec754f44f9a4a
    instanceType: t2.micro
    region: us-east-1
    subnetId: <my-subnet>
  
  # Reference credentials
  providerConfigRef:
    name: default

Steps to Reproduce

Following the guide here. The only difference is that I'm making an EC2 instance instead of S3.

https://docs.crossplane.io/latest/getting-started/provider-aws/

What happened?

Hi, this may be simple but while playing around with crossplane, the instance I create does get sync or get to a ready state even though on AWS, I can see it created

image image

Error log from provider-aws-ec2 pod

E1128 23:15:17.869739       1 runtime.go:77] Observed a panic: value is null
goroutine 13029 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic({0x175a9e60, 0x1db8faf0})
    k8s.io/[email protected]/pkg/util/runtime/runtime.go:75 +0x7c
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
    sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:108 +0xa4
panic({0x175a9e60?, 0x1db8faf0?})
    runtime/panic.go:785 +0x124
github.com/hashicorp/go-cty/cty.Value.LengthInt({{{0x1dea7df8?, 0x4009ed6da0?}}, {0x0?, 0x0?}})
    github.com/hashicorp/[email protected]/cty/value_ops.go:989 +0x254
github.com/hashicorp/terraform-provider-aws/internal/tags.GetAnyAttr({{{0x1dea7d88?, 0x400ca97e30?}}, {0x181b02c0?, 0x40060cd6b0?}}, {0x1ab529a8, 0x19}, 0x0)
    github.com/hashicorp/[email protected]/internal/tags/key_value_tags.go:804 +0x2d8
github.com/hashicorp/terraform-provider-aws/internal/tags.KeyValueTags.ResolveDuplicates(0x400616b4d8, {0x1dea72b8, 0x4006554f30}, 0x0, 0x0, {0x1de9cf60, 0x400d6f1300}, {0x1ab529a8, 0x19}, 0x0)
    github.com/hashicorp/[email protected]/internal/tags/key_value_tags.go:834 +0x204
github.com/hashicorp/terraform-provider-aws/internal/service/ec2.readBlockDevicesFromInstance({0x1dea72b8, 0x4006554f30}, 0x400d6f1300, {0x1aa07b40, 0x40074f95f0}, 0x4000bb0848, 0x0)
    github.com/hashicorp/[email protected]/internal/service/ec2/ec2_instance.go:2385 +0xe40
github.com/hashicorp/terraform-provider-aws/internal/service/ec2.readBlockDevices({0x1dea72b8?, 0x4006554f30?}, 0x400d6f1300, {0x1aa07b40?, 0x40074f95f0?}, 0x0?, 0x0?)
    github.com/hashicorp/[email protected]/internal/service/ec2/ec2_instance.go:2240 +0x34
github.com/hashicorp/terraform-provider-aws/internal/service/ec2.resourceInstanceRead({0x1dea72b8, 0x4006554f30}, 0x400d6f1300, {0x1aa07b40, 0x40074f95f0})
    github.com/hashicorp/[email protected]/internal/service/ec2/ec2_instance.go:1353 +0x23d0
github.com/hashicorp/terraform-provider-aws/internal/provider.New.(*wrappedResource).Read.interceptedHandler[...].func10(0x400d6f1300?, {0x1aa07b40?, 0x40074f95f0})
    github.com/hashicorp/[email protected]/internal/provider/intercept.go:113 +0x1d8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x1dea7360?, {0x1dea7360?, 0x400100c2a0?}, 0xd?, {0x1aa07b40?, 0x40074f95f0?})
    github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:818 +0x64
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0x40026e7a40, {0x1dea7360, 0x400100c2a0}, 0x400546f2b0, {0x1aa07b40, 0x40074f95f0})
    github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1117 +0x404
github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKExternal).Observe(0x4001ada000, {0x1dea7360, 0x400100c2a0}, {0x1e02b7b8, 0x40021dea88})
    github.com/crossplane/[email protected]/pkg/controller/external_tfpluginsdk.go:472 +0x138
github.com/crossplane/upjet/pkg/controller.(*terraformPluginSDKAsyncExternal).Observe(0x40072174a0, {0x1dea7360, 0x400100c2a0}, {0x1e02b7b8, 0x40021dea88})
    github.com/crossplane/[email protected]/pkg/controller/external_async_tfpluginsdk.go:127 +0x88
github.com/crossplane/crossplane-runtime/pkg/reconciler/managed.(*Reconciler).Reconcile(0x400d793a00, {0x1dea72b8, 0x4002793ec0}, {{{0x0, 0x0}, {0x400ffc7788, 0x12}}})
    github.com/crossplane/[email protected]/pkg/reconciler/managed/reconciler.go:914 +0x1a94
github.com/crossplane/crossplane-runtime/pkg/ratelimiter.(*Reconciler).Reconcile(0x400d78d680, {0x1dea72b8, 0x4002793ec0}, {{{0x0?, 0x5?}, {0x400ffc7788?, 0x40060e0d08?}}})
    github.com/crossplane/[email protected]/pkg/ratelimiter/reconciler.go:54 +0x124
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x1ded7a50?, {0x1dea72b8?, 0x4002793ec0?}, {{{0x0?, 0xb?}, {0x400ffc7788?, 0x0?}}})
    sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:119 +0x80
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0x400d7c4140, {0x1dea72f0, 0x400149a780}, {0x19402180, 0x400781c1a0})
    sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:316 +0x2d0
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0x400d7c4140, {0x1dea72f0, 0x400149a780})
    sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266 +0x158
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
    sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227 +0x70
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 4008
    sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:223 +0x400

Relevant Error Output Snippet

update failed: async update failed: recovered from panic: value is null

Crossplane Version

1.18.0

Provider Version

1.17.0

Kubernetes Version

No response

Kubernetes Distribution

k3d

Additional Info

No response

@tyu0912 tyu0912 added bug Something isn't working needs:triage labels Nov 28, 2024
@tyu0912 tyu0912 changed the title [Bug]: ec2 instance not ready and not syncing [Bug]: ec2 instance not ready and not syncing with Observed a panic: value is null Nov 29, 2024
@tyu0912
Copy link
Author

tyu0912 commented Nov 29, 2024

I tried with provider-aws-ec2:v1.16.0 and it worked. This seems to be a bug within the 1.17.0 version possibly due to the TF update.

@turkenf
Copy link
Collaborator

turkenf commented Nov 30, 2024

Hi @tyu0912,

Thank you for bringing up this. This issue can be reproducible with our base example.

- lastTransitionTime: "2024-11-30T10:26:16Z"
    message: 'update failed: async update failed: recovered from panic: value is null'
    reason: ReconcileError
    status: "False"
    type: Synced

@turkenf turkenf added impact:medium is:triaged Indicates that an issue has been reviewed. and removed needs:triage labels Nov 30, 2024
@tyu0912
Copy link
Author

tyu0912 commented Nov 30, 2024

Appreciate the confirmation. Let me know if there's any assistance I can provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working impact:medium is:triaged Indicates that an issue has been reviewed.
Projects
None yet
Development

No branches or pull requests

2 participants