jenkinsci / jenkinsci/java-client-api

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

Đang mở
#508 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
913
Fork
466
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start at the getConsoleOutput(int buffer) entry point and compare its request to the no-buffer getConsoleOutput() overload. Trace the progressiveText request shown in the report and determine why the buffered path receives Jenkins' 403 crumb response. Done means invoking the buffered method returns console output without that error.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.