Skip to content

Operation cannot be fulfilled on certificates.cert-manager.io the object has been modified #3501

Closed

Description

@hubstairs-admin

Hello,

I'm trying to issue certificate from a k8s Ingress, the cert is not becomes ready, the logs from cert-manager pod print this:

E1208 16:01:50.827738       1 controller.go:158] cert-manager/controller/CertificateReadiness "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificates.cert-manager.io \"example-com-test-tls\": the object has been modified; please apply your changes to the latest version and try again" "key"="example/example-com-test-tls" 
E1208 16:01:50.872116       1 controller.go:158] cert-manager/controller/CertificateKeyManager "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificates.cert-manager.io \"example-com-test-tls\": the object has been modified; please apply your changes to the latest version and try again" "key"="example/example-com-test-tls"

Here is the ingress part of my value.yaml :

ingress:
  enabled: true
  labels:
    traffic: "external"
    use-dns01-solver: "true"
  annotations: |
    kubernetes.io/ingress.class: haproxy
    cert-manager.io/cluster-issuer: letsencrypt-prod
    ingress.kubernetes.io/whitelist-source-range: "0.0.0.0"
    kubernetes.io/ingress.allow-http: "false"
    ingress.kubernetes.io/ssl-passthrough: "true"
  hosts:
    - host: example-test.hubstairs.com
      paths:
        - /
      serviceName: myapp
      servicePort: 3031

  tls:
    - secretName: example-com-test-tls
      hosts:
        - 'example-test.hubstairs.com'

The certificate has been successfully issue without error :

Events:
  Type    Reason     Age                  From          Message
  ----    ------     ----                 ----          -------
  Normal  Issuing    32s                  cert-manager  Issuing certificate as Secret does not exist
  Normal  Generated  32s                  cert-manager  Stored new private key in temporary Secret resource "example-com-test-tls-6bt7d"
  Normal  Requested  32s                  cert-manager  Created new CertificateRequest resource "example-com-test-tls-xk85p"
  Normal  Issuing    12s                  cert-manager  The certificate has been successfully issued

When I try to access to url in a browser, I have an SSL error.

Environment details::

  • Kubernetes version: 1.17
  • Cloud-provider/provisioner: Google cloud
  • cert-manager version: 1.1.0
  • Install method: helm upgrade --install jetstack/cert-manager --version 1.1.0 -f value.yaml --debug

/kind bug

