openshift-ansible icon indicating copy to clipboard operation
openshift-ansible copied to clipboard

Seems like a problem of etcd. Job for origin-master.service failed because a timeout was exceeded.

Open jeffchanjunwei opened this issue 10 years ago • 31 comments

when i used the openshift-ansible to install, the origin-master.service started fail. after check the journal, it seems like a problem of etce which could not be found and invoked. Infor showed bellow

ansible-playbook ~/openshift-ansible/playbooks/byo/config.yml

TASK [openshift_master : Start and enable master] ****************************** fatal: [10.134.29.158]: FAILED! => {"changed": false, "failed": true, "msg": "Job for origin-master.service failed because a timeout was exceeded. See "systemctl status origin-master.service" and "journalctl -xe" for details.\n"}

(then run) systemctl status openshift-master.service

● openshift-master.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead)

journalctl -xe Jul 01 02:35:20 os-3-1-server-enb6fe2omdfu.novalocal origin-master[15396]: Content-Length: 0 Jul 01 02:35:22 os-3-1-server-enb6fe2omdfu.novalocal origin-master[15396]: E0701 02:35:22.017747 15396 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0 Jul 01 02:35:22 os-3-1-server-enb6fe2omdfu.novalocal origin-master[15396]: Content-Length: 0 Jul 01 02:35:23 os-3-1-server-enb6fe2omdfu.novalocal origin-master[15396]: E0701 02:35:23.224066 15396 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0

(several miniutes later) systemctl status origin-master.service

● origin-master.service - Origin Master Service Loaded: loaded (/usr/lib/systemd/system/origin-master.service; enabled; vendor preset: disabled) Active: activating (start) since Fri 2016-07-01 03:01:31 UTC; 25s ago Docs: https://github.com/openshift/origin Main PID: 15700 (openshift) CGroup: /system.slice/origin-master.service └─15700 /usr/bin/openshift start master --config=/etc/origin/master/master-config.yaml --loglevel=2

Jul 01 03:01:51 os-3-1-server-enb6fe2omdfu.novalocal origin-master[15700]: E0701 03:01:51.960769 15700 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0 Jul 01 03:01:51 os-3-1-server-enb6fe2omdfu.novalocal origin-master[15700]: Content-Length: 0 Jul 01 03:01:53 os-3-1-server-enb6fe2omdfu.novalocal origin-master[15700]: E0701 03:01:53.171694 15700 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0 Jul 01 03:01:53 os-3-1-server-enb6fe2omdfu.novalocal origin-master[15700]: Content-Length: 0

Versions openshift-ansible: lastest master centos7-1.6 openshift v1.2.0 kubernetes v1.2.0-36-g4a3f9c5 etcd 2.2.5

Additional Information archtecture of my openshfit Host Name Infrastructure Component to Install master.example.com Master and node node1.example.com Node node2.example.com Node

jeffchanjunwei avatar Jul 01 '16 03:07 jeffchanjunwei

The times I've seen this HTTP/0.0 has always been a proxy is configured but the proxy cannot reach the etcd host. So I'd wonder if you have a proxy configured in /etc/sysconfig/origin-master? If not then all I can think of is to verify that etcd is started and look at its logs.

sdodson avatar Jul 01 '16 13:07 sdodson

@sdodson , i doubt etcd is not successfully install on the master node. can i install it manully? The playbook of etcd is directly download from the github master branch, but i have no idea how to edit it.

jeffchanjunwei avatar Jul 04 '16 01:07 jeffchanjunwei

Getting same error

TASK [openshift_master : Start and enable master api on first master] **********
skipping: [ec2-23-20-115-254.compute-1.amazonaws.com]
fatal: [ec2-54-147-48-107.compute-1.amazonaws.com]: FAILED! => {"changed": false, "failed": true, "msg": "Job for origin-master-api.service failed because a timeout was exceeded. See \"systemctl status origin-master-api.service\" and \"journalctl -xe\" for details.\n"}

OpenShift cluster: 2 Master nodes 1 Worker node 3 total nodes 1 lb embedded etcd

Deepak-Vohra avatar Aug 08 '16 21:08 Deepak-Vohra

@dvohra Is there anything in the journal indicating what the start failure was?

journalctl -u origin-master-api -l

abutcher avatar Aug 08 '16 21:08 abutcher

Etcd failure response seems to be the issue, but a [etcd] is not configured and an embedded etcd is expected to be used.

Some command outputs for Master node on which api server failed:

systemctl status origin-master-api.service
origin-master-api.service - Atomic OpenShift Master API
   Loaded: loaded (/usr/lib/systemd/system/origin-master-api.service; enabled; vendor preset: disabled)
   Active: failed (Result: timeout) since Mon 2016-08-08 21:13:10 UTC; 9min ago
Aug 08 21:13:07 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 2...
Aug 08 21:13:07 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content...
Aug 08 21:13:08 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 2...
Aug 08 21:13:08 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content...
Aug 08 21:13:09 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 2...
Aug 08 21:13:09 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content...
Aug 08 21:13:10 ip-10-168-150-205 systemd[1]: origin-master-api.service star....
Aug 08 21:13:10 ip-10-168-150-205 systemd[1]: Failed to start Atomic OpenShi....
Aug 08 21:13:10 ip-10-168-150-205 systemd[1]: Unit origin-master-api.service....
Aug 08 21:13:10 ip-10-168-150-205 systemd[1]: origin-master-api.service failed.

journalctl -u origin-master-api -l
-- Logs begin at Mon 2016-08-08 20:05:20 UTC, end at Mon 2016-08-08 21:21:55 UTC. --
Aug 08 21:11:39 ip-10-168-150-205 systemd[1]: Starting Atomic OpenShift Master API...
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: I0808 21:11:40.026197   22228 start_api.go:102] Using a listen address override "0.0.0.0:8443"
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: W0808 21:11:40.028055   22228 start_master.go:270] assetConfig.loggingPublicURL: Invalid value:
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: W0808 21:11:40.028095   22228 start_master.go:270] assetConfig.metricsPublicURL: Invalid value:
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: I0808 21:11:40.041914   22228 plugins.go:71] No cloud provider specified.
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: I0808 21:11:40.043163   22228 genericapiserver.go:81] Adding storage destination for group
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: I0808 21:11:40.043201   22228 genericapiserver.go:81] Adding storage destination for group exte
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: I0808 21:11:40.043231   22228 start_master.go:383] Starting master on 0.0.0.0:8443 (v1.2.1)
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: I0808 21:11:40.043243   22228 start_master.go:384] Public master address is https://ec2-54-81-1
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: I0808 21:11:40.043262   22228 start_master.go:388] Using images from "openshift/origin-<compone
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:40.045935   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:40.071760   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:40.122593   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:40.223429   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:40.424236   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:40.825071   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:40 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:41 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:41.626177   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:41 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:42 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:42.627226   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:42 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:43 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:43.628290   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:43 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:44 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:44.629247   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:44 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0
Aug 08 21:11:45 ip-10-168-150-205 atomic-openshift-master-api[22228]: E0808 21:11:45.630314   22228 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Aug 08 21:11:45 ip-10-168-150-205 atomic-openshift-master-api[22228]: Content-Length: 0


Deepak-Vohra avatar Aug 08 '16 21:08 Deepak-Vohra

@dvohra Embedded etcd will only be used with the single master service origin-master.

abutcher avatar Aug 08 '16 21:08 abutcher

If [etcd] is used another issue is generated https://github.com/openshift/origin/issues/10259

Deepak-Vohra avatar Aug 08 '16 21:08 Deepak-Vohra

@dvohra Yep, I just found that one and submitted a PR for what I think is the problem.

abutcher avatar Aug 08 '16 21:08 abutcher

Thanks for submitting a PR for the other issue. HA Master can't be used till the other issue is fixed?

Deepak-Vohra avatar Aug 08 '16 21:08 Deepak-Vohra

@dvohra Right, without the etcd certificates we can't configure/start the etcd service.

abutcher avatar Aug 08 '16 21:08 abutcher

@dvohra Looks like we just merged it. Please give it a try when you can.

abutcher avatar Aug 08 '16 21:08 abutcher

Is a message such as the following usual. or restarting API server while installing could be an issue? FAILED - RETRYING: HANDLER: openshift_master: Verify API Server (80 tries left)

Deepak-Vohra avatar Aug 08 '16 22:08 Deepak-Vohra

While the earlier issue about [etcd] is fixed, installation does not complete. Shall open another issue.

Deepak-Vohra avatar Aug 08 '16 22:08 Deepak-Vohra

Closing.

abutcher avatar Aug 09 '16 03:08 abutcher

Hey, Installing on a CentOs 7 and still having this problem. I am running everything in one master. any pointers?

jmwenda avatar Oct 01 '16 00:10 jmwenda

