Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60002

Tried proxying hudson.plugins.emailext.ExtendedEmailPublisherDescriptor to support a circular dependency, but it is not an interface.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • email-ext-plugin
    • None

      When using a Pre-send Script, jenkins reports the following stacktrace:

      Oct 31, 2019 4:02:38 PM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
      WARNING: Failed to instantiate Key[type=hudson.plugins.emailext.ExtendedEmailPublisherDescriptor, annotation=[none]]; skipping this component
      com.google.inject.ProvisionException: Unable to provision, see the following errors:
      
      1) Tried proxying hudson.plugins.emailext.ExtendedEmailPublisherDescriptor to support a circular dependency, but it is not an interface.
      
      1 error
      at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
      at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
      at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:424)
      ...
      

      Steps to reproduce:

      1. git clone https://github.com/jenkinsci/email-ext-plugin.git
      2. cd email-ext-plugin/
      3. git checkout email-ext-2.68
      4. mvn hpi:run
      5. navigate via http://localhost:8080 to Manage Jenkins > Configure System
      6. enter "// " (without quotes) into the Default Pre-send Script text field.
      7. restart jenkins

          [JENKINS-60002] Tried proxying hudson.plugins.emailext.ExtendedEmailPublisherDescriptor to support a circular dependency, but it is not an interface.

          Maxim Danilov added a comment - - edited

          Can confirm the issue, experiencing the same stacktrace with Jenkins 2.222, email-ext 2.69.

          The problem only occurs when default pre-send script is non-empty.

          slide_o_mix any updates on this issue?

          Maxim Danilov added a comment - - edited Can confirm the issue, experiencing the same stacktrace with Jenkins 2.222, email-ext 2.69. The problem only occurs when default pre-send script is non-empty. slide_o_mix any updates on this issue?

          Alex Earl added a comment -

          I have been unable to reproduce the issue

          Alex Earl added a comment - I have been unable to reproduce the issue

          I can still reproduce this with the given environment and email-ext-2.68.

          I was also able to reproduce this in a docker container, in case you use a different distribution:

           

          docker run --rm -p 127.0.0.1:8080:8080 -ti debian:stretch /bin/bash
          apt-get update
          apt-get install -y eatmydata
          exec eatmydata bash
          apt-get install -y maven git openjdk-8-jdk-headless 
          cd /tmp
          git clone https://github.com/jenkinsci/email-ext-plugin.git
          cd email-ext-plugin/
          git checkout email-ext-2.68
          mvn hpi:run
          # continue with step 5 from above 

          I can also reproduce this with 2.69, however the ExtensionFinder.java line is different:

           

          WARNING: Failed to instantiate Key[type=hudson.plugins.emailext.ExtendedEmailPublisherDescriptor, annotation=[none]]; skipping this component
          com.google.inject.ProvisionException: Unable to provision, see the following errors:
          1) Tried proxying hudson.plugins.emailext.ExtendedEmailPublisherDescriptor to support a circular dependency, but it is not an interface.
          1 error
           at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
           at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
           at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:432)
          

           

           

          Stefan Völkel added a comment - I can still reproduce this with the given environment and email-ext-2.68. I was also able to reproduce this in a docker container, in case you use a different distribution:   docker run --rm -p 127.0.0.1:8080:8080 -ti debian:stretch /bin/bash apt-get update apt-get install -y eatmydata exec eatmydata bash apt-get install -y maven git openjdk-8-jdk-headless cd /tmp git clone https: //github.com/jenkinsci/email-ext-plugin.git cd email-ext-plugin/ git checkout email-ext-2.68 mvn hpi:run # continue with step 5 from above I can also reproduce this with 2.69, however the ExtensionFinder.java line is different:   WARNING: Failed to instantiate Key[type=hudson.plugins.emailext.ExtendedEmailPublisherDescriptor, annotation=[none]]; skipping this component com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Tried proxying hudson.plugins.emailext.ExtendedEmailPublisherDescriptor to support a circular dependency, but it is not an interface . 1 error at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145) at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:432)    

          Alex Earl added a comment -

          I use Windows I will retry to reproduce again.

          Alex Earl added a comment - I use Windows I will retry to reproduce again.

          Maxim Danilov added a comment - - edited

          Hi slide_o_mix,

           

          Here's how you can reproduce the issue with a clean Jenkins setup using Docker (cross-platform): 

          docker run --name jenkins-test -p 30000:8080 --detach jenkins/jenkins:2.222.3-alpine

          • Jenkins container starts in the background
          • Check its logs for initial admin password (docker logs jenkins-test -f)
          • Go to http://localhost:30000 and login with initial admin password
          • Click on "Install suggested plugins" (this also installs the email-ext plugin 2.69)
          • Create the admin user with any data, click "Save and Continue"
          • Keep Jenkins URL as http://localhost:30000/,  click "Save and Finish" -> "Start Using Jenkins"
          • Click on "Manage Jenkins" -> "Configure System"
          • Type "// test" in the field "Default Pre-Send Script" and click "Save" <- this is what introduces the warning!

           
          Now it's the tricky part, usually, after the first restart there's no warning

          docker stop jenkins-test

          • Wait for JVM to shut down and container to stop

          docker start jenkins-test

          • Check the logs, there's probably no errors this time, then you'll need to restart again

          Shut down again:

          docker stop jenkins-test

          • Wait for JVM to shut down and container to stop

          docker start jenkins-test

          • Check the container logs, now there's a stack trace:
             
            2020-05-16 21:55:35.075+0000 [id=28] WARNING h.ExtensionFinder$GuiceFinder$FaultTolerantScope$1#error: Failed to instantiate Key[type=hudson.plugins.emailext.ExtendedEmailPublisherDescriptor, annotation=[none]]; skipping this component
            
            com.google.inject.ProvisionException: Unable to provision, see the following errors:
            
            1) Tried proxying hudson.plugins.emailext.ExtendedEmailPublisherDescriptor to support a circular dependency, but it is not an interface.
            
            1 error
            
            at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
            at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145)
            at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:440)
            

          Maxim Danilov added a comment - - edited Hi slide_o_mix ,   Here's how you can reproduce the issue with a clean Jenkins setup using Docker (cross-platform):  docker run --name jenkins-test -p 30000:8080 --detach jenkins/jenkins:2.222.3-alpine Jenkins container starts in the background Check its logs for initial admin password ( docker logs jenkins-test -f ) Go to http://localhost:30000 and login with initial admin password Click on "Install suggested plugins" (this also installs the email-ext plugin 2.69) Create the admin user with any data, click "Save and Continue" Keep Jenkins URL as http://localhost:30000/ ,  click "Save and Finish" -> "Start Using Jenkins" Click on "Manage Jenkins" -> "Configure System" Type "// test" in the field "Default Pre-Send Script" and click "Save" <- this is what introduces the warning!   Now it's the tricky part, usually, after the first restart there's no warning docker stop jenkins-test Wait for JVM to shut down and container to stop docker start jenkins-test Check the logs, there's probably no errors this time, then you'll need to restart again Shut down again: docker stop jenkins-test Wait for JVM to shut down and container to stop docker start jenkins-test Check the container logs, now there's a stack trace:   2020-05-16 21:55:35.075+0000 [id=28] WARNING h.ExtensionFinder$GuiceFinder$FaultTolerantScope$1#error: Failed to instantiate Key[type=hudson.plugins.emailext.ExtendedEmailPublisherDescriptor, annotation=[none]]; skipping this component com.google.inject.ProvisionException: Unable to provision, see the following errors: 1) Tried proxying hudson.plugins.emailext.ExtendedEmailPublisherDescriptor to support a circular dependency, but it is not an interface. 1 error at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52) at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:145) at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:440)

          Alex Earl added a comment -

          Just to clarify, this fails starting at 2.68?

          Alex Earl added a comment - Just to clarify, this fails starting at 2.68?

          Stefan Völkel added a comment - - edited

          Just to clarify, this fails starting at 2.68?

          I doubt it, since we discovered this when upgrading from a rather old 1.x Jenkins installation. I'll try to figure out what the old version was exactly.

          The old version was: 2.39.3. I'll try to find the version where it breaks ...

          Version Works
          2.39.3 yes
          2.41.2 yes
          2.43 no, Error injecting constructor, java.lang.VerifyError: Expecting a stackmap frame at branch target 18
          2.45 no, Error injecting constructor, java.lang.VerifyError: Expecting a stackmap frame at branch target 18
          2.50 no, Error injecting constructor, java.lang.VerifyError: Expecting a stackmap frame at branch target 18
          2.58 no, com.google.inject.ProvisionException: Guice provision errors:
          2.68 no

          Stefan Völkel added a comment - - edited Just to clarify, this fails starting at 2.68? I doubt it, since we discovered this when upgrading from a rather old 1.x Jenkins installation. I'll try to figure out what the old version was exactly. The old version was: 2.39.3. I'll try to find the version where it breaks ... Version Works 2.39.3 yes 2.41.2 yes 2.43 no, Error injecting constructor, java.lang.VerifyError: Expecting a stackmap frame at branch target 18 2.45 no, Error injecting constructor, java.lang.VerifyError: Expecting a stackmap frame at branch target 18 2.50 no, Error injecting constructor, java.lang.VerifyError: Expecting a stackmap frame at branch target 18 2.58 no, com.google.inject.ProvisionException: Guice provision errors: 2.68 no

          Alex Earl added a comment -

          Looking into this now. I am able to reproduce it so I should be able to make some progress.

          Alex Earl added a comment - Looking into this now. I am able to reproduce it so I should be able to make some progress.

          Alex Earl added a comment -

          Alex Earl added a comment - Will be in 2.72, see https://github.com/jenkinsci/email-ext-plugin/pull/210

            slide_o_mix Alex Earl
            svoelkel Stefan Völkel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: