Why am I getting a Class Cast Error with my SSH Credentials

Article ID:218134837
1 minute readKnowledge base

Issue

When trying to access a SSH credential through a script I am getting a class cast error such as the one below:

org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object

Environment

  • CloudBees Operations Center

  • CloudBees Jenkins Enterprise

  • Linux

Resolution

Make sure that the SSH Credential referenced in the error is not stored on both the CloudBees Operations Center instance and the CloudBees Jenkins Enterprise instance