cert-manager: Cloudflare DNS resolver fails: Error: 6003: Invalid request headers
Describe the bug: Cannot get DNS resolver to work with cloudflare account
cert-manager/controller/challenges "msg"="re-queuing item due to error processing" "error"="Cloudflare API Error \n\t Error: 6003: Invalid request headers\u003c- 6111: Invalid format for Authorization header"
Expected behaviour: The challenge to be accepted
Steps to reproduce the bug:
I strictly followed the documentation with an api-token:
https://cert-manager.io/docs/configuration/acme/dns01/cloudflare/#api-tokens
Tried also with the global api-key.
Anything else we need to know?: The HTTP does not work neither.
"msg"="propagation check failed" "error"="wrong status code '404', expected '200'" "type"="http-01"
Environment details::
- Kubernetes version (e.g. v1.10.2):
v1.18.3 - Cloud-provider/provisioner (e.g. GKE, kops AWS, etc): bare-metal
opennebula - cert-manager version (e.g. v0.4.0): 0.15.1
- Install method (e.g. helm or static manifests): helm
/kind bug
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 10
- Comments: 38 (3 by maintainers)
For what it’s worth I was able to fix my issue by changing from the documented
Secret. Changes made:cert-managernamespacedataas opposed tostringDatabecause I base64 encoded the secretI’m using API Token from Cloudflare with a
ClusterIssuer. Didn’t need to adjust from the recommended minimal permission requirements in the docs.Before those changes I was seeing the below errors:
Secret not found(fixed by changing namespace)Error: 6003: Invalid request headers<- 6111: Invalid format for Authorization header(fixed withdatavsstringData)I was just able to deploy it using an api token generated from cloudflare.
Follow the steps here : https://blog.darkedges.com/2020/05/04/cert-manager-kubernetes-cloudflare-dns-update/
but, instead of using apiKeySecretRef, using a token here, use apiTokenSecretRef.
You do not need to base64 encode the secret. I read somewhere else that they only got it to work by doing that, so I was on the wrong track.
Confirm changing
stringData->datain theSecret(which needs to be incert-managernamespace) worked. Sigh the hours we burn…I did fixed with global token using
This got me thinking as I just had this problem on a new cluster and api key. This is happening when the cloudflare api key has a
-(hyphen) in the key. My first and second key I had tried both had hyphens in them. I redeployed certmanager with the old keys to make sure it was still broken before I tried the fix and it was. I rotated the key until I had one without a hyphen and redeployed. It then worked as expected. I’d consider this a bug that needs to be fixed.Ignore me, this was my lack of understanding of the difference between data and stringData!
@luishdez which version of certmanager are you running?
I’m on the latest version of certmanager, your yaml simply results in
Error: 6003: Invalid request headers<- 6103: Invalid format for X-Auth-Key header