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

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.