AKS icon indicating copy to clipboard operation
AKS copied to clipboard

DNS resolver fails while looking up a CAA record for westeurope.aksapp.io

Open mercer opened this issue 7 years ago • 13 comments

DNS resolver fails while looking up a CAA record for westeurope.aksapp.io. This results in letsencrypt failing to provide a certificate for my AKS cluster with addon-http-application-routing enabled.

We didn't have this problem 2 weeks ago.

→ dig westeurope.aksapp.io caa

; <<>> DiG 9.10.6 <<>> westeurope.aksapp.io caa
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 12569
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1452
;; QUESTION SECTION:
;westeurope.aksapp.io.		IN	CAA

;; Query time: 530 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Sat Feb 02 14:32:03 EET 2019
;; MSG SIZE  rcvd: 49

→ kubectl logs -n kube-system newbie-coral-cert-manager-6795c67dc6-vsc9h
I0202 12:33:53.116637       1 controller.go:168] ingress-shim controller: syncing item 'default/mydomain-api'
I0202 12:33:53.116711       1 sync.go:140] Certificate "mydomain-tls" for ingress "mydomain-api" already exists
I0202 12:33:53.116764       1 sync.go:143] Certificate "mydomain-tls" for ingress "mydomain-api" is up to date
I0202 12:33:53.116815       1 controller.go:182] ingress-shim controller: Finished processing work item "default/mydomain-api"
I0202 12:34:53.116662       1 controller.go:171] certificates controller: syncing item 'default/mydomain-tls'
I0202 12:34:53.116986       1 sync.go:274] Preparing certificate default/mydomain-tls with issuer
I0202 12:34:53.117135       1 prepare.go:263] Cleaning up previous order for certificate default/mydomain-tls
I0202 12:34:53.117154       1 prepare.go:279] Cleaning up old/expired challenges for Certificate default/mydomain-tls
I0202 12:34:53.117162       1 logger.go:38] Calling CreateOrder
I0202 12:34:53.834698       1 acme.go:126] Created order for domains: [{dns mydomain.5kak5f4082c14292ac31.westeurope.aksapp.io}]
I0202 12:34:53.834758       1 logger.go:73] Calling GetAuthorization
I0202 12:34:53.989297       1 prepare.go:279] Cleaning up old/expired challenges for Certificate default/mydomain-tls
I0202 12:34:53.989340       1 helpers.go:201] Found status change for Certificate "mydomain-tls" condition "ValidateFailed": "False" -> "False"; setting lastTransitionTime to 2019-02-02 12:34:53.989324941 +0000 UTC m=+7007.508558101
I0202 12:34:53.989368       1 sync.go:281] Issuing certificate...
I0202 12:34:53.989587       1 logger.go:43] Calling GetOrder
I0202 12:34:54.193595       1 logger.go:58] Calling FinalizeOrder
I0202 12:34:57.951649       1 sync.go:288] Error issuing certificate for default/mydomain-tls: error getting certificate from acme server: acme: urn:ietf:params:acme:error:caa: Error finalizing order :: Rechecking CAA: While processing CAA for mydomain.5kak5f4082c14292ac31.westeurope.aksapp.io: DNS problem: SERVFAIL looking up CAA for westeurope.aksapp.io
I0202 12:34:57.952036       1 sync.go:206] Certificate default/mydomain-tls scheduled for renewal in 1202 hours
I0202 12:34:57.975233       1 controller.go:168] ingress-shim controller: syncing item 'default/mydomain-api'
I0202 12:34:57.975295       1 sync.go:140] Certificate "mydomain-tls" for ingress "mydomain-api" already exists
I0202 12:34:57.975307       1 sync.go:143] Certificate "mydomain-tls" for ingress "mydomain-api" is up to date
I0202 12:34:57.975313       1 controller.go:182] ingress-shim controller: Finished processing work item "default/mydomain-api"
E0202 12:34:57.976076       1 controller.go:180] certificates controller: Re-queuing item "default/mydomain-tls" due to error processing: error getting certificate from acme server: acme: urn:ietf:params:acme:error:caa: Error finalizing order :: Rechecking CAA: While processing CAA for mydomain.5kak5f4082c14292ac31.westeurope.aksapp.io: DNS problem: SERVFAIL looking up CAA for westeurope.aksapp.io
→ kubectl get pod --sort-by=.status.startTime --namespace kube-system
NAME                                                              READY     STATUS    RESTARTS   AGE
metrics-server-5cbc77f79f-6vc56                                   1/1       Running   0          46d
kube-dns-v20-7c7d7d4c66-ccgbw                                     4/4       Running   0          46d
kube-svc-redirect-rkddr                                           2/2       Running   0          46d
newbie-coral-cert-manager-6795c67dc6-vsc9h                        1/1       Running   5          46d
kube-svc-redirect-n6lgc                                           2/2       Running   0          46d
kube-svc-redirect-jb2r8                                           2/2       Running   0          46d
addon-http-application-routing-nginx-ingress-controller-ffpr7tw   1/1       Running   0          25d
addon-http-application-routing-default-http-backend-5ccb95vt7jt   1/1       Running   0          25d
tiller-deploy-69458576b-kr87z                                     1/1       Running   0          10d
omsagent-rs-98d796bfc-7c6x7                                       1/1       Running   0          2d
kubernetes-dashboard-67bdc65878-fwbbp                             1/1       Running   1          2d
kube-dns-autoscaler-746998ccf6-rsrtv                              1/1       Running   0          2d
heapster-5d6f9b846c-wjwgr                                         2/2       Running   0          2d
kube-dns-v20-7c7d7d4c66-vblxg                                     4/4       Running   0          2d
omsagent-rpgpn                                                    1/1       Running   0          2d
kube-proxy-whqlj                                                  1/1       Running   0          2d
addon-http-application-routing-external-dns-54ff984456-w4mlq      1/1       Running   0          2d
omsagent-zqkxm                                                    1/1       Running   0          2d
omsagent-tgm5r                                                    1/1       Running   0          2d
kube-proxy-wsl75                                                  1/1       Running   0          2d
kube-proxy-mxvhf                                                  1/1       Running   0          2d
tunnelfront-9ff778c57-spl9x                                       1/1       Running   0          1h

mercer avatar Feb 02 '19 12:02 mercer

Hi @mercer, i just found your issue. I think we are discussing the same issue here on Let's Encrypt Forum. https://community.letsencrypt.org/t/caa-behaviour-changed/84706

Just for your information.

Best Regards e-bits

e-bits avatar Feb 04 '19 08:02 e-bits

Sign me up as another one with this issue.

jabbera avatar Feb 04 '19 15:02 jabbera

Add me to the list as well. The problem occurs regardless of whether addon-http-application-routing is enabled. Any LetsEncrypt certificate generation fails with the error:

"type": "http-01",
      "status": "invalid",
      "error": {
        "type": "urn:ietf:params:acme:error:dns",
        "detail": "DNS problem: SERVFAIL looking up CAA for some-azure-hosted-dns.com",
        "status": 400
      },

In situations where you have many certificates in a cluster, the problem ultimately manifests itself as:

 Error creating order: acme: urn:ietf:params:acme:error:rateLimited: Error creating new order :: too many failed authorizations recently: see https://letsencrypt.org/docs/rate-limits/

When you kubectl describe any of the certificates

chaholl avatar Feb 05 '19 11:02 chaholl

I "worked around" this by creating a root CAA record and requesting a wildcard *.blah.com cert....

jabbera avatar Feb 05 '19 13:02 jabbera

Do you have CNAMEs setup for the domains you are trying to issue certs for? (Trying to see if we have anything in common)

jabbera avatar Feb 05 '19 13:02 jabbera

I don't have CNAME's but I am looking up a subdomain. I think the problem relates to tree-walking.

I've found that if I dig CAA foo.bar.bah.com where I have an A for foo.bar.bah.com, I get a no-record response, which is OK. However, if I dig CAA bar.bah.com and I have no records at that level, I get SERVFAIL, which prevents a certificate being issued because there's no way to tell if it should be blocked or not.

I'm going to try adding a CAA at bar.bah.com to see if that helps.

chaholl avatar Feb 05 '19 13:02 chaholl

We have some Microsoft Updates over here: https://community.letsencrypt.org/t/caa-behaviour-changed/84706/15

e-bits avatar Feb 05 '19 13:02 e-bits

we might had a related issue - and found a workaround/solution:

in azure dns, we had a zone named "whatever.domain.tld" there, a wildcard a-record existed: *.zone type:A ip:xxxxxx

cert-manager worked in http01 and dns01 mode to create let's encrypt entries for example: xxxx.zone.whatever.domain.tld

until last week... then the same CAA issues started to occour

after longer debugging, we found, that creating the full chain in the azure dns helped: *.zone type:A ip:xxxxxx zone type:A ip:xxxxxx

now, we get new certificates again

adrianliechti avatar Feb 05 '19 13:02 adrianliechti

I am from Azure DNS. This is a regression caused due to our recent change around Empty Non Terminal Node handling. We are rolling out a fix for the issue. I will update this thread once it is done

karravi-msft avatar Feb 05 '19 18:02 karravi-msft

My cert-manager managed to receive the certificate 20 hours ago :tada:

mercer avatar Feb 06 '19 14:02 mercer

The fix for this issue has been rolled-out world-wide. Issue should be resolved for all.

nkindberg avatar Feb 07 '19 17:02 nkindberg

Hi everyone,

my Azure Support Ticket is closed and the issue is solved for me. I would like to thank for the support in here.

Best Regards e-bits

e-bits avatar Feb 08 '19 09:02 e-bits

This issue is fixed 🎉 closing!

jnoller avatar Feb 08 '19 14:02 jnoller