jenkinsci / jenkinsci/java-client-api

occur an error of Error 403 No valid crumb error when invoke a getConsoleOuput method with a buffer

Offen
#508 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
913
Forks
466
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Jenkins and plugins versions report

occur an error of Error 403 No valid crumb error when invoke a getConsoleOuput method with a buffer


```html

Error 403 No valid crumb was included in the request

HTTP ERROR 403 No valid crumb was included in the request

URI:/job/QQQ/job/DEV/job/TICKETTEST2/5/logText/progressiveText
STATUS:403

MESSAGE:No valid crumb was included in the request
SERVLET:Stapler


Powered by Jetty:// 10.0.24

```

## part of my code
### does work case (with a buffer)
``` java
ConsoleLog consoleLog = jenkinsServer.getJob(job).getBuildByNumber(jobNo).details().getConsoleOutputText(buffer); // does not work
String totalChunk = consoleLog.getConsoleLog();

```
### work case (without a buffer)
```
String totalChunk = jenkinsServer.getJob(job).getBuildByNumber(jobNo).details().getConsoleOutputText();

```

### What Operating System are you using (both controller, and any agents involved in the problem)?

i'm using agent and the version is 3.0.8
i'm integration jenkins API with this java client
and i'm developing on mac, linux

### Reproduction steps

1. connect to server with jenkins client
2. find job
3. invoke getConsoleOutput(int buffer)

### Expected Results

output console log of jenkins

### Actual Results

```html

Error 403 No valid crumb was included in the request

HTTP ERROR 403 No valid crumb was included in the request

URI:/job/QQQ/job/DEV/job/TICKETTEST2/5/logText/progressiveText
STATUS:403

MESSAGE:No valid crumb was included in the request
SERVLET:Stapler


Powered by Jetty:// 10.0.24

```

### Anything else?

_No response_

### Are you interested in contributing a fix?

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.