Activity

  1. added
    kind/bug
    on Dec 8, 2020
  2. alex-guenther commented on Dec 16, 2020

    @alex-guenther

    I see the same errors in the log but everything works fine. You seem to have omitten the non error lines, which show that it eventually worked.

    • Are sure the ClusterIssuer "letsencrypt-prod" is actually what the name implies?
    • Did you check the certificatte, are the contents as expected?
    • Could you resolve your issue or find more hints on what the issue is?

    I would guess that this error log lines are not related to your actual problem. I opened a separate issue because I am not sure if we are dealing with the same problem. #3516

  3. meyskens commented on Dec 16, 2020

    @meyskens
    Contributor

    This error is a non-error for this, it is a known issue which we're looking into. I cannot seem to find the issue for it right now... it has to do with the design of the new controllers

  4. fliphess commented on Dec 17, 2020

    @fliphess

    How can we work around it?

  5. hubstairs-admin commented on Dec 17, 2020

    @hubstairs-admin
    Author

    @meyskens I going to update the HAProxy controller through the latest version. I'll keep you informed if the problem goes away.

  6. meyskens commented on Dec 17, 2020

    @meyskens
    Contributor

    @fliphess cert-manager will work around these itself

  7. fliphess commented on Dec 21, 2020

    @fliphess

    @meyskens

    I did an upgrade to the latest cert-manager and all seems to be working, it's just that we notice this error with every (each and everyone) certificate request and renewal.

    How should I look at this error? If cert-manager will work around these itself, should I consider it very verbose info output that causes some panic on my end or is this because of a bug or misconfiguration that is triggered?

    If it's just very verbose info output about an issue that cert-manager will work around itself I'd love to be able to suppress it as it causes panic without reason. If it's not just extremely verbose info I'd love to have a fix so it doesn't appear anymore in my logs.

    Edit: Forgot to ask my question: Can i fix the appearance of this "error" with configuration or is it something that should be fixed in the project itself?

  8. llb4ll commented on Dec 22, 2020

    @llb4ll

    Seeing the same error logs.

    2020-12-22 14:24:24.150 CET
    "cert-manager/controller/orders "msg"="re-queuing item due to error processing" "error"="challenges.acme.cert-manager.io \"xxxxxxxx-2318237234-202910yyyyy\" not found" "key"="xxx/xxxxxxxx-pabcj-2318237234" "
    Error
    2020-12-22 14:24:24.138 CET
    "cert-manager/controller/challenges "msg"="challenge in work queue no longer exists" "error"="challenge.acme.cert-manager.io \"xxxxxxxx-2318237234-202910yyyyy\" not found" "
    Error
    2020-12-22 14:24:24.135 CET
    "cert-manager/controller/challenges "msg"="challenge in work queue no longer exists" "error"="challenge.acme.cert-manager.io \"xxxxxxxx-pabcj-2318237234-2792618003\" not found" "
    Error
    2020-12-22 14:24:24.117 CET
    "cert-manager/controller/CertificateReadiness "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificates.cert-manager.io \"xxxxxxxx\": the object has been modified; please apply your changes to the latest version and try again" "key"="xxx/xxxxxxxx" "
    Error
    2020-12-22 14:24:24.105 CET
    "cert-manager/controller/orders "msg"="re-queuing item due to error processing" "error"="challenges.acme.cert-manager.io \"xxxxxxxx-pabcj-2318237234-3208871903\" not found" "key"="xxx/xxxxxxxx-pabcj-2318237234" "
    Error
    2020-12-22 14:24:24.105 CET
    "cert-manager/controller/challenges "msg"="challenge in work queue no longer exists" "error"="challenge.acme.cert-manager.io \"xxxxxxxx-pabcj-2318237234-3208871903\" not found" "
    Error
    2020-12-22 14:24:24.096 CET
    "cert-manager/controller/challenges "msg"="challenge in work queue no longer exists" "error"="challenge.acme.cert-manager.io \"xxxxxxxx-pabcj-2318237234-2243611777\" not found" "
    Error
    2020-12-22 14:24:24.088 CET
    "cert-manager/controller/CertificateReadiness "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificates.cert-manager.io \"xxxxxxxx\": the object has been modified; please apply your changes to the latest version and try again" "key"="xxx/xxxxxxxx" "
    Error
    2020-12-22 14:24:24.083 CET
    "cert-manager/controller/challenges "msg"="challenge in work queue no longer exists" "error"="challenge.acme.cert-manager.io \"xxxxxxxx-pabcj-2318237234-3466251408\" not found" "
    Error
    2020-12-22 14:24:24.073 CET
    "cert-manager/controller/CertificateIssuing "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificates.cert-manager.io \"xxxxxxxx\": the object has been modified; please apply your changes to the latest version and try again" "key"="xxx/xxxxxxxx" "
    Info
    2020-12-22 14:24:24.016 CET
    "Found status change for CertificateRequest "xxxxxxxx-pabcj" condition "Ready": "False" -> "True"; setting lastTransitionTime to XYZ"
    Info
    2020-12-22 14:24:24.015 CET
    "cert-manager/controller/certificaterequests-issuer-acme/sign "msg"="certificate issued" "related_resource_kind"="Order" "related_resource_name"="xxxxxxxx-pabcj-2318237234" "related_resource_namespace"="xxx" "related_resource_version"="v1" "resource_kind"="CertificateRequest" "resource_name"="xxxxxxxx-pabcj" "resource_namespace"="xxx" "resource_version"="v1" "
    Error
    2020-12-22 14:24:23.124 CET
    "ingress 'xxx/cm-acme-http-solver-ckdx2' in work queue no longer exists"
    

    Environment details::

    Kubernetes version: 1.16
    Cloud-provider/provisioner: Google cloud
    cert-manager version: 1.1.0
    Install method: clean and re-install, using helm template generated files
    
  9. aogg commented on Jan 12, 2021

    @aogg

    cert-manager version: 1.1.0

    install:
    helm install
    cert-manager jetstack/cert-manager
    --namespace cert-manager
    --set ingressShim.defaultIssuerName=letsencrypt-prod
    --set ingressShim.defaultIssuerKind=ClusterIssuer
    --set ingressShim.defaultIssuerGroup=cert-manager.io
    --version v1.1.0

    +1

  10. meyskens commented on Jan 28, 2021

    @meyskens
    Contributor

    /priority important-soon
    /area api

  11. added
    priority/important-soon
    area/api
    on Jan 28, 2021
  12. nsteinmetz commented on Feb 1, 2021

    @nsteinmetz

    Hello @meyskens

    So when we face this issue, we just should wait if I understand correctly ? any idea on how long I should wait ? Any workaround ?

    Thanks !

  13. nsteinmetz commented on Feb 1, 2021

    @nsteinmetz

    Hello @meyskens

    So when we face this issue, we just should wait if I understand correctly ? any idea on how long I should wait ? Any workaround ?

    Thanks !

    Ok my bad - as I cleaned a lot of annotations - I removed a useful one.

    Once I redefined that certificate is to be generated with a ClusterIssuer, it works as expected...

  14. Patafix commented on Feb 3, 2021

    @Patafix

    Same error here, but not working at all on my side...

    I0203 09:15:05.917398 1 conditions.go:233] Setting lastTransitionTime for CertificateRequest "ssl-example.com-2whts" condition "Ready" to 2021-02-03 09:15:05.917387839 +0000 UTC m=+1221.665929458 I0203 09:15:05.917921 1 conditions.go:233] Setting lastTransitionTime for CertificateRequest "ssl-example.com-2whts" condition "Ready" to 2021-02-03 09:15:05.917914904 +0000 UTC m=+1221.666456523 I0203 09:15:05.918348 1 conditions.go:233] Setting lastTransitionTime for CertificateRequest "ssl-example.com-2whts" condition "Ready" to 2021-02-03 09:15:05.918341168 +0000 UTC m=+1221.666882787 I0203 09:15:05.919037 1 conditions.go:233] Setting lastTransitionTime for CertificateRequest "ssl-example.com-2whts" condition "Ready" to 2021-02-03 09:15:05.919030866 +0000 UTC m=+1221.667572495 I0203 09:15:05.919855 1 conditions.go:233] Setting lastTransitionTime for CertificateRequest "ssl-example.com-2whts" condition "Ready" to 2021-02-03 09:15:05.919849255 +0000 UTC m=+1221.668390874 E0203 09:15:05.954237 1 controller.go:158] cert-manager/controller/certificaterequests-issuer-vault "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificaterequests.cert-manager.io \"ssl-example.com-2whts\": the object has been modified; please apply your changes to the latest version and try again" "key"="cert-manager/ssl-example.com-2whts" E0203 09:15:06.117522 1 controller.go:158] cert-manager/controller/certificaterequests-issuer-acme "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificaterequests.cert-manager.io \"ssl-example.com-2whts\": the object has been modified; please apply your changes to the latest version and try again" "key"="cert-manager/ssl-example.com-2whts" E0203 09:15:06.120400 1 controller.go:158] cert-manager/controller/certificaterequests-issuer-venafi "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificaterequests.cert-manager.io \"ssl-example.com-2whts\": the object has been modified; please apply your changes to the latest version and try again" "key"="cert-manager/ssl-example.com-2whts" E0203 09:15:06.121273 1 controller.go:158] cert-manager/controller/certificaterequests-issuer-selfsigned "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificaterequests.cert-manager.io \"ssl-example.com-2whts\": the object has been modified; please apply your changes to the latest version and try again" "key"="cert-manager/ssl-example.com-2whts"

  15. 15 remaining items

  16. mihdih commented on Jul 6, 2021

    @mihdih

    @meyskens

    I did an upgrade to the latest cert-manager and all seems to be working, it's just that we notice this error with every (each and everyone) certificate request and renewal.

    How should I look at this error? If cert-manager will work around these itself, should I consider it very verbose info output that causes some panic on my end or is this because of a bug or misconfiguration that is triggered?

    If it's just very verbose info output about an issue that cert-manager will work around itself I'd love to be able to suppress it as it causes panic without reason. If it's not just extremely verbose info I'd love to have a fix so it doesn't appear anymore in my logs.

    Edit: Forgot to ask my question: Can i fix the appearance of this "error" with configuration or is it something that should be fixed in the project itself?

    We are experiencing the same. After an upgrade from 0.13.1 to version v1.1.1 (or even to v1.4.0) we suddenly observed these error messages.

    @meyskens sorry to echo @fliphess post. Is there away to suppress it somehow if it is not an error or is there a specific configuration that got inherited from previous version that caused this?

    PS: I understand that there is a webhook that would convert existing v1alpha2 to v1 and that turns out very well.

    Edit: In my case we are using vault-issuer

  17. gyoza commented on Jul 13, 2021

    @gyoza

    Steps to reproduce:

    1. have working TLS cert using SAN with secret storage
    2. Add new SAN to this manifest, kubectl apply
    3. see errors in cert-manager logs.
    cert-manager-5c48575669-q7qnz cert-manager I0713 20:28:43.566498       1 controller.go:162] cert-manager/controller/certificaterequests-issuer-vault "msg"="re-queuing item due to optimistic locking on resource" "key"="namespace/tls-com-my-service-6lktr" "error"="Operation cannot be fulfilled on certificaterequests.cert-manager.io \"tls-com-my-service-6lktr\": the object has been modified; please apply your changes to the latest version and try again"
    
    # k get certificates 
    tls-com-my-service              False   tls-com-my-service              14m
    

    Digging around i got this Working;

    found that the certificate request was complaining that the issuer was missing at the time due to a race condition of how these items were created in k8s.

    I figured cert-manager would eventually check to see the issuer exists eventually so that it can update all the orphaned jobs but this does not seem to be the case?

  18. pierluigilenoci commented on Jul 16, 2021

    @pierluigilenoci

    Is this issue a duplicate of #3896 and #3594?

  19. pierluigilenoci commented on Jul 16, 2021

    @pierluigilenoci

    Hi,
    @munnerz @JoshVanL @meyskens @wallrj @jakexks @maelvls @irbekrm @SgtCoDFish
    given that this problem has been present for months and many are involved, is there at least the idea of scheduling the resolution in the near future?

    Thank you very much for your work and your efforts. ❤️ 😘 🚀

  20. jmichaelthurman commented on Jul 19, 2021

    @jmichaelthurman

    Using K8s 1.18 on AWS, cert-manager 1.4.0, clusterIssuer: letsencrypt-prod. ( Deleted old cert-manager. Installed 1.4.0 and reconf'd clusterIssuer.)

    I deleted the cert which seemed to be causing the issue, and it re-issued, but the cert-manager pod is still kicking the error in logs.

  21. irbekrm commented on Jul 21, 2021

    @irbekrm
    Contributor

    Hi folks,

    "error"="Operation cannot be fulfilled on certificates.cert-manager.io "": the object has been modified; please apply your changes to the latest version and try again"

    This line in logs does not indicate an issue in itself, see the discussion around #3794 . The wording was changed slightly as it seemed to be misleading when folks are debugging other issues.

    There could be other issues why the certs are not getting renewed- it might make sense to open another issue with some more detail (the Certificate, CertificateRequest and some more logs from cert-manager pod (you can increase the verbosity level with --v=5 on controller)). After briefly looking at the issues reported above, I think they likely have different causes.

  22. jabdoa2 commented on Jul 26, 2021

    @jabdoa2

    This seems to cause issues for us. We often see the following after adding ingresses (especially in CI):

    cert-manager/controller/certificates-readiness "msg"="re-queuing item due to optimistic locking on resource" "key"="xxxx" "error"="Operation cannot be fulfilled on certificates.cert-manager.io \"xxxx\": the object has been modified; please apply your changes to the latest version and try again

    When this happens it takes a a few hours until cert-manager will actually retry the certificate. If we do not hit the error above we get certificates within a few seconds. But with the error we often see failing CI builds due to timeouts.

  23. maelvls commented on Jul 26, 2021

    @maelvls
    Member

    As @irbekrm detailed, the message:

    E0419 controller.go:158] msg="re-queuing item due to error processing" error="Operation
    cannot be fulfilled on cert-tls: the object has been modified; please apply your changes
    to the latest version and try again"
    

    is benign 99.9% of the time. This message does not actually relate to the issue you may observe; Unfortunately, the message is unclear and people may think it is a symptom of their issue.

    In 1.4, we changed the message a bit to clarify that. The level was changed from "error" to "info" and the message was reworded:

    I0419 controller.go:158] msg="re-queuing item due to optimistic locking on resource"
    error="Operation cannot be fulfilled on cert-tls: the object has been modified; please
    apply your changes to the latest version and try again"
    

    It seems like the message still looks like something "failed". I will look into ways of making this logline more understandable; either moving it to -v=4 (since this message is useful while developing to discover when two controllers are fighting on the same resource).


    ⚠ To anyone reading this thread: please open a new issue with the detailed logs that led to your issue, and keep in mind that the above message is very most likely not the culprit.

  24. vagkaefer commented on Feb 11, 2022

    @vagkaefer

    I'm not a expert in kubernetes, but after some instalations and changes, I founded the same error:

    cert-manager/controller/CertificateKeyManager "msg"="re-queuing item due to error processing" "error"="Operation cannot be fulfilled on certificates.cert-manager.io \"XXXXXXXX-tls\": the object has been modified; please apply your changes to the latest version and try again" "key"="xxxxxx-tls"

    I made this steps:

    • Remove all of cert-manager (affter the helm unistall I searched manualy and deleted all related to cert-manager, pods, secrets, all...)
    • Make a helm instalation using the lates version (1.7.1)
    • Check the comment of @adaliszk (I was mistaking ClusterIssuer and Issuer in some yaml files)

    Same error message...

    Befor testing again, I switched from stagin issuer cluster to the production issuer, then everything worked fine!

    I don't know the staging server's request limit, but maybe you reached the limit, wait a little or change the issuer....

    I know that this is not the solution, but maybe can help someone...

  25. sshcherbakov commented on Jul 26, 2022

    @sshcherbakov

    I have encountered the issue in a clean cluster installation with cert-manager 1.5.4.
    I could not get any certificates (the problem was not only the message in the logs)

    Upgrading cert-manager to 1.6.1 has solved my problem right away.

  26. yaa110 commented on Apr 29, 2023

    @yaa110

    faced the same issue:

    cert-manager: v1.8.0
    k8s: v1.22.8

  27. irbekrm commented on Apr 29, 2023

    @irbekrm
    Contributor

    I am going to lock this issue. Please see #3501 (comment) especially

    To anyone reading this thread: please open a new issue with the detailed logs that led to your issue, and keep in mind that the above message is very most likely not the culprit.

  28. locked as resolved and limited conversation to collaborators on Apr 29, 2023
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/apikind/bugpriority/important-soon

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions