jenkinsci / jenkinsci/java-client-api

Sending POST http request for Job.build(Map<String, String> params, boolean crumbFlag) with crumbFlag=true raised java.lang.IllegalArgumentException: Name may not be null

オープン
#433 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Java
スター
913
フォーク
466
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi, I am quiet new to Jenkins client API. I'm trying to use the `Job.build` method to kick off a parameterized job with `crumb` flag set to `true`.
However, it threw this exception:
```
java.lang.IllegalArgumentException: Name may not be null
at org.apache.http.util.Args.notNull(Args.java:54)
at org.apache.http.message.BasicHeader.(BasicHeader.java:61)
at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:233)
at com.offbytwo.jenkins.model.Job.build(Job.java:151)
```

Inspecting further in `JenkinsHttpClient.java`, it looks like the issue is with crumb issuer path:
```
Crumb crumb = getQuietly("/crumbIssuer", Crumb.class);
```

Shouldn't this be `crumbIssuer/api/xml` or `crumbIssuer/api/json`??

I can't turn off CSRF in this Jenkins instance, so that's not an option. How can I workaround or fix this issue?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。