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

live console output broken on glassfish enterprise

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None
    • Glassfish Enterprise Server 2.1

      Hi,

      My Hudson is running on Glassfish Enterprise Server version 2.1.
      When I want to see live console output, I get the following exception:
      [#|2010-05-06T12:42:24.118+0200|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=33;_ThreadName=httpSSLWorkerThread-8080-3;_RequestID=a73df4d8-4776-47d7-b0ad-bf267f30c844;|StandardWrapperValve[Stapler]: PWC1406: Servlet.service() for servlet Stapler threw exception
      java.security.ProviderException: update() failed
      at sun.security.pkcs11.P11Cipher.implUpdate(P11Cipher.java:557)
      at sun.security.pkcs11.P11Cipher.engineUpdate(P11Cipher.java:457)
      at sun.security.pkcs11.P11Cipher.engineUpdate(P11Cipher.java:445)
      at javax.crypto.Cipher.update(DashoA13*..)
      at javax.crypto.CipherOutputStream.write(DashoA13*..)
      at javax.crypto.CipherOutputStream.write(DashoA13*..)
      at java.util.zip.GZIPOutputStream.writeHeader(GZIPOutputStream.java:123)
      at java.util.zip.GZIPOutputStream.<init>(GZIPOutputStream.java:48)
      at java.util.zip.GZIPOutputStream.<init>(GZIPOutputStream.java:58)
      at hudson.console.AnnotatedLargeText.writeHtmlTo(AnnotatedLargeText.java:156)
      at hudson.console.AnnotatedLargeText.writeLogTo(AnnotatedLargeText.java:142)
      at org.kohsuke.stapler.framework.io.LargeText.doProgressText(LargeText.java:187)
      at hudson.console.AnnotatedLargeText.doProgressiveHtml(AnnotatedLargeText.java:92)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:169)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:101)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:54)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:74)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:519)
      at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:144)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:519)
      at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:318)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:519)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:180)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:519)
      at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:180)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:519)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:435)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:123)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
      at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)
      at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
      at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
      at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
      at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
      at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
      at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
      at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
      at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
      at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
      Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_DEVICE_ERROR
      at sun.security.pkcs11.wrapper.PKCS11.C_EncryptUpdate(Native Method)
      at sun.security.pkcs11.P11Cipher.implUpdate(P11Cipher.java:510)
      ... 93 more

      #]

      Notice once the build is finished, console output is working fine.
      The above stack trace is a known "bug" in Glassfish Enterprise. It is caused by hardware accelerator crypto provider declared as the default crypto provider in Glassfish Enterprise even if you have no hardware accelerator card.
      The common workaround is to specify the crypto provider as "SunJCE" to avoid this when using crypto API.

      Regards,

      Laurent.

          [JENKINS-6459] live console output broken on glassfish enterprise

          sauvage created issue -

          sauvage added a comment -

          sauvage added a comment - This bug is caused by glassfish bug https://glassfish.dev.java.net/issues/show_bug.cgi?id=11862
          Alan Harder made changes -
          Assignee New: Alan Harder [ mindless ]

          Alan Harder added a comment -

          added workaround for Hudson 1.358

          Alan Harder added a comment - added workaround for Hudson 1.358

          Code changed in hudson
          User: : mindless
          Path:
          trunk/hudson/main/core/src/main/java/hudson/console/AnnotatedLargeText.java
          trunk/hudson/main/core/src/main/java/hudson/model/UsageStatistics.java
          trunk/hudson/main/core/src/main/java/hudson/util/Protector.java
          trunk/hudson/main/core/src/main/java/hudson/util/Secret.java
          trunk/www/changelog.html
          http://jenkins-ci.org/commit/30793
          Log:
          [FIXED JENKINS-6459] workaround for bug in Glassfish Enterprise

          SCM/JIRA link daemon added a comment - Code changed in hudson User: : mindless Path: trunk/hudson/main/core/src/main/java/hudson/console/AnnotatedLargeText.java trunk/hudson/main/core/src/main/java/hudson/model/UsageStatistics.java trunk/hudson/main/core/src/main/java/hudson/util/Protector.java trunk/hudson/main/core/src/main/java/hudson/util/Secret.java trunk/www/changelog.html http://jenkins-ci.org/commit/30793 Log: [FIXED JENKINS-6459] workaround for bug in Glassfish Enterprise
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          sauvage added a comment -

          Current workaround does not work because the Cipher initialization does work. The CKR_DEVICE_ERROR occurs after, when cipher is used.

          sauvage added a comment - Current workaround does not work because the Cipher initialization does work. The CKR_DEVICE_ERROR occurs after, when cipher is used.
          sauvage made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          Alan Harder added a comment -

          ick, it returns you a nonfunctioning object? hm.

          Alan Harder added a comment - ick, it returns you a nonfunctioning object? hm.

          Alan Harder added a comment -

          you can visit Manage Hudson / Script Console and try to find a simple API we can use to detect the problem. Example:

          hudson.util.Secret.getCipher("AES").getProvider()

          Here is the javadoc for Cipher class: http://java.sun.com/javase/6/docs/api/javax/crypto/Cipher.html

          If you can find a simple call that triggers the exception, then I can make it automatically fallback to SunJCE. Otherwise I'll add a system property to make it use "SunJCE" provider, and document in the wiki how to set that up for Glassfish enterprise.

          Alan Harder added a comment - you can visit Manage Hudson / Script Console and try to find a simple API we can use to detect the problem. Example: hudson.util.Secret.getCipher("AES").getProvider() Here is the javadoc for Cipher class: http://java.sun.com/javase/6/docs/api/javax/crypto/Cipher.html If you can find a simple call that triggers the exception, then I can make it automatically fallback to SunJCE. Otherwise I'll add a system property to make it use "SunJCE" provider, and document in the wiki how to set that up for Glassfish enterprise.

            mindless Alan Harder
            sauvage sauvage
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: