What happened?
Panic: runtime error: invalid memory address or nil pointer dereference
What you expected to happen?
After switching from 0.1.38 to 0.1.39 eksctl create cluster -f cluster.yaml is broken for me
How to reproduce it?
Used config (cluster.yaml):
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: dev-eks
region: eu-central-1
vpc:
subnets:
private:
eu-central-1a: {id: subnet-00000000000000000}
eu-central-1b: {id: subnet-00000000000000001}
eu-central-1c: {id: subnet-00000000000000002}
nodeGroups:
- name: ng-1a
ami: ami-0b7127e7a2a38802a
instanceType: t3.medium
desiredCapacity: 1
availabilityZones: ["eu-central-1a"]
privateNetworking: true
ssh:
publicKeyName: bla.bla
iam:
attachPolicyARNs:
- arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy
- arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
- arn:aws:iam::000000000000:policy/ManageRoute53HostedZone
Versions
Please paste in the output of these commands:
$ eksctl version
[鈩筣 version.Info{BuiltAt:"", GitCommit:"", GitTag:"0.1.39"}
Logs
eksctl create cluster -f cluster.yaml
[鈩筣 using region eu-central-1
[鉁擼 using existing VPC (vpc-xxx) and subnets (private:[subnet-0... subnet-1... subnet-2...] public:[])
[!] custom VPC/subnets will be used; if resulting cluster doesn't function as expected, make sure to review the configuration of VPC/subnets
[鈩筣 nodegroup "ng-1a" will use "ami-0b7127e7a2a38802a" [AmazonLinux2/1.13]
[鈩筣 using EC2 key pair "bla.bla"
[鈩筣 using Kubernetes version 1.13
[鈩筣 creating EKS cluster "dev-eks" in "eu-central-1" region
[鈩筣 1 nodegroup (ng-1a) was included
[鈩筣 will create a CloudFormation stack for cluster itself and 1 nodegroup stack(s)
[鈩筣 if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=eu-central-1 --name=dev-eks'
[鈩筣 2 sequential tasks: { create cluster control plane "dev-eks", create nodegroup "ng-1a" }
[鈩筣 building cluster stack "eksctl-dev-eks-cluster"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x20ac393]
goroutine 51 [running]:
github.com/weaveworks/eksctl/pkg/cfn/builder.(*ClusterResourceSet).addOutputsForVPC(0xc00011a280)
/src/pkg/cfn/builder/vpc.go:160 +0x103
github.com/weaveworks/eksctl/pkg/cfn/builder.(*ClusterResourceSet).AddAllResources(0xc00011a280, 0xc00011a280, 0xc000550e80)
/src/pkg/cfn/builder/cluster.go:49 +0xac
github.com/weaveworks/eksctl/pkg/cfn/manager.(*StackCollection).createClusterTask(0xc000354f60, 0xc0000407e0, 0x60, 0x0)
/src/pkg/cfn/manager/cluster.go:33 +0x329
github.com/weaveworks/eksctl/pkg/cfn/manager.(*taskWithoutParams).Do(0xc00010f100, 0xc0000407e0, 0xc0000407e0, 0x1)
/src/pkg/cfn/manager/tasks.go:132 +0x34
github.com/weaveworks/eksctl/pkg/cfn/manager.doSingleTask(0xc000040780, 0x3a86800, 0xc00010f100, 0x0)
/src/pkg/cfn/manager/tasks.go:185 +0xec
github.com/weaveworks/eksctl/pkg/cfn/manager.doSequentialTasks(0xc000040780, 0xc00010f160, 0x2, 0x2)
/src/pkg/cfn/manager/tasks.go:215 +0x70
created by github.com/weaveworks/eksctl/pkg/cfn/manager.(*TaskTree).DoAllSync
/src/pkg/cfn/manager/tasks.go:115 +0x246
This will be fixed in the next PR. Please try the following work-around:
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: dev-eks
region: eu-central-1
vpc:
nat:
gateway: Disable
subnets:
private:
eu-central-1a: {id: subnet-00000000000000000}
eu-central-1b: {id: subnet-00000000000000001}
eu-central-1c: {id: subnet-00000000000000002}
To be clear, we are going to fix this in the next release.
The workaround is fine, thank you!
I ran into this issue today on v0.4.1. The workaround is still fine but not sure if it has to do with https://github.com/weaveworks/eksctl/pull/1161.
$ eksctl update cluster -f path/to/eks_cluster.yaml
[鈩筣 using region us-east-1
[!] NOTE: config file is used for finding cluster name and region
[!] NOTE: cluster VPC (subnets, routing & NAT Gateway) configuration changes are not yet implemented
[鈩筣 re-building cluster stack "my-cluster"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x21625d3]
goroutine 1 [running]:
github.com/weaveworks/eksctl/pkg/cfn/builder.(*ClusterResourceSet).addOutputsForVPC(0xc00012a410)
/src/pkg/cfn/builder/vpc.go:160 +0x103
github.com/weaveworks/eksctl/pkg/cfn/builder.(*ClusterResourceSet).AddAllResources(0xc00012a410, 0xc00012a410, 0xc000a0f858)
/src/pkg/cfn/builder/cluster.go:49 +0xac
github.com/weaveworks/eksctl/pkg/cfn/manager.(*StackCollection).AppendNewClusterStackResource(0xc000819650, 0xc000573001, 0xc000238780, 0xc000819650, 0x38e1580)
/src/pkg/cfn/manager/cluster.go:83 +0x612
github.com/weaveworks/eksctl/pkg/ctl/update.doUpdateClusterCmd(0xc00047ad80, 0xb, 0xc0002db080)
/src/pkg/ctl/update/cluster.go:101 +0x344
github.com/weaveworks/eksctl/pkg/ctl/update.updateClusterCmd.func1(0xc00060c000, 0xc0005f5ce0)
/src/pkg/ctl/update/cluster.go:22 +0x2a
github.com/weaveworks/eksctl/pkg/ctl/cmdutils.run(0xc0003089c0)
/src/pkg/ctl/cmdutils/cmd.go:105 +0x2b
github.com/weaveworks/eksctl/pkg/ctl/cmdutils.(*Cmd).SetRunFuncWithNameArg.func1(0xc000543900, 0xc000315260, 0x0, 0x2)
/src/pkg/ctl/cmdutils/cmd.go:100 +0x83
github.com/spf13/cobra.(*Command).execute(0xc000543900, 0xc000315220, 0x2, 0x2, 0xc000543900, 0xc000315220)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2ae
github.com/spf13/cobra.(*Command).ExecuteC(0xc000542000, 0xc0002b8780, 0x1, 0x1)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:850 +0x2fc
github.com/spf13/cobra.(*Command).Execute(...)
/go/pkg/mod/github.com/spf13/[email protected]/command.go:800
main.main()
/src/cmd/eksctl/main.go:71 +0x3fc
$eksctl version[鈩筣 version.Info{BuiltAt:"", GitCommit:"", GitTag:"0.4.1"}
Is this bug fixed currently? I encountered the same problem in 0.15.0.
Most helpful comment
To be clear, we are going to fix this in the next release.