• Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • packaging
    • Jenkins Long-term Support Release version 1.565.3-1.1
      CentOS 7.0.1406
      OpenJDK Headless 1.7.0_71

      Hi,

      I was not able to restart Jenkins on my CentOS 7 box by using systemctl, but it was ok after a server reboot.

      I got a HTTP 503 error and NullPointerException into log file.

      I was able to resolve this issue by installing dejavu-sans-fonts package, even on Java headless configuration.

      I think it would be better to add a RPM dependency to dejavu-sans-fonts package (and also probably to fontconfig).

      Regards.

          [JENKINS-25261] Missing dependency on RPM package

          Oleg Nenashev added a comment -

          Could you provide the full stack trace?
          IMO, it's better to make the core fonts-tolerant (e.g. fallback to a default font) instead of adding dependencies into RPM

          Oleg Nenashev added a comment - Could you provide the full stack trace? IMO, it's better to make the core fonts-tolerant (e.g. fallback to a default font) instead of adding dependencies into RPM

          Lionel Beard added a comment -

          Here is it:

          GRAVE: Failed to initialize Jenkins
          hudson.util.AWTProblem: java.lang.NullPointerException
          at hudson.WebAppMain.contextInitialized(WebAppMain.java:182)
          at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
          at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
          at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
          at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
          at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
          at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
          at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
          at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
          at org.eclipse.jetty.server.Server.doStart(Server.java:282)
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
          at winstone.Launcher.<init>(Launcher.java:154)
          at winstone.Launcher.main(Launcher.java:354)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:606)
          at Main._main(Main.java:293)
          at Main.main(Main.java:98)
          Caused by: java.lang.NullPointerException
          at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)
          at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)
          at sun.awt.FontConfiguration.init(FontConfiguration.java:107)
          at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:753)
          at sun.font.SunFontManager$2.run(SunFontManager.java:431)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.font.SunFontManager.<init>(SunFontManager.java:376)
          at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
          at java.lang.Class.newInstance(Class.java:379)
          at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
          at java.security.AccessController.doPrivileged(Native Method)
          at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
          at java.awt.Font.getFont2D(Font.java:490)
          at java.awt.Font.getFamily(Font.java:1219)
          at java.awt.Font.getFamily_NoClientCode(Font.java:1193)
          at java.awt.Font.getFamily(Font.java:1185)
          at java.awt.Font.toString(Font.java:1682)
          at hudson.util.ChartUtil.<clinit>(ChartUtil.java:229)
          at hudson.WebAppMain.contextInitialized(WebAppMain.java:181)
          ... 19 more

          Lionel Beard added a comment - Here is it: GRAVE: Failed to initialize Jenkins hudson.util.AWTProblem: java.lang.NullPointerException at hudson.WebAppMain.contextInitialized(WebAppMain.java:182) at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782) at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424) at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95) at org.eclipse.jetty.server.Server.doStart(Server.java:282) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64) at winstone.Launcher.<init>(Launcher.java:154) at winstone.Launcher.main(Launcher.java:354) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at Main._main(Main.java:293) at Main.main(Main.java:98) Caused by: java.lang.NullPointerException at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264) at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219) at sun.awt.FontConfiguration.init(FontConfiguration.java:107) at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:753) at sun.font.SunFontManager$2.run(SunFontManager.java:431) at java.security.AccessController.doPrivileged(Native Method) at sun.font.SunFontManager.<init>(SunFontManager.java:376) at sun.awt.X11FontManager.<init>(X11FontManager.java:32) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.Class.newInstance(Class.java:379) at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83) at java.security.AccessController.doPrivileged(Native Method) at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) at java.awt.Font.getFont2D(Font.java:490) at java.awt.Font.getFamily(Font.java:1219) at java.awt.Font.getFamily_NoClientCode(Font.java:1193) at java.awt.Font.getFamily(Font.java:1185) at java.awt.Font.toString(Font.java:1682) at hudson.util.ChartUtil.<clinit>(ChartUtil.java:229) at hudson.WebAppMain.contextInitialized(WebAppMain.java:181) ... 19 more

          Daniel Beck added a comment -

          Could you check whether Jenkins runs in headless mode on your box? Configured in /etc/sysconfig/jenkins, see:
          https://github.com/jenkinsci/jenkins/blob/master/rpm/SOURCES/jenkins.sysconfig.in#L37

          Daniel Beck added a comment - Could you check whether Jenkins runs in headless mode on your box? Configured in /etc/sysconfig/jenkins, see: https://github.com/jenkinsci/jenkins/blob/master/rpm/SOURCES/jenkins.sysconfig.in#L37

          Lionel Beard added a comment -

          Yes, I had already checked when I got the issue, Java runs in headless mode.

          Lionel Beard added a comment - Yes, I had already checked when I got the issue, Java runs in headless mode.

          Daniel Beck added a comment -

          This is very weird, as the code in question catches everything that could possibly be thrown. It even runs for the explicit purpose of diagnosing font problems:
          https://github.com/jenkinsci/jenkins/blob/stable-1.565/core/src/main/java/hudson/util/ChartUtil.java#L229

          Could you launch Jenkins on the machine without fonts with `-Dsun.java2d.debugfonts=warning` and report the logging output?

          Daniel Beck added a comment - This is very weird, as the code in question catches everything that could possibly be thrown. It even runs for the explicit purpose of diagnosing font problems: https://github.com/jenkinsci/jenkins/blob/stable-1.565/core/src/main/java/hudson/util/ChartUtil.java#L229 Could you launch Jenkins on the machine without fonts with `-Dsun.java2d.debugfonts=warning` and report the logging output?

          James Nord added a comment -

          @Daniel - the exception isn;t thrown there.
          It is saved as a static reference and checked in https://github.com/jenkinsci/jenkins/blob/stable-1.565/core/src/main/java/hudson/WebAppMain.java#L181

          James Nord added a comment - @Daniel - the exception isn;t thrown there. It is saved as a static reference and checked in https://github.com/jenkinsci/jenkins/blob/stable-1.565/core/src/main/java/hudson/WebAppMain.java#L181

          Daniel Beck added a comment -

          Thanks teilo. Clearly I'm blind.

          I remember that older versions of Jenkins just included an error image if the charts didn't work, so I assumed that was still the case. It's still in hudson.util.Graph#doPng(...) to show headless.png on error (which wouldn't help in this case, but at least it wouldn't break everything).

          What happened to that behavior?

          Daniel Beck added a comment - Thanks teilo . Clearly I'm blind. I remember that older versions of Jenkins just included an error image if the charts didn't work, so I assumed that was still the case. It's still in hudson.util.Graph#doPng(...) to show headless.png on error (which wouldn't help in this case, but at least it wouldn't break everything). What happened to that behavior?

          Just ran into this issue on CentOS 6.5 with Jenkins v1.596.1-1.1 and java-1.8.0-openjdk-headless, "yum -y install fontconfig dejavu-sans-fonts" fixed this issue.

          Michael Prokop added a comment - Just ran into this issue on CentOS 6.5 with Jenkins v1.596.1-1.1 and java-1.8.0-openjdk-headless, "yum -y install fontconfig dejavu-sans-fonts" fixed this issue.

          tjormola added a comment -

          Just wanted to  confirm that this problem still exists.

          CentOS 7.3 x86_64, java-1.8.0-openjdk-headless-1.8.0.131-3.b12.el7_3.x86_64 from CentOS repo, jenkins-2.46.3-1.1.noarch from http://pkg.jenkins.io/redhat-stable and default /etc/sysconfig/jenkins with "-Djava.awt.headless=true" in the Jenkins Tomcat JVM command line. Installing the packages mentioned in the previous comment fixed it.

          tjormola added a comment - Just wanted to  confirm that this problem still exists. CentOS 7.3 x86_64, java-1.8.0-openjdk-headless-1.8.0.131-3.b12.el7_3.x86_64 from CentOS repo, jenkins-2.46.3-1.1.noarch from http://pkg.jenkins.io/redhat-stable and default /etc/sysconfig/jenkins with "-Djava.awt.headless=true" in the Jenkins Tomcat JVM command line. Installing the packages mentioned in the previous comment fixed it.

          Mark Waite added a comment -

          Jenkins switched from System V init to systemd.  Jenkins has dropped support for CentOS 7.  This won't be fixed.

          Mark Waite added a comment - Jenkins switched from System V init to systemd.  Jenkins has dropped support for CentOS 7.  This won't be fixed.

            Unassigned Unassigned
            lionel_lyra Lionel Beard
            Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: