New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ClassCastException: java.util.HashMap$Node cannot be cast to java.util.HashMap$TreeNode #2975

Closed
vinillum opened this Issue Dec 4, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@vinillum
Copy link

vinillum commented Dec 4, 2017

Issue type: Bug report

My Rundeck detail

  • Rundeck version: 2.9.2-1
  • install type: rpm
  • OS Name/version: Red Hat Enterprise Linux 6.5
  • DB Type/version: mysql 14.14

Behavior
One of the job executions failed with the following error:
`

00:15:33 localhost   java.lang.ClassCastException: java.util.HashMap$Node cannot be cast to java.util.HashMap$TreeNode
00:15:33     at java.util.HashMap$TreeNode.moveRootToFront(HashMap.java:1827)
00:15:33     at java.util.HashMap$TreeNode.removeTreeNode(HashMap.java:2115)
00:15:33     at java.util.HashMap.removeNode(HashMap.java:839)
00:15:33     at java.util.HashMap.remove(HashMap.java:798)
00:15:33     at java_util_Map$remove$9.call(Unknown Source)
00:15:33     at rundeck.services.WorkflowService.persistExecutionState(WorkflowService.groovy:237)
00:15:33     at sun.reflect.GeneratedMethodAccessor1923.invoke(Unknown Source)
00:15:33     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:15:33     at java.lang.reflect.Method.invoke(Method.java:498)
00:15:33     at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
00:15:33     at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
00:15:33     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
00:15:33     at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
00:15:33     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
00:15:33     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1163)
00:15:33     at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
00:15:33     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
00:15:33     at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
00:15:33     at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:190)
00:15:33     at rundeck.services.WorkflowService$_createWorkflowStateListenerForExecution_closure3.doCall(WorkflowService.groovy:211)
00:15:33     at sun.reflect.GeneratedMethodAccessor1285.invoke(Unknown Source)
00:15:33     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:15:33     at java.lang.reflect.Method.invoke(Method.java:498)
00:15:33     at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
00:15:33     at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
00:15:33     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
00:15:33     at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
00:15:33     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
00:15:33     at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:925)
00:15:33     at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:908)
00:15:33     at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:168)
00:15:33     at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeClosure(ScriptBytecodeAdapter.java:574)
00:15:33     at com.dtolabs.rundeck.app.internal.workflow.WorkflowStateListenerAction.workflowExecutionStateChanged(WorkflowStateListenerAction.groovy:42)
00:15:33     at com.dtolabs.rundeck.core.execution.workflow.state.WorkflowExecutionStateListenerAdapter.notifyAllWorkflowState(WorkflowExecutionStateListenerAdapter.java:57)
00:15:33     at com.dtolabs.rundeck.core.execution.workflow.state.WorkflowExecutionStateListenerAdapter.finishWorkflowExecution(WorkflowExecutionStateListenerAdapter.java:112)
00:15:33     at sun.reflect.GeneratedMethodAccessor1075.invoke(Unknown Source)
00:15:33     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
00:15:33     at java.lang.reflect.Method.invoke(Method.java:498)
00:15:33     at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
00:15:33     at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
00:15:33     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1218)
00:15:33     at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1125)
00:15:33     at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
00:15:33     at org.codehaus.groovy.runtime.InvokerHelper.invokePojoMethod(InvokerHelper.java:913)
00:15:33     at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:904)
00:15:33     at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:168)
00:15:33     at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodNSafe(ScriptBytecodeAdapter.java:176)
00:15:33     at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodNSpreadSafe(ScriptBytecodeAdapter.java:183)
00:15:33     at com.dtolabs.rundeck.app.internal.workflow.MultiWorkflowExecutionListener.finishWorkflowExecution(MultiWorkflowExecutionListener.groovy:76)
00:15:33     at com.dtolabs.rundeck.core.execution.workflow.BaseWorkflowExecutor.executeWorkflow(BaseWorkflowExecutor.java:229)
00:15:33     at com.dtolabs.rundeck.core.execution.WorkflowExecutionServiceThread.runWorkflow(WorkflowExecutionServiceThread.java:76)
00:15:33     at com.dtolabs.rundeck.core.logging.LoggingManagerImpl$MyPluginLoggingManager.runWith(LoggingManagerImpl.java:120)
00:15:33     at com.dtolabs.rundeck.core.execution.WorkflowExecutionServiceThread.run(WorkflowExecutionServiceThread.java:67)
00:15:33     java.util.HashMap$Node cannot be cast to java.util.HashMap$TreeNode

`

How to Reproduce

Uncertain at this point, as this job has succeeded several other times without issues, but failed on this instance only.

@BornTKill

This comment has been minimized.

Copy link

BornTKill commented Jan 3, 2019

Dear,

I’m also facing the same issue since i migrated from 2.x to 3.0.11. May it be related to java version ? I’m in 1.8u81

@gschueler gschueler added the bug label Jan 3, 2019

@gschueler gschueler added this to the 3.0.12 milestone Jan 3, 2019

@gschueler

This comment has been minimized.

Copy link
Member

gschueler commented Jan 3, 2019

I think this is caused by non threadsafe access to the same underlying map, it should be easy to fix

gschueler added a commit that referenced this issue Jan 3, 2019

gschueler added a commit that referenced this issue Jan 7, 2019

Merge pull request #4355 from rundeck/issue/2975
Fix #2975 multiple threads modify the map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment