java.lang.UnsupportedOperationException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Jenkins hangs with "Please wait while Jenkins is restarting..." after a restart from the GUI. This seems to occur with any restart from the Jenkins GUI. I experienced the same issue when disabling plugins and selecting "Restart Once No Jobs are Running" or selecting the "Restart Safely" plugin. The following error shows in the log: {code} SEVERE: Failed to stop filters java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1040) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846) Mar 21, 2016 1:28:41 PM jenkins.model.Jenkins cleanUp INFO: Jenkins stopped Mar 21, 2016 1:28:41 PM jenkins.model.Jenkins$27 run WARNING: Failed to restart Jenkins java.lang.RuntimeException: Unexpected issues encountered during cleanUp: null at jenkins.model.Jenkins.cleanUp(Jenkins.java:2905) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846) Caused by: java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1040) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) ... 2 more {code} This occurred after an upgrade to Jenkins 1.653. I have also experienced this after running a safeRestart, executed using the following command: {code} curl -u ${key} -X POST -w "%{http_code}" --connect-time 5 --max-time 10 https://ci.gfs.com/scmProductAcquisition/safeRestart {code} where ${key} is the username:apikey. I have verified the login and API with successful logins. The command executes and the server does not shutdown or restart. The process ID remains the same and active. Killing and restarting works fine. Thread dumps produce no logging at all, as if the process did not actually exist.
    via by Daniel Mish,
  • Jenkins hangs with "Please wait while Jenkins is restarting..." after a restart from the GUI. This seems to occur with any restart from the Jenkins GUI. I experienced the same issue when disabling plugins and selecting "Restart Once No Jobs are Running" or selecting the "Restart Safely" plugin. The following error shows in the log: {code} SEVERE: Failed to stop filters java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1040) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846) Mar 21, 2016 1:28:41 PM jenkins.model.Jenkins cleanUp INFO: Jenkins stopped Mar 21, 2016 1:28:41 PM jenkins.model.Jenkins$27 run WARNING: Failed to restart Jenkins java.lang.RuntimeException: Unexpected issues encountered during cleanUp: null at jenkins.model.Jenkins.cleanUp(Jenkins.java:2905) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846) Caused by: java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1040) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) ... 2 more {code} This occurred after an upgrade to Jenkins 1.653. I have also experienced this after running a safeRestart, executed using the following command: {code} curl -u ${key} -X POST -w "%{http_code}" --connect-time 5 --max-time 10 https://ci.gfs.com/scmProductAcquisition/safeRestart {code} where ${key} is the username:apikey. I have verified the login and API with successful logins. The command executes and the server does not shutdown or restart. The process ID remains the same and active. Killing and restarting works fine. Thread dumps produce no logging at all, as if the process did not actually exist.
    via by Daniel Mish,
  • [JIRA] [core] (JENKINS-33845) Jenkins 1.654 cannot restart safely
    via by mmake...@gmail.com (JIRA),
  • Reproduction steps: 1) Select many plugins for upgrade 2) Update them with "restart after installation option" Expected behavior: * Jenkins installs plugins and restarts Actual behavior: * Jenkins shuts down the web UI * Jenkins does not restart due to "Caused by: java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove" * Jenkins cannot open the UI anymore due to the exception from getActiveInstance() Log: {noformat} Mar 22, 2016 5:38:30 PM hudson.model.UpdateCenter$UpdateCenterConfiguration download INFO: Downloading JUnit Plugin Mar 22, 2016 5:38:30 PM jenkins.model.Jenkins$27 run INFO: Restart in 10 seconds Mar 22, 2016 5:38:40 PM jenkins.model.Jenkins$27 run SEVERE: Restarting VM as requested by anonymous Mar 22, 2016 5:38:40 PM jenkins.model.Jenkins cleanUp INFO: Stopping Jenkins Mar 22, 2016 5:38:40 PM jenkins.model.Jenkins$22 onAttained INFO: Started termination Mar 22, 2016 5:38:40 PM com.cloudbees.opscenter.context.Messaging$Local close INFO: Messaging Stopped Mar 22, 2016 5:38:40 PM jenkins.model.Jenkins$22 onAttained INFO: Completed termination Mar 22, 2016 5:38:40 PM jenkins.model.Jenkins _cleanUpDisconnectComputers INFO: Starting node disconnection Mar 22, 2016 5:38:41 PM jenkins.model.Jenkins _cleanUpShutdownPluginManager INFO: Stopping plugin manager Mar 22, 2016 5:38:41 PM jenkins.model.Jenkins _cleanUpPersistQueue INFO: Persisting build queue Mar 22, 2016 5:38:41 PM jenkins.model.Jenkins _cleanUpAwaitDisconnects INFO: Waiting for node disconnection completion Mar 22, 2016 5:38:41 PM jenkins.model.Jenkins _cleanUpPluginServletFilters SEVERE: Failed to stop filters java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1176) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3292) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2945) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3901) Mar 22, 2016 5:38:41 PM jenkins.model.Jenkins cleanUp INFO: Jenkins stopped Mar 22, 2016 5:38:41 PM jenkins.model.Jenkins$27 run WARNING: Failed to restart Jenkins java.lang.RuntimeException: Unexpected issues encountered during cleanUp: null at jenkins.model.Jenkins.cleanUp(Jenkins.java:2960) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3901) Caused by: java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1176) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3292) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2945) ... 2 more Mar 22, 2016 5:38:41 PM org.eclipse.jetty.util.log.JavaUtilLog warn WARNING: Error while serving http://172.30.0.217:8080/adjuncts/b616bb17/lib/layout/menu_right_arrow.png java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167) at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100) at org.kohsuke.stapler.MetaClass$12.dispatch(MetaClass.java:403) at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876) at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649) at org.kohsuke.stapler.Stapler.service(Stapler.java:238) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) .... at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-2.0-alpha-5-SNAPSHOT.jar!/lib/layout/layout.jelly:161:89: <j:invokeStatic> method getActiveInstance threw exception: Jenkins has not been started, or was already shut down at org.kohsuke.stapler.jelly.JellyRequestDispatcher.forward(JellyRequestDispatcher.java:60) at hudson.util.HudsonIsRestarting.doDynamic(HudsonIsRestarting.java:45) ... 65 more Caused by: org.apache.commons.jelly.JellyTagException: jar:file:/var/cache/jenkins/war/WEB-INF/lib/jenkins-core-2.0-alpha-5-SNAPSHOT.jar!/lib/layout/layout.jelly:161:89: <j:invokeStatic> method getActiveInstance threw exception: Jenkins has not been started, or was already shut down at org.apache.commons.jelly.tags.core.InvokeStaticTag.doTag(InvokeStaticTag.java:148) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105) at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63) at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53) at org.kohsuke.stapler.jelly.JellyRequestDispatcher.forward(JellyRequestDispatcher.java:55) .... {noformat}
    via by Oleg Nenashev,
  • I have multiple jenkins installations that are restarted from time to time (one by scheduled jenkins job, others when updating plugins). Since a few days (i would say since 1.653 update), restart from the UI fails with an exception and I need to restart jenkins via command line: INFORMATION: Stopping Jenkins Mär 21, 2016 6:29:27 AM jenkins.model.Jenkins _cleanUpDisconnectComputers INFORMATION: Starting node disconnection Mär 21, 2016 6:29:28 AM hudson.TcpSlaveAgentListener$ConnectionHandler run INFORMATION: Accepted connection #1 from /127.0.0.1:53515 Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpShutdownPluginManager INFORMATION: Stopping plugin manager Mär 21, 2016 6:29:28 AM hudson.plugins.im.JenkinsIsBusyListener removeConnectionProvider INFORMATION: Last connection provider removed. Unregistering this instance. Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpPersistQueue INFORMATION: Persisting build queue Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpAwaitDisconnects INFORMATION: Waiting for node disconnection completion Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpPluginServletFilters SCHWERWIEGEND: Failed to stop filters java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1176) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846) Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins cleanUp INFORMATION: Jenkins stopped Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins$27 run WARNUNG: Failed to restart Jenkins java.lang.RuntimeException: Unexpected issues encountered during cleanUp: null at jenkins.model.Jenkins.cleanUp(Jenkins.java:2905) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846) Caused by: java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1176) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) ... 2 more
    via by Michael michael@wyraz.de,
  • I have multiple jenkins installations that are restarted from time to time (one by scheduled jenkins job, others when updating plugins). Since a few days (i would say since 1.653 update), restart from the UI fails with an exception and I need to restart jenkins via command line: INFORMATION: Stopping Jenkins Mär 21, 2016 6:29:27 AM jenkins.model.Jenkins _cleanUpDisconnectComputers INFORMATION: Starting node disconnection Mär 21, 2016 6:29:28 AM hudson.TcpSlaveAgentListener$ConnectionHandler run INFORMATION: Accepted connection #1 from /127.0.0.1:53515 Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpShutdownPluginManager INFORMATION: Stopping plugin manager Mär 21, 2016 6:29:28 AM hudson.plugins.im.JenkinsIsBusyListener removeConnectionProvider INFORMATION: Last connection provider removed. Unregistering this instance. Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpPersistQueue INFORMATION: Persisting build queue Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpAwaitDisconnects INFORMATION: Waiting for node disconnection completion Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins _cleanUpPluginServletFilters SCHWERWIEGEND: Failed to stop filters java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1176) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846) Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins cleanUp INFORMATION: Jenkins stopped Mär 21, 2016 6:29:28 AM jenkins.model.Jenkins$27 run WARNUNG: Failed to restart Jenkins java.lang.RuntimeException: Unexpected issues encountered during cleanUp: null at jenkins.model.Jenkins.cleanUp(Jenkins.java:2905) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846) Caused by: java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1176) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) ... 2 more
    via by Michael michael@wyraz.de,
    • java.lang.UnsupportedOperationException at java.util.concurrent.CopyOnWriteArrayList$COWIterator.remove(CopyOnWriteArrayList.java:1040) at hudson.util.PluginServletFilter.cleanUp(PluginServletFilter.java:162) at jenkins.model.Jenkins._cleanUpPluginServletFilters(Jenkins.java:3237) at jenkins.model.Jenkins.cleanUp(Jenkins.java:2890) at hudson.lifecycle.UnixLifecycle.restart(UnixLifecycle.java:70) at jenkins.model.Jenkins$27.run(Jenkins.java:3846)

    Users with the same issue

    Unknown visitor
    Unknown visitor2 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,