ibotty / openshift-letsencrypt

MIT License
59 stars 31 forks source link

Watcher dying every 2 minutes #16

Closed jam13 closed 7 years ago

jam13 commented 7 years ago

My watcher container always dies and respawns after running for 2 minutes.

The problem seems to be with curl making api calls to the routes resource. It receives data but then after 60 seconds it times out thinking there is outstanding read data. The second (debugging?) curl call does the same thing, giving a total of 2 minutes.

Here's an example trace with curl running verbose:

*   Trying 172.30.0.1...
* Connected to openshift.default (172.30.0.1) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /run/secrets/kubernetes.io/serviceaccount/ca.crt
  CApath: none
* NSS: client certificate not found (nickname not specified)
* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate:
*   subject: CN=10.0.0.10
*   start date: May 15 11:43:00 2017 GMT
*   expire date: May 15 11:43:01 2019 GMT
*   common name: 10.0.0.10
*   issuer: CN=openshift-signer@1494848580
> GET /oapi/v1/namespaces/foo/routes/?watch&labelSelector=butter.sh/letsencrypt-managed=yes HTTP/1.1
> User-Agent: curl/7.29.0
> Host: openshift.default
> Accept: */*
> Authorization: Bearer 12345678...
> 
< HTTP/1.1 200 OK
< Cache-Control: no-store
< Content-Type: application/json
< Date: Thu, 18 May 2017 12:13:18 GMT
< Transfer-Encoding: chunked
< 
{ [data not shown]
Processing route /oapi/v1/namespaces/foo/routes/jenkins with domain jenkins.example.com.
Certificate for jenkins.example.com still valid long enough.
Processing route /oapi/v1/namespaces/foo/routes/api with domain api.example.com.
Certificate for api.example.com still valid long enough.
Processing route /oapi/v1/namespaces/foo/routes/www with domain www.example.com.
Certificate for www.example.com still valid long enough.

100 25339    0 25339    0     0  21388      0 --:--:--  0:00:01 --:--:-- 21401
100 25339    0 25339    0     0  11592      0 --:--:--  0:00:02 --:--:-- 11596
100 25339    0 25339    0     0   7950      0 --:--:--  0:00:03 --:--:--  7953
100 25339    0 25339    0     0   6051      0 --:--:--  0:00:04 --:--:--  6051
100 25339    0 25339    0     0   4883      0 --:--:--  0:00:05 --:--:--  4884
100 25339    0 25339    0     0   4094      0 --:--:--  0:00:06 --:--:--     0
100 25339    0 25339    0     0   3524      0 --:--:--  0:00:07 --:--:--     0
100 25339    0 25339    0     0   3093      0 --:--:--  0:00:08 --:--:--     0
100 25339    0 25339    0     0   2756      0 --:--:--  0:00:09 --:--:--     0
100 25339    0 25339    0     0   2485      0 --:--:--  0:00:10 --:--:--     0
100 25339    0 25339    0     0   2263      0 --:--:--  0:00:11 --:--:--     0
100 25339    0 25339    0     0   2077      0 --:--:--  0:00:12 --:--:--     0
100 25339    0 25339    0     0   1920      0 --:--:--  0:00:13 --:--:--     0
100 25339    0 25339    0     0   1784      0 --:--:--  0:00:14 --:--:--     0
100 25339    0 25339    0     0   1667      0 --:--:--  0:00:15 --:--:--     0
100 25339    0 25339    0     0   1564      0 --:--:--  0:00:16 --:--:--     0
100 25339    0 25339    0     0   1473      0 --:--:--  0:00:17 --:--:--     0
100 25339    0 25339    0     0   1392      0 --:--:--  0:00:18 --:--:--     0
100 25339    0 25339    0     0   1319      0 --:--:--  0:00:19 --:--:--     0
100 25339    0 25339    0     0   1254      0 --:--:--  0:00:20 --:--:--     0
100 25339    0 25339    0     0   1194      0 --:--:--  0:00:21 --:--:--     0
100 25339    0 25339    0     0   1141      0 --:--:--  0:00:22 --:--:--     0
100 25339    0 25339    0     0   1091      0 --:--:--  0:00:23 --:--:--     0
100 25339    0 25339    0     0   1046      0 --:--:--  0:00:24 --:--:--     0
100 25339    0 25339    0     0   1005      0 --:--:--  0:00:25 --:--:--     0
100 25339    0 25339    0     0    966      0 --:--:--  0:00:26 --:--:--
     0
100 25339    0 25339    0     0    931      0 --:--:--  0:00:27 --:--:--     0
100 25339    0 25339    0     0    898      0 --:--:--  0:00:28 --:--:--     0
100 25339    0 25339    0     0    867      0 --:--:--  0:00:29 --:--:--     0
100 25339    0 25339    0     0    838      0 --:--:--  0:00:30 --:--:--     0
100 25339    0 25339    0     0    811      0 --:--:--  0:00:31 --:--:--     0
100 25339    0 25339    0     0    786      0 --:--:--  0:00:32 --:--:--     0
100 25339    0 25339    0     0    762      0 --:--:--  0:00:33 --:--:--     0
100 25339    0 25339    0     0    740      0 --:--:--  0:00:34 --:--:--     0
100 25339    0 25339    0     0    719      0 --:--:--  0:00:35 --:--:--     0
100 25339    0 25339    0     0    699      0 --:--:--  0:00:36 --:--:--     0
100 25339    0 25339    0     0    680      0 --:--:--  0:00:37 --:--:--     0
100 25339    0 25339    0     0    662      0 --:--:--  0:00:38 --:--:--     0
100 25339    0 25339    0     0    645      0 --:--:--  0:00:39 --:--:--     0
100 25339    0 25339    0     0    629      0 --:--:--  0:00:40 --:--:--     0
100 25339    0 25339    0     0    614      0 --:--:--  0:00:41 --:--:--     0
100 25339    0 25339    0     0    600      0 --:--:--  0:00:42 --:--:--     0
100 25339    0 25339    0     0    586      0 --:--:--  0:00:43 --:--:--     0
100 25339    0 25339    0     0    572      0 --:--:--  0:00:44 --:--:--     0
100 25339    0 25339    0     0    560      0 --:--:--  0:00:45 --:--:--     0
100 25339    0 25339    0     0    548      0 --:--:--  0:00:46 --:--:--     0
100 25339    0 25339    0     0    536      0 --:--:--  0:00:47 --:--:--     0
100 25339    0 25339    0     0    525      0 --:--:--  0:00:48 --:--:--     0
100 25339    0 25339    0     0    514      0 --:--:--  0:00:49 --:--:--     0
100 25339    0 25339    0     0    504      0 --:--:--  0:00:50 --:--:--     0
100 25339    0 25339    0     0    494      0 --:--:--  0:00:51 --:--:--     0
100 25339    0 25339    0     0    485      0 --:--:--  0:00:52 --
:--:--     0
100 25339    0 25339    0     0    475      0 --:--:--  0:00:53 --:--:--     0
100 25339    0 25339    0     0    467      0 --:--:--  0:00:54 --:--:--     0
100 25339    0 25339    0     0    458      0 --:--:--  0:00:55 --:--:--     0
100 25339    0 25339    0     0    450      0 --:--:--  0:00:56 --:--:--     0
100 25339    0 25339    0     0    442      0 --:--:--  0:00:57 --:--:--     0
100 25339    0 25339    0     0    435      0 --:--:--  0:00:58 --:--:--     0
100 25339    0 25339    0     0    427      0 --:--:--  0:00:59 --:--:--     0* transfer closed with outstanding read data remaining

100 25339    0 25339    0     0    421      0 --:--:--  0:01:00 --:--:--     0
* Closing connection 0
curl: (18) NSS: client certificate not found (nickname not specified)
jam13 commented 7 years ago

If you make this call against the API, you'll see the problem:

curl -v -N -H "Authorization: Bearer xxxxxxxx" \
https://openshift.example.com/oapi/v1/namespaces/myproject/routes/?watch&labelSelector=butter.sh/letsencrypt-managed=yes

after about 60 seconds I see:

* transfer closed with outstanding read data remaining
* Closing connection 0
curl: (18) NSS: client certificate not found (nickname not specified)
ibotty commented 7 years ago

Sorry, I missed your bug report.

Unfortunately I cannot reproduce the problem. Is there a proxy between openshift.example.com and 172.30.0.1 (or whatever openshift.default is)? Maybe that one is closing the connection.

I assume (from the logs above) that it also happens when getting using 172.30.0.1, but can you please confirm? Please also test (if you have access) on the nodes itself: on the master node (where origin-master is running) and any other node.

jam13 commented 7 years ago

I think this is probably only with Openshift 1.5. Changing the call from watch to watch=true (which is the documented form) solved the problem.