A few months ago I was working on a project which involved building an application estate on the AWS platform, with all the infrastructure scripted using CloudFormation. Part of this included a Jenkins server for building and deploying the applications.
This Jenkins instance was an EC2 server, and part of the install process was using the cloud-init definitions to include plugins if they were not already installed, as well as adding the Jenkins jobs themselves.
One thing I was trying to get working, and failed on, was using the Jenkins CLI to configure the credentials plugin. Each attempt to run a command would have the same result, a return code of “255” with no errors displayed on the client.
I revisited this the other day, and encountered the same issue when using a fresh Jenkins docker image and configuring it through the quick start wizard. After a bit of investigation, the solution to this was frustratingly simple.