OSX Sierra: Intermittent EC2 'x509: certificate signed by unknown authority' and 'Error while querying for valid regions' errors
Hi,
Just after swapping out my kops binary built from head by homebrew for a stable 1.5.1 downloaded from github, I ran into some AWS errors while trying to update the instance size of my nodes. The following all happened within seconds of each other, without any other actions in between:
~/R/k8s-temp $ kops update cluster $CLUSTER_NAME
I0207 15:58:39.491765 10888 executor.go:91] Tasks: 0 done / 65 total; 30 can run
I0207 15:58:40.608342 10888 executor.go:91] Tasks: 30 done / 65 total; 13 can run
I0207 15:58:41.354085 10888 executor.go:91] Tasks: 43 done / 65 total; 18 can run
I0207 15:58:46.408552 10888 executor.go:91] Tasks: 61 done / 65 total; 4 can run
I0207 15:58:46.730213 10888 executor.go:91] Tasks: 65 done / 65 total; 0 can run
Will create resources:
....
~/R/k8s-temp $ kops update cluster $CLUSTER_NAME --yes
Got an error while querying for valid regions (verify your AWS credentials?)
~/R/k8s-temp $ aws ec2 describe-regions
----------------------------------------------------------
| DescribeRegions |
+--------------------------------------------------------+
|| Regions ||
|+-----------------------------------+------------------+|
|| Endpoint | RegionName ||
|+-----------------------------------+------------------+|
|| ec2.ap-south-1.amazonaws.com | ap-south-1 ||
|| ec2.eu-west-2.amazonaws.com | eu-west-2 ||
|| ec2.eu-west-1.amazonaws.com | eu-west-1 ||
|| ec2.ap-northeast-2.amazonaws.com | ap-northeast-2 ||
|| ec2.ap-northeast-1.amazonaws.com | ap-northeast-1 ||
|| ec2.sa-east-1.amazonaws.com | sa-east-1 ||
|| ec2.ca-central-1.amazonaws.com | ca-central-1 ||
|| ec2.ap-southeast-1.amazonaws.com | ap-southeast-1 ||
|| ec2.ap-southeast-2.amazonaws.com | ap-southeast-2 ||
|| ec2.eu-central-1.amazonaws.com | eu-central-1 ||
|| ec2.us-east-1.amazonaws.com | us-east-1 ||
|| ec2.us-east-2.amazonaws.com | us-east-2 ||
|| ec2.us-west-1.amazonaws.com | us-west-1 ||
|| ec2.us-west-2.amazonaws.com | us-west-2 ||
|+-----------------------------------+------------------+|
~/R/k8s-temp $ kops update cluster $CLUSTER_NAME --yes
I0207 16:00:00.633043 11258 executor.go:91] Tasks: 0 done / 65 total; 30 can run
I0207 16:00:02.003423 11258 executor.go:91] Tasks: 30 done / 65 total; 13 can run
I0207 16:00:02.672578 11258 executor.go:91] Tasks: 43 done / 65 total; 18 can run
I0207 16:00:14.178153 11258 executor.go:91] Tasks: 61 done / 65 total; 4 can run
I0207 16:00:14.761233 11258 executor.go:91] Tasks: 65 done / 65 total; 0 can run
...
~/R/k8s-temp $ kops rolling-update cluster $CLUSTER_NAME
NAME STATUS NEEDUPDATE READY MIN MAX NODES
master-us-east-1a NeedsUpdate 1 0 1 1 1
master-us-east-1d NeedsUpdate 1 0 1 1 1
master-us-east-1e NeedsUpdate 1 0 1 1 1
nodes NeedsUpdate 2 0 2 2 2
Must specify --yes to rolling-update
~/R/k8s-temp $ kops rolling-update cluster $CLUSTER_NAME --yes
error reading cluster configuration: error reading cluster configuration "k8s.example.com": error reading s3://k8s-state.example.com/k8s.example.com/config: Unable to list AWS regions: RequestError: send request failed
caused by: Post https://ec2.us-east-1.amazonaws.com/: x509: certificate signed by unknown authority
~/R/k8s-temp $ kops rolling-update cluster $CLUSTER_NAME
NAME STATUS NEEDUPDATE READY MIN MAX NODES
master-us-east-1a NeedsUpdate 1 0 1 1 1
master-us-east-1d NeedsUpdate 1 0 1 1 1
master-us-east-1e NeedsUpdate 1 0 1 1 1
nodes NeedsUpdate 2 0 2 2 2
Must specify --yes to rolling-update
~/R/k8s-temp $ kops rolling-update cluster $CLUSTER_NAME --yes
Got an error while querying for valid regions (verify your AWS credentials?)
~/R/k8s-temp $ kops version
Version 1.5.1 (git-01deca8)
~/R/k8s-temp $ aws ec2 describe-regions
----------------------------------------------------------
| DescribeRegions |
+--------------------------------------------------------+
|| Regions ||
|+-----------------------------------+------------------+|
|| Endpoint | RegionName ||
|+-----------------------------------+------------------+|
|| ec2.ap-south-1.amazonaws.com | ap-south-1 ||
|| ec2.eu-west-2.amazonaws.com | eu-west-2 ||
|| ec2.eu-west-1.amazonaws.com | eu-west-1 ||
|| ec2.ap-northeast-2.amazonaws.com | ap-northeast-2 ||
|| ec2.ap-northeast-1.amazonaws.com | ap-northeast-1 ||
|| ec2.sa-east-1.amazonaws.com | sa-east-1 ||
|| ec2.ca-central-1.amazonaws.com | ca-central-1 ||
|| ec2.ap-southeast-1.amazonaws.com | ap-southeast-1 ||
|| ec2.ap-southeast-2.amazonaws.com | ap-southeast-2 ||
|| ec2.eu-central-1.amazonaws.com | eu-central-1 ||
|| ec2.us-east-1.amazonaws.com | us-east-1 ||
|| ec2.us-east-2.amazonaws.com | us-east-2 ||
|| ec2.us-west-1.amazonaws.com | us-west-1 ||
|| ec2.us-west-2.amazonaws.com | us-west-2 ||
|+-----------------------------------+------------------+|
I waited for 15-20 minutes after before trying again and the rolling update completed without issues. AWS Status didn't report anything out of the ordinary and my regular connectivity on my machine also seemed unaffected. My clock is also pointing to the correct time.
For me, the 'certificate signed by unknown authority' error occurs roughly 50% of the time. This is with version 1.5.3 on macOS Sierra.
It doesn't seem to only relate to AWS API calls, but any HTTP request. For example, this one:
error reading channel "https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable": error fetching "https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable": Get https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable: x509: certificate signed by unknown authority
When I get this error, I just immediately repeat the same kops command and it will usually succeed the second time.
I've also been seeing these errors. It can manifest itself on any number of different operations but the underlying error is always the same: x509: certificate signed by unknown authority. Retrying (sometimes several times) will eventually result in a success.
MacOS 10.12.1, Kops Version 1.5.3 (git-46364f6), Kubectl v1.5.3
error reading channel "https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable": error fetching "https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable": Get https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable: x509: certificate signed by unknown authority
I0417 10:35:01.346944 11790 apply_cluster.go:701] error reading hash file "https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/linux/amd64/kubelet.sha1": error fetching "https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/linux/amd64/kubelet.sha1": Get https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/linux/amd64/kubelet.sha1: x509: certificate signed by unknown authority
cannot determine hash for https://storage.googleapis.com/kubernetes-release/release/v1.5.2/bin/linux/amd64/kubelet (have you specified a valid KubernetesVersion?)
I think this is fixed. Any updates?
I have not seen this again since my original report.
Happens to me every couple of days. For example just now:
error reading channel "https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable": error fetching "https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable": Get https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable: dial tcp: lookup raw.githubusercontent.com on 192.168.10.1:53: read udp 192.168.10.207:62475->192.168.10.1:53: i/o timeout
@rotemtam that looks more like a network connection issue while resolving the github DNS name on your machine.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle rotten /remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close
error reading channel "https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable": error fetching "https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable": Get https://raw.githubusercontent.com/kubernetes/kops/master/channels/stable: x509: certificate signed by unknown authority
Past 1 week i am keep on trying but there is no change at all.facing the error.
/reopen /remove-lifecycle rotten
Just ran into this myself.
@flowchartsman: you can't re-open an issue/PR unless you authored it or you are assigned to it.
In response to this:
/reopen /remove-lifecycle rotten
Just ran into this myself.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.