Skip to content

Panic when setting up Let's Encrypt clusterissuer #236

Closed

Description

@carlpett

Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug

What happened:
Installed cert-manager with helm, created cluster-wide issuer, requested certificate. Instead of getting a certificate, the cert-manager pod enters a crash-loop with a panic.

From what I can tell, it happens here. See link below for stack trace and logs.

What you expected to happen:
Cert created.

How to reproduce it (as minimally and precisely as possible):
Setup with contrib helm chart, then

apiVersion: certmanager.k8s.io/v1alpha1
kind: ClusterIssuer
metadata:
  name: letsencrypt-staging
spec:
  acme:
    # The ACME server URL
    server: https://acme-staging.api.letsencrypt.org/directory
    # Email address used for ACME registration
    email: [email protected]
    # Name of a secret used to store the ACME account private key
    privateKeySecretRef:
      name: letsencrypt-staging
    # Enable the HTTP-01 challenge provider
    http01: {}
---
apiVersion: certmanager.k8s.io/v1alpha1
kind: Certificate
metadata:
  name: monitoring-ingress-cert
spec:
  secretName: monitoring-ingress-tls
  issuerRef:
    name: letsencrypt-staging
    kind: ClusterIssuer
  commonName: {{ .Values.ingress.domain }}
  dnsNames:
  - {{ .Values.ingress.domain }}
  acme:
    config:
    - http01:
        ingress: monitoring-web
      domains:
      - {{ .Values.ingress.domain }}

Anything else we need to know?:
--v=6 logs and stack trace

Environment:

  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"6e937839ac04a38cac63e6a7a306c5d035fe7b0a", GitTreeState:"clean", BuildDate:"2017-09-28T22:57:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.7", GitCommit:"8e1552342355496b62754e61ad5f802a0f3f1fa7", GitTreeState:"clean", BuildDate:"2017-09-28T23:56:03Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration**: Azure
  • Install tools: Helm
  • Others: -

Activity

  1. added
    kind/bug
    on Jan 8, 2018
  2. munnerz commented on Jan 8, 2018

    @munnerz
    Member

    I think this is coming about due to a bug in the registerAccount function below it - specifically here: https://github.com/jetstack/cert-manager/blob/v0.2.2/pkg/issuer/acme/setup.go#L90-L96

    If the error is a typedErr, but does not have a status code of conflict, it will return a nil account as well as a nil error. Instead, this should be:

    		if typedErr.StatusCode == http.StatusConflict {
    			accountUri := typedErr.Header.Get("Location")
    			if accountUri == "" {
    				return nil, fmt.Errorf("unexpected error - 409 Conflict error returned, but no Location header set: %s", typedErr.Error())
    			}
    			return a.verifyAccount(ctx, cl, accountUri)
    		} else {
    			return nil, typedErr
    		}

    or something similar

  3. munnerz commented on Jan 8, 2018

    @munnerz
    Member

    I've opened #237 as a fix for the above

    /area provider-acme

  4. added
    area/acme
    on Jan 8, 2018
  5. carlpett commented on Jan 8, 2018

    @carlpett
    Author

    Wow, thanks for the fast turnaround there! The build seems to have failed, but I'll try the canary as soon as there is one!

  6. carlpett commented on Jan 10, 2018

    @carlpett
    Author

    Built it myself and tested it, works nicely. For the record, the error was Error creating new registration :: empty DNS response validating email domain - no MX/A records. Interestingly, this worked with kube-lego (but I can see how it shouldn't, from LE's point of view)

  7. added a commit that references this issue on Jan 10, 2018
    96b8b11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/acmekind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions