Job DSL in JCasC fails: `ERROR: (script, line 3) No signature of method: javaposse.jobdsl.dsl.helpers.workflow.BranchSourcesContext.github() is applicable`
AdvancedTroubleshootingPlugins, JCasC & Kubernetes agents
Answer
Likely causes → Static DSL method not available; GitHub branch source is exposed only through the dynamic DSL (branchSource { source { github { ... } } }), or the plugin is missing.
Diagnose → Check the Job DSL API viewer on your controller (/plugin/job-dsl/api-viewer/index.html) for available methods.
Fix →
branchSources { branchSource { source { github {
id('shack-app'); repoOwner('devopsshack'); repository('shack-app')
repositoryUrl('https://github.com/devopsshack/shack-app'); configuredByUrl(true)
credentialsId('github-app')
} } } }
Prevent → Use the API viewer of your own controller as the reference, not internet examples.
More on Plugins, JCasC & Kubernetes agents
Startup log: `SEVERE: Failed Loading plugin Pipeline: Groovy v... (workflow-cps)` with `Update required: Pipeline: Supporting APIs (workflow-support) ... to be updated to ... or higher`IntermediatePlugin fails with `Jenkins (2.426.3) or higher required`BeginnerJCasC fails at startup: `io.jenkins.plugins.casc.ConfiguratorException: Invalid configuration elements for type class jenkins.model.Jenkins : agentProtocols`Intermediate`io.jenkins.plugins.casc.UnknownConfiguratorException: No configurator for the following root elements: sonarGlobalConfiguration`IntermediateJCasC credentials contain the literal text `${GITHUB_TOKEN}` instead of the valueAdvancedKubernetes plugin: `Failure executing: POST at: https://10.96.0.1/api/v1/namespaces/jenkins-agents/pods. Message: pods is forbidden: User "system:serviceaccount:jenkins:jenkins" cannot create resource "pods" in API group "" in the namespace "jenkins-agents".`Beginner