Repository navigation
Closed
Description
Is this a BUG REPORT or FEATURE REQUEST?:
Uncomment only one, leave it on its own line:
/kind bug
/kind feature
What happened:
I get the message: http-01 self check failed for domain ""
$ kubectl describe certificates website-cert
Name: website-cert
Namespace: default
Labels: <none>
Annotations: kubectl.kubernetes.io/last-applied-configuration={"apiVersion":"certmanager.k8s.io/v1alpha1","kind":"Certificate","metadata":{"annotations":{},"name":"website-cert","namespace":"default"},"spe...
API Version: certmanager.k8s.io/v1alpha1
Kind: Certificate
Metadata:
Cluster Name:
Creation Timestamp: 2018-06-14T14:56:48Z
Generation: 0
Resource Version: 14514530
Self Link: /apis/certmanager.k8s.io/v1alpha1/namespaces/default/certificates/website-cert
UID: 2a172bc7-6fe3-11e8-a23d-00163e0067a2
Spec:
Acme:
Config:
Domains:
<redacted>.com
Http 01:
Ingress: ingress
Common Name:
Dns Names:
<redacted>.com
Issuer Ref:
Name: letsencrypt-issuer-staging
Secret Name: website-cert
Status:
Acme:
Order:
Challenges:
Authz URL: https://acme-staging-v02.api.letsencrypt.org/acme/authz/d4lkE7p4egv_GNHKOGkIZeNxANPhc4icVwX6ceSfvfQ
Domain: <redacted>.com
Http 01:
Ingress: ingress
Key: VPf6GKhjZO3CZ4VNjlv6yjg4_7W38X5FZ78pXVJ56Bw.UYrPMOqVi1SlKjy8hYE4t6mdtpuoNxCAANIaDzkZhw0
Token: VPf6GKhjZO3CZ4VNjlv6yjg4_7W38X5FZ78pXVJ56Bw
Type: http-01
URL: https://acme-staging-v02.api.letsencrypt.org/acme/challenge/d4lkE7p4egv_GNHKOGkIZeNxANPhc4icVwX6ceSfvfQ/135522965
Wildcard: false
URL: https://acme-staging-v02.api.letsencrypt.org/acme/order/6285995/2040425
Conditions:
Last Transition Time: 2018-06-14T14:56:56Z
Message: http-01 self check failed for domain "<redacted>.com"
Reason: ValidateError
Status: False
Type: Ready
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal CreateOrder 4s cert-manager Created new ACME order, attempting validation...
If I get all the events:
I0614 15:03:16.667525 1 controller.go:177] certificates controller: syncing item 'default/website-cert'
I0614 15:03:16.667660 1 sync.go:239] Preparing certificate default/website-cert with issuer
I0614 15:03:16.667674 1 acme.go:159] getting private key (letsencrypt-issuer-staging->tls.key) for acme issuer default/letsencrypt-issuer-staging
I0614 15:03:16.668072 1 logger.go:27] Calling GetOrder
I0614 15:03:16.876856 1 logger.go:52] Calling GetAuthorization
I0614 15:03:17.065635 1 logger.go:72] Calling HTTP01ChallengeResponse
I0614 15:03:17.065678 1 prepare.go:263] Cleaning up old/expired challenges for Certificate default/website-cert
I0614 15:03:17.065696 1 logger.go:47] Calling GetChallenge
I0614 15:03:17.266766 1 helpers.go:162] Found status change for Certificate "website-cert" condition "Ready": "False" -> "False"; setting lastTransitionTime to 2018-06-14 15:03:17.266752283 +0000 UTC m=+20046.828096097
I0614 15:03:17.266805 1 sync.go:241] Error preparing issuer for certificate default/website-cert: http-01 self check failed for domain "<redacted>.com"
E0614 15:03:17.272906 1 sync.go:168] [default/website-cert] Error getting certificate 'website-cert': secret "website-cert" not found
E0614 15:03:17.272958 1 controller.go:186] certificates controller: Re-queuing item "default/website-cert" due to error processing: http-01 self check failed for domain "<redacted>.com"
What you expected to happen:
The self check to succeed
How to reproduce it (as minimally and precisely as possible):
Here is my Ingress:
spec:
tls:
- hosts:
- <redacted>.com
secretName: website-cert
rules:
- host: <redacted>.com
http:
paths:
- backend:
servicePort: 80
serviceName: website
path: /
- backend:
servicePort: 8089
serviceName: cm-acme-http-solver-7lvgt
path: >-
/.well-known/acme-challenge/VPf6GKhjZO3CZ4VNjlv6yjg4_7W38X5FZ78pXVJ56Bw
apiVersion: extensions/v1beta1
status:
loadBalancer:
ingress:
- ip: {IP}
kind: Ingress
metadata:
uid: 6c304201-6fe2-11e8-8294-00163e020142
resourceVersion: '14515959'
name: ingress
creationTimestamp: '2018-06-14T14:51:30Z'
selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/ingress
generation: 4
namespace: default
Here is my Issuer:
apiVersion: certmanager.k8s.io/v1alpha1
kind: Issuer
metadata:
name: letsencrypt-issuer-staging
namespace: default
spec:
acme:
server: https://acme-staging-v02.api.letsencrypt.org/directory
email: <redacted>
# Name of a secret used to store the ACME account private key
privateKeySecretRef:
name: letsencrypt-issuer-staging
http01: {}
Here is my certificate:
apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
name: website-cert
spec:
secretName: website-cert
dnsNames:
- <redacted>.com
acme:
config:
- http01:
ingress: ingress
domains:
- <redacted>.com
issuerRef:
name: letsencrypt-issuer-staging
Anything else we need to know?:
When I navigate to
http://<redacted>.com/.well-known/acme-challenge/VPf6GKhjZO3CZ4VNjlv6yjg4_7W38X5FZ78pXVJ56Bw
I get:
VPf6GKhjZO3CZ4VNjlv6yjg4_7W38X5FZ78pXVJ56Bw.UYrPMOqVi1SlKjy8hYE4t6mdtpuoNxCAANIaDzkZhw0
Also, if I look at the logs of the cm-acme pod:
2018/06/14 17:31:58 [<redacted>.com] Validating request. basePath=/.well-known/acme-challenge, token=VPf6GKhjZO3CZ4VNjlv6yjg4_7W38X5FZ78pXVJ56Bw
2018/06/14 17:31:58 [<redacted>.com] Comparing actual host '<redacted>.com' against expected '<redacted>.com'
2018/06/14 17:31:58 [<redacted>.com] Got successful challenge request, writing key...
Environment:
- Kubernetes version (use
kubectl version):
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-12T14:26:04Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.7", GitCommit:"dd5e1a2978fd0b97d9b78e1564398aeea7e7fe92", GitTreeState:"clean", BuildDate:"2018-04-18T23:58:35Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
- Cloud provider or hardware configuration**: Aliyun Container Service
- Install tools:
- Others:
I've been struggling for two days. It's probably something really stupid from my side :)
Any idea?
Metadata
Metadata
Assignees
Labels
No labels
Activity
AmbroiseCouissin commentedon Jun 15, 2018
The problem solved by itself today. I don't know how.
Thanks for cert-manager. It's really a great tool!
arianitu commentedon Jun 19, 2018
I'm running into the same thing. I see in the logs say
writing key..., but if I look at the certificate, it says its still validating it.Super buggy
munnerz commentedon Jun 19, 2018
oxlarrysh commentedon Jun 19, 2018
I am running into this same issue, How long does it take?
AmbroiseCouissin commentedon Jun 21, 2018
It took me two-three days. But now when generate certificates for other subdomains, it takes less than a minute.
oanogin commentedon Jun 27, 2018
it's strange behavior, i have 2 dns names (asd.team1.example.com and asd.another.com), and interesting points are:
And only for asd.another.com i can't obtain cert by cert-manager, but with certbot on this machine everything works fine
:(
hekonsek commentedon Jul 10, 2018
I encountered the same issue. Any address I choose for my app works, except a single one whose validation is blocked by
http-01 self check failed for domainerror. In particularhttp://foo.mydomain.comdoesn't work, but for examplehttp://foo-app.mydomain.comworks like a charm and can be validated in less than a minute.I'm trying to figure our from logs what could be a reason for this single subdomain to fail self check validation.
gabx commentedon Jul 28, 2018
Same error as the OP. Here is my
certificate.yamlfile. certificate has been created, but since then, no LTS certificate from let's encrypt.maresende commentedon Aug 2, 2018
Same error as OP.(2)
Zetanova commentedon Aug 3, 2018
updated now from v2.5
I tried ingressClass: nginx and ingress: my-ingress
With the last the ingress get with the acme collange extended
and can be quired successfully in the browser.
cert-manager still logs:
http-01 self check failed for domain "mydomain.tt"
Zetanova commentedon Aug 3, 2018
I could solve it.
The hairpin mode of the NLB in front of the cluster didnt work.
ngo275 commentedon Aug 10, 2018
I ran into the same problem.. but I tried it again after a while then it succeeded..!
This is weird..
Darwinyo commentedon Aug 20, 2018
i just have same problem today.
I have 5 domains to validate.
www.farmersflorals.com, farmersflorals.com, api.farmersflorals.com, identity.farmersflorasl.com, and blog.farmersflorals.com.
only 3 of those validated www.farmersflorals.com, farmersflorals.com, and identity.farmersflorals.com
other not.
all of those refer to same IP, i could access all of them, but only 3 validated, that's weird.
i'm using helm chart version 0.4.1
with ingress on GKE
Antiarchitect commentedon Aug 23, 2018
Having the same issue. I have two clusters tuned absolutely identically in terms of nginx-ingress and cert-manager and the third one is lagging. all three domains self check failed. I have clusters for prod and staging - now it's QA turn. Nothing works. Logs don't say anything useful
39 remaining items
hvaoc commentedon Aug 5, 2020
@Alirezahaghshenas & @jc-delvalle comments helped. For anyone who have wasted enough time using kuberctl appy with yaml and getting the this issue, here are the full set of commands
bergkvist commentedon Sep 8, 2020
@rbq I have the same problem as you it seems. I can't reach the endpoint from within the cluster, but I can reach it from my local workstation.
From within the cluster vs from local workstation:

How did you fix it?
bergkvist commentedon Sep 8, 2020
Turns out the internal services in the cluster were not able to reach things within the cluster through external IP because I had enabled PROXY protcol in my load balancer.
When I disabled PROXY protocol, the certificates were issued almost immediately.
Which meant I could turn PROXY protocol back on:
My application requires the use of PROXY protocol in order to check the users IP addresses. Is there a way of fixing this without having to switch PROXY protcol on and off every 90 days to renew my certs?
ashleydavies commentedon Sep 11, 2020
Huge thanks @bergkvist, same issue here, appreciate you sharing the solution; spent all day trying everything except that it seems 😅
stopsopa commentedon Sep 25, 2020
Patch for this definitely needed, and it seems that there are people/organizations willing and knowing how to help:
kubernetes/kubernetes#66607 (comment)
I hope it will be addressed soon because @bergkvist solution is brilliant but also pretty nasty but at the moment it looks like that's all what we have.
bergkvist commentedon Sep 25, 2020
@stopsopa So there is actually another alternative, which makes the self-checks work even with PROXY protocol enabled.
Notice that you have to explicitly write your hostname ("example.com") in order for the kubernetes iptables issue to be worked around. Not sure how this would work if you have multiple hostnames pointing to the same loadbalancer.
Subdomains work fine though (like www.example.com, subdomain.example.com etc.)
stopsopa commentedon Sep 25, 2020
Thanks @bergkvist mate I spent two evenings trying to make it work (cert-manager together with ip address), pulling my hair off, and actually I've been doing this too but with other configuration. I have created new cluster and tried only do-loadbalancer-hostname and... Finally worked. 🎉
compumike commentedon Oct 23, 2020
Hi all, I ran into the same issue. I've just published
hairpin-proxywhich works around the issue, specifically for cert-manager self-checks. https://github.com/compumike/hairpin-proxyIt uses CoreDNS rewriting to intercept traffic that would be heading toward the external load balancer. It then adds a PROXY line to requests originating from within the cluster. This allows cert-manager's self-check to pass.
nabsul commentedon Oct 24, 2020
What a coincidence. Just today I published https://github.com/nabsul/k8s-letsencrypt with instructions on how to manually issue certificates in your Kubernetes cluster. The hope being that I'll only need to manually issue certs a few times until this issue is fixed.
I wish I'd seen @compumike 's solution sooner!!
richardthombs commentedon Nov 10, 2020
@compumike Thanks so much!! 🥇
ahmed-adly-khalil commentedon Apr 10, 2021
I was able to fix this, the chain of issues started as follow:
I had the following in the annotation in my ingress controller
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /
this caused all URLs to be rewritten to /
this caused the cert-manager to fail on self-check before communicating to let's encrypt
this caused certificate generation not to start at all
this also caused the DNS resolution from inside the cluster to fail
commenting these 2 lines made things work
SacMV commentedon Apr 26, 2022
In my case:
Error message: cert manager challenge remote error: tls: unrecognized name
I added in my ingress annotations:
cert-manager.io/issue-temporary-certificate: "true"
acme.cert-manager.io/http01-edit-in-place: "true"
It worked.
fabioespinosa commentedon Oct 25, 2022
As @ahmed-adly-khalil said:
Removing
Worked
macs1756 commentedon Mar 30, 2026
I had the same issue and I didn't solve it through the libraries mentioned in that thread. Maybe the problem was because I used AWS as a cloud provider and my DNS was located on Cloudflare. I set up Cert-Manager exactly as required for Cloudflare with api token, not for general use. This may be helpful for someone.