You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2019/08/01 23:21:58 UTC
[GitHub] [trafficcontrol] rawlinp opened a new issue #3769: CIAB certificate
addition issues causes infinite loop on startup
rawlinp opened a new issue #3769: CIAB certificate addition issues causes infinite loop on startup
URL: https://github.com/apache/trafficcontrol/issues/3769
<!--
************ STOP!! ************
If this issue identifies a security vulnerability, DO NOT submit it! Instead, contact
the Apache Software Foundation Security Team at security@trafficcontrol.apache.org and follow the
guidelines at https://www.apache.org/security/ regarding vulnerability disclosure.
-->
<!--
- For *SUPPORT QUESTIONS*, use the
[Traffic Control slack channels](https://traffic-control-cdn.slack.com) or [Traffic Control mailing lists](http://trafficcontrol.apache.org/mailing_lists/).
- Before submitting, please **SEARCH GITHUB** for a similar issue or PR. -->
## I'm submitting a ...
<!-- (check all that apply with "[x]") -->
<!--- security vulnerability (STOP!! - see above)-->
- [x] bug report
- [ ] new feature / enhancement request
- [ ] improvement request (usability, performance, tech debt, etc.)
- [ ] other <!--(Please do not submit support requests here - see above)-->
## Traffic Control components affected ...
<!-- (check all that apply with "[x]") -->
- [x] CDN in a Box
- [ ] Documentation
- [ ] Grove
- [ ] Traffic Control Client
- [ ] Traffic Monitor
- [ ] Traffic Ops
- [ ] Traffic Ops ORT
- [ ] Traffic Portal
- [ ] Traffic Router
- [ ] Traffic Stats
- [ ] Traffic Vault
- [ ] unknown
## Current behavior:
<!-- Describe how the bug manifests / how the current features are insufficient. -->
When starting up CIAB, sometimes it gets stuck in a loop where it continually calls the TO API with empty cert input:
```
trafficops_1 | ++ to-post api/1.4/deliveryservices/sslkeys/add '{
trafficops_1 | "cdn": "CDN-in-a-Box",
trafficops_1 | "certificate": {
trafficops_1 | "crt": "",
trafficops_1 | "csr": "",
trafficops_1 | "key": ""
trafficops_1 | },
trafficops_1 | "deliveryservice": "demo1",
trafficops_1 | "hostname": "*.demo1.mycdn.ciab.test",
trafficops_1 | "key": "demo1",
trafficops_1 | "version": 1
trafficops_1 | }'
trafficops_1 | ++ local t
trafficops_1 | ++ local data
trafficops_1 | ++ [[ -z {
trafficops_1 | "cdn": "CDN-in-a-Box",
trafficops_1 | "certificate": {
trafficops_1 | "crt": "",
trafficops_1 | "csr": "",
trafficops_1 | "key": ""
trafficops_1 | },
trafficops_1 | "deliveryservice": "demo1",
trafficops_1 | "hostname": "*.demo1.mycdn.ciab.test",
trafficops_1 | "key": "demo1",
trafficops_1 | "version": 1
trafficops_1 | } ]]
trafficops_1 | ++ [[ -f {
trafficops_1 | "cdn": "CDN-in-a-Box",
trafficops_1 | "certificate": {
trafficops_1 | "crt": "",
trafficops_1 | "csr": "",
trafficops_1 | "key": ""
trafficops_1 | },
trafficops_1 | "deliveryservice": "demo1",
trafficops_1 | "hostname": "*.demo1.mycdn.ciab.test",
trafficops_1 | "key": "demo1",
trafficops_1 | "version": 1
trafficops_1 | } ]]
trafficops_1 | +++ mktemp
trafficops_1 | ++ t=/tmp/tmp.g9weCBLU2B
trafficops_1 | ++ echo '{' '"cdn":' '"CDN-in-a-Box",' '"certificate":' '{' '"crt":' '"",' '"csr":' '"",' '"key":' '""' '},' '"deliveryservice":' '"demo1",' '"hostname":' '"*.demo1.mycdn.ciab.test",' '"key":' '"demo1",' '"version":' 1 '}'
trafficops_1 | ++ data='--data @/tmp/tmp.g9weCBLU2B'
trafficops_1 | ++ to-auth
trafficops_1 | ++ [[ -z https://trafficops.infra.ciab.test:443 ]]
trafficops_1 | ++ [[ -z admin ]]
trafficops_1 | ++ [[ -z twelve ]]
trafficops_1 | ++ cookie_current /tmp/tmp.aO15EzejCT
trafficops_1 | ++ local cookiefile=/tmp/tmp.aO15EzejCT
trafficops_1 | ++ [[ -s /tmp/tmp.aO15EzejCT ]]
trafficops_1 | +++ awk '/mojolicious/ {print $5}' /tmp/tmp.aO15EzejCT
trafficops_1 | +++ tail -n 1
trafficops_1 | ++ exp=1564721547
trafficops_1 | +++ date +%s
trafficops_1 | ++ cur=1564700655
trafficops_1 | ++ (( 1564721547 > 1564700655 ))
trafficops_1 | ++ return
trafficops_1 | ++ curl -k -LfsS -H 'Content-Type: application/json;charset=UTF-8' --cookie /tmp/tmp.aO15EzejCT -X POST --data @/tmp/tmp.g9weCBLU2B https://trafficops.infra.ciab.test:443/api/1.4/deliveryservices/sslkeys/add
edge_1 | + to-get api/1.3/cdns/name/CDN-in-a-Box/sslkeys
edge_1 | + to-auth
edge_1 | + [[ -z https://trafficops.infra.ciab.test:443 ]]
edge_1 | + [[ -z admin ]]
edge_1 | + [[ -z twelve ]]
edge_1 | + cookie_current /tmp/tmp.3SLWasQmrd
edge_1 | + local cookiefile=/tmp/tmp.3SLWasQmrd
edge_1 | + [[ -s /tmp/tmp.3SLWasQmrd ]]
trafficops_1 | INFO: routing.go:196: 2019-08-01T23:04:16.05390824Z: POST /api/1.4/deliveryservices/sslkeys/add handling (reqid 2440)
edge_1 | ++ awk '/mojolicious/ {print $5}' /tmp/tmp.3SLWasQmrd
trafficops_1 | DEBUG: plugin.go:178: 2019-08-01T23:04:16.05414433Z: DEBUG plugins.OnRequest calling 0 plugins
edge_1 | ++ tail -n 1
trafficops_1 | DEBUG: api.go:134: 2019-08-01T23:04:16.056513174Z: parsing request: validating: missing fields: certificate.key required; certificate.crt required; certificate.csr required
```
In the past, it's been thought that simply running `docker-compose down -v` to remove the created volumes and `rm -r traffic_ops/ca` to remove that directory should be enough to prevent this loop from occurring, but that doesn't seem to work for me every time.
## Expected / new behavior:
<!-- Describe what the behavior would be without the bug / how the feature would improve Traffic Control -->
When starting up CIAB, it should not get stuck in an endless loop of attempting to add empty certs via the TO API.
## Minimal reproduction of the problem with instructions:
<!--
If the current behavior is a bug or you can illustrate your feature request better with an example,
please provide the *STEPS TO REPRODUCE* and include the applicable TC version.
-->
`docker-compose -f docker-compose.yml up --build` then if it does *not* get stuck in that loop above, ctrl-c the terminal, then run `docker-compose -f docker-compose.yml down` followed by `docker-compose -f docker-compose.yml up --build` again. It's likely to get stuck in the same loop.
## Anything else:
<!-- e.g. stacktraces, related issues, suggestions how to fix -->
Though it might not be the cause, https://github.com/apache/trafficcontrol/pull/3489 fixed some other related things, so it might be a good place to dive into for fixing this issue.
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services