Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-46774

No valid crumb was included in the request

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Blocker Blocker
    • None
    • jenkins 2.60.3 on windows 7 64-bit

      Powershell script not able to trigger jenkins build:

      $API_User = "admin"
      $API_Pass = "password"
      $API_URL = "localhost"
      $API_Port = "8080"
      $API_Job = "test01"

      $Params = @{uri = "http://${API_URL}:${API_Port}/crumbIssuer/api/json";
                  Method = 'Get';
                  Headers = @{Authorization = 'Basic ' + [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes("$(${API_User}):$(${API_Pass})"));}}
      $API_Crumb = Invoke-RestMethod @Params

      $Params = @{uri = "http://${API_URL}:${API_Port}/job/${API_Job}/build";
                  Method = 'Post';
                  Headers = @{'Jenkins-Crumb' = "$API_Crumb.Crumb";}}
      Invoke-RestMethod @Params

       

      error:

      Invoke-RestMethod : HTTP ERROR 403
      Problem accessing /job/test01/build. Reason:
          No valid crumb was included in the request
      Powered by Jetty://

            Unassigned Unassigned
            devharsh devharsh trivedi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: