Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Trigger Jenkins Build task failing



  • I'm trying to trigger a Jenkins job from BuildMaster using the Jenkins Plugin (vs 4.4.1)

    1. I have configured the Jenkins job to allow "Trigger builds remotely" and set an Authentication Token of "BUILDMASTER"

    2. In BuildMaster I configured the Jenkins extension with the url - http:\jenkins, user name and API token for that user. (NOTE: Jenkins is configured to use Active Directory authentication).

    3. In BuildMaster I created a job using the Trigger Jenkins Build task, left the config profile set to "Extension Default" set the job name to valid job and build parameters to "token=BUILDMASTER&VERSION_NUMBER=0.0.0.0"

    4. I have tested the url I expect the extension to generate and that worked find: http://jenkins/job/PaxHoldRelease-Build/buildWithParameters?token=BUILDMASTER&VERSION_NUMBER=0.0.0.0

    5. When running via BuildMaster however I get this in the logs (Note: it gets correct jenkins build number so is talking to jenkins):

    Determining next Jenkins build number...Triggering Jenkins Build #4...

    An unhandled exception occurred while executing this action: System.Net.WebException: The remote server returned an error: (403) Forbidden. at Inedo.BuildMaster.Extensibility.Actions.RemoteCommandExecution.RemoteCommandExecuter.ExecuteCommand(RemoteActionBase remoteAction, String commandName, String[] commandArgs) at Inedo.BuildMaster.Extensibility.Agents.Local.LocalAgent.Inedo.BuildMaster.Extensibility.Agents.IRemoteCommandExecuter.ExecuteCommand(RemoteActionBase action, String commandName, String[] commandArgs) at Inedo.BuildMaster.Extensibility.Actions.RemoteActionBase.ExecuteRemoteCommand(String name, String[] args) at Inedo.BuildMasterExtensions.Jenkins.TriggerBuildAction.Execute() at Inedo.BuildMaster.Extensibility.Actions.ActionBase.ExecuteInternal(IActionExecutionContext context, ExtensionConfigurerBase extensionConfigurer, Boolean resumeNextOnError, Boolean logErrorsAsWarnings)

    I've also tried running the BuildMaster service from command line to inspect the output but couldn't find anything special in it.

    Any ideas???

    Product: BuildMaster
    Version: 4.5.6



  • I've found this in the Jenkins jobs.

    INFO: While serving http://jenkins/job/PaxHoldRelease-Build/buildWithParameters: hudson.security.AccessDeniedException2: anonymous is missing the Job/Build permission

    Work Around

    I managed to get this working by granting Anonymous users Read and Build priviledges in Jenkins

    NOTE: In Jenkins the secuirty realm is Active Directory (used AD plugin) and authorisation wass "Logged-in users can do anything" but had to change to Matrix based security.

    The Plugin

    I'm not convinced that the Jenkins plugin is authenticating correctly against Jenkins but am unable to test this out. All the Jenkins documentation would suggest that I shouldn't need the work around I now have in place.



  • Thanks for the detailed report; we'd have to inspect how the AD Plug-in works with Jenkins. It's very possible API authentication works bit differently.



  • I was having the same issue, but without the AD setup. I was just using Jenkins' built in authentication. It seems to have been related to http://inedo.com/support/questions/2854#inline-post-2854, which was fixed in the Jenkins plugin update released a couple days ago.

    Without making any other changes, updating the Jenkins plugin changed my 403 error to a 500 error, and the Jenkins log showed I forgot to mark the build as parameterized, even though I had marked it to Trigger Build Remotely with a token configured. I added a "token" parameter under "This build is parameterized," and BuildMaster is now able to create a new build in Jenkins.

    Hopefully the AD part isn't actually an issue for you after the plugin upgrade.



  • I'm surprised that this patch fixed the authentication issue but build trigger authentication is now working perfectly. Thanks for the heads-up.



  • The latest release of the Jenkins plugin that fixed a bug with the url parameter encoding also fixed the authentication issues.



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation