Attempting to delete a job with a P4 workspace will return an error, and fail to delete the job. Tested on freestyle jobs and can repro by creating a new job configured with a P4 workspace, running the job at least one time, and attempting to delete the job. An error page will be returned and the job will remain existing but disabled.
Issue occurs even when server is configured to not delete workspace or files during job deletion. The problem started when P4 plugin was updated to 1.18.0 from 1.17.2.
 Error log:
hudson.AbortException: Jenkins.instance is missing. Read the documentation of Jenkins.getInstanceOrNull to see what you are doing wrong. at PluginClassLoader for p4//org.jenkinsci.plugins.p4.client.ClientHelper.clientLogin(ClientHelper.java:180) at PluginClassLoader for p4//org.jenkinsci.plugins.p4.client.ClientHelper.<init>(ClientHelper.java:106) at PluginClassLoader for p4//org.jenkinsci.plugins.p4.tasks.AbstractTask.tryTask(AbstractTask.java:172) Also:Â Â hudson.remoting.Channel$CallSiteStackTrace: Remote call to x_node at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1916) at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:384) at hudson.remoting.Channel.call(Channel.java:1108) at hudson.FilePath.act(FilePath.java:1220) at hudson.FilePath.act(FilePath.java:1209) at PluginClassLoader for p4//org.jenkinsci.plugins.p4.PerforceScm.processWorkspaceBeforeDeletion(PerforceScm.java:1064) at hudson.scm.SCM.processWorkspaceBeforeDeletion(SCM.java:249) at hudson.model.AbstractProject.performDelete(AbstractProject.java:367) at hudson.model.AbstractItem.delete(AbstractItem.java:820) at hudson.model.Job.delete(Job.java:735) at hudson.model.AbstractItem.doDoDeleteImpl(AbstractItem.java:727) at hudson.model.AbstractItem.doDoDelete(AbstractItem.java:713)
Issue can be worked around by removing P4 source control settings from the job config, and re-attempting the delete.
Â
Â
Â
Â
Â
Â
Â