@jmwenda Hey, I am still having this problem on a CentOs 7...Have u find solutions???

wsszh avatar Oct 31 '16 07:10 wsszh

@jmwenda @wsszh I also met the same problem on my CentOS 7 env. My version is openshift-ansible-openshift-ansible-3.2.14-1.tar.gz. I run ansible-playbook ~/openshift-ansible/playbooks/adhoc/uninstall.yml to uninstall it and reboot my env and then run ansible-playbook ~/openshift-ansible/playbooks/byo/config.yml to install again. It works!

xiangpengzhao avatar Nov 05 '16 05:11 xiangpengzhao

I'm running into this as well with a centos 7.2 myself

[stack@undercloud openshift-ansible]$ ssh [email protected] 'cat /etc/redhat-release'
CentOS Linux release 7.2.1511 (Core) 

And current head as of now. And here's how I'm running it:

bin/cluster create   -o image_name=centos-custom   -o external_net=ext-net   -o floating_ip_pool=ext-net   -o net_cidr=40.0.0.0/24   openstack test_cluster

Which results in a:

TASK [openshift_master : Start and enable master] ******************************
fatal: [test_cluster-master-0]: FAILED! => {"changed": false, "failed": true, "msg": "Job for origin-master.service failed because a timeout was exceeded. See \"systemctl status origin-master.service\" and \"journalctl -xe\" for details.\n"}

The journal gives me (repeatedly)

Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.029121   19858 reflector.go:203] github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/limitranger/admission.go:154: Failed to list
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.029212   19858 reflector.go:214] github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/resourcequota/resource_access.go:83: Failed 
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.029311   19858 reflector.go:214] github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/serviceaccount/admission.go:119: Failed to l
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.029413   19858 reflector.go:203] github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/namespace/lifecycle/admission.go:141: Failed
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.029506   19858 reflector.go:203] github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/limitranger/admission.go:154: Failed to list
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.029712   19858 reflector.go:214] github.com/openshift/origin/vendor/k8s.io/kubernetes/plugin/pkg/admission/serviceaccount/admission.go:103: Failed to l
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.375788   19858 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.User: client: etcd cluster is unavailable o
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.481789   19858 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.Group: client: etcd cluster is unavailable 
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.524174   19858 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.ClusterPolicy: client: etcd cluster is unav
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.551239   19858 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.ClusterPolicyBinding: client: etcd cluster 
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.566663   19858 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.PolicyBinding: client: etcd cluster is unav
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.608404   19858 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.Policy: client: etcd cluster is unavailable
Nov 05 13:46:14 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:14.769059   19858 cacher.go:220] unexpected ListAndWatch error: pkg/storage/cacher.go:163: Failed to list *api.OAuthAccessToken: client: etcd cluster is u
Nov 05 13:46:15 test-cluster-master-0.localdomain origin-master[19858]: E1105 13:46:15.014487   19858 etcd.go:146] etcd failure response: HTTP/0.0 0 status code 0
Nov 05 13:46:15 test-cluster-master-0.localdomain origin-master[19858]: Content-Length: 0

dougbtv avatar Nov 05 '16 17:11 dougbtv

Some additional info after getting some help from @abutcher (thanks!), I went and did a yum install -y etcd to get etcdctl and I wound up with this...

[root@test-cluster-master-0 openshift]# journalctl -u origin-master -n 1000 | grep -i 4001 | tail -n 1
Nov 07 17:32:22 test-cluster-master-0.localdomain openshift[26897]: published {Name:openshift.local ClientURLs:[https://192.168.23.4:4001]} to cluster 31e7965d9f02f32d
[root@test-cluster-master-0 openshift]# 
[root@test-cluster-master-0 openshift]# 
[root@test-cluster-master-0 openshift]# etcdctl --endpoints="https://192.168.23.4:4001" --cert-file /etc/origin/master/master.etcd-client.crt --key-file /etc/origin/master/master.etcd-client.key --ca-file /etc/origin/master/ca.crt cluster-health
cluster may be unhealthy: failed to list members
Error:  client: etcd cluster is unavailable or misconfigured
error #0: x509: certificate has expired or is not yet valid

dougbtv avatar Nov 07 '16 22:11 dougbtv

What are the validity periods on the certificates and is the system clock right on this host?

openssl x509 -in /etc/origin/master/master.etcd-client.crt -noout -text | grep Not
openssl x509 -in /etc/origin/master/etcd.server.crt -noout -text | grep Not
...

abutcher avatar Nov 07 '16 22:11 abutcher