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

Segfault: kops replace -f spec.yaml --force if cluster doesn't exist yet #3935

Closed
afirth opened this issue Nov 27, 2017 · 2 comments
Closed
Milestone

Comments

@afirth
Copy link
Member

afirth commented Nov 27, 2017

  1. What kops version are you running? The command kops version, will display
    this information.
    1. kops-1.8.0-beta.1
  2. What cloud provider are you using?
    1. AWS
  3. What commands did you run? What is the simplest way to reproduce this issue?
kops create $NAME
kops get $NAME -oyaml > spec.yaml
kops delete $NAME
kops replace -f spec.yaml --force
  1. What happened after the commands executed?
    1. segfault
  2. What did you expect to happen?
    1. cluster comes up
  3. Please run the commands with most verbose logging by adding the -v 10 flag.
kops replace -v10 -f ./manifests/kops/nameredacted --force
I1127 18:20:33.302057   11989 aws_utils.go:39] Querying EC2 for all valid regions
I1127 18:20:34.705499   11989 aws_cloud.go:948] Querying EC2 for all valid zones in region "us-east-1"
I1127 18:20:34.705665   11989 request_logger.go:45] AWS request: ec2/DescribeAvailabilityZones
I1127 18:20:34.983551   11989 status.go:57] Querying AWS for etcd volumes
I1127 18:20:34.983632   11989 status.go:68] Listing EC2 Volumes
I1127 18:20:34.983857   11989 request_logger.go:45] AWS request: ec2/DescribeVolumes
I1127 18:20:35.513892   11989 status.go:40] Cluster status (from cloud): {}
I1127 18:20:36.715943   11989 s3context.go:163] Found bucket "nameredacted-state" in region "us-east-1"
I1127 18:20:36.716009   11989 s3fs.go:176] Reading file "s3://nameredacted-state/nameredacted/config"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x2d8 pc=0x2149322]

goroutine 1 [running]:
k8s.io/kops/pkg/apis/kops/validation.ValidateClusterUpdate(0xc42012e400, 0xc420eee880, 0x0, 0x0, 0x0, 0x0)
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/pkg/apis/kops/validation/cluster.go:39 +0x262
k8s.io/kops/pkg/client/simple/vfsclientset.(*ClusterVFS).Update(0xc420e320a0, 0xc42012e400, 0xc420eee880, 0xc420b5afa0, 0x3, 0x3)
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/pkg/client/simple/vfsclientset/cluster.go:126 +0xd6
k8s.io/kops/pkg/client/simple/vfsclientset.(*VFSClientset).UpdateCluster(0xc420a96ec0, 0xc42012e400, 0xc420eee880, 0x0, 0x0, 0x0)
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/pkg/client/simple/vfsclientset/clientset.go:50 +0x4d
main.RunReplace(0xc420a63a00, 0xc4204b38c0, 0x571b920, 0xc420092008, 0xc420aaad80, 0x1, 0xc42000e4f8)
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/cmd/kops/replace.go:127 +0x5a1
main.NewCmdReplace.func1(0xc4204b38c0, 0xc420a7bb40, 0x0, 0x4)
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/cmd/kops/replace.go:76 +0x74
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).execute(0xc4204b38c0, 0xc420a7bb00, 0x4, 0x4, 0xc4204b38c0, 0xc420a7bb00)
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/vendor/github.com/spf13/cobra/command.go:603 +0x234
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x5912860, 0x34f5600, 0x0, 0x0)
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/vendor/github.com/spf13/cobra/command.go:689 +0x2fe
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).Execute(0x5912860, 0x5946670, 0x0)
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/vendor/github.com/spf13/cobra/command.go:648 +0x2b
main.Execute()
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/cmd/kops/root.go:95 +0x91
main.main()
	/private/tmp/kops-20171127-9784-1adfu3e/kops-1.8.0-beta.1/src/k8s.io/kops/cmd/kops/main.go:25 +0x20
  1. Anything else do we need to know?
    1. I think this is the same bug as segfault validating cluster update after changing cluster name #3470, but manifesting in a workflow that is meant for primetime soon wrt Add templating functionality for kops cluster.yaml files #2404
    2. workaround is to kops create $NAME first
@justinsb justinsb added this to the 1.8.0 milestone Nov 27, 2017
@chrislovecnm
Copy link
Contributor

You have to run create first, but we should not be segfaulting either.

@b0ric
Copy link

b0ric commented Sep 15, 2018

Still getting SEGFAULT during validation with the latest kops version:

$ kops version
Version 1.10.0
$ kops create -f cluster.yaml -v 10
I0916 00:12:28.220695   50720 factory.go:68] state store s3://redacted
I0916 00:12:28.254426   50720 aws_cloud.go:984] Querying EC2 for all valid zones in region "eu-west-1"
I0916 00:12:28.255394   50720 request_logger.go:45] AWS request: ec2/DescribeAvailabilityZones
I0916 00:12:29.014900   50720 subnets.go:49] All subnets have CIDRs; skipping assignment logic
I0916 00:12:29.014941   50720 defaults.go:213] Not setting up Proxy Excludes
W0916 00:12:29.014958   50720 defaults.go:126] Channel is not set; cannot determine KubernetesVersion from channel
W0916 00:12:29.014971   50720 defaults.go:146] Loading latest kubernetes version from "https://storage.googleapis.com/kubernetes-release/release/stable.txt"
I0916 00:12:29.015626   50720 context.go:159] Performing HTTP request: GET https://storage.googleapis.com/kubernetes-release/release/stable.txt
I0916 00:12:29.592092   50720 defaults.go:135] Using kubernetes latest stable version: v1.11.3
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x27fba5a]

goroutine 1 [running]:
k8s.io/kops/pkg/apis/kops/validation.ValidateCluster(0xc420980000, 0xc420a89700, 0x280bb76)
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/pkg/apis/kops/validation/legacy.go:236 +0x85a
k8s.io/kops/pkg/client/simple/vfsclientset.(*ClusterVFS).Create(0xc420febae0, 0xc420980000, 0xc4209801a8, 0x1, 0xc4204741b0)
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/pkg/client/simple/vfsclientset/cluster.go:101 +0x60
k8s.io/kops/pkg/client/simple/vfsclientset.(*VFSClientset).CreateCluster(0xc4209fe000, 0xc420980000, 0x0, 0x1e0, 0xc4204741b0)
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/pkg/client/simple/vfsclientset/clientset.go:56 +0x43
main.RunCreate(0xc420821820, 0x42f8b20, 0xc4200ea008, 0xc4208219e0, 0x0, 0x0)
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/cmd/kops/create.go:165 +0x3ff
main.NewCmdCreate.func1(0xc420188f00, 0xc4204178c0, 0x0, 0x4)
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/cmd/kops/create.go:95 +0x66
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).execute(0xc420188f00, 0xc420417800, 0x4, 0x4, 0xc420188f00, 0xc420417800)
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/vendor/github.com/spf13/cobra/command.go:757 +0x2c1
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x5e947c0, 0x3670c00, 0x0, 0x0)
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/vendor/github.com/spf13/cobra/command.go:843 +0x30a
k8s.io/kops/vendor/github.com/spf13/cobra.(*Command).Execute(0x5e947c0, 0x5ec90f0, 0x0)
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/vendor/github.com/spf13/cobra/command.go:791 +0x2b
main.Execute()
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/cmd/kops/root.go:96 +0x87
main.main()
	/private/tmp/kops-20180816-57336-e3eitv/kops-1.10.0/src/k8s.io/kops/cmd/kops/main.go:25 +0x20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants