Skip to content

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

@hrllk

Description

@hrllk

Jenkins and plugins versions report

occur an error of Error 403 No valid crumb error when invoke a getConsoleOuput method with a buffer
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403 No valid crumb was included in the request</h2>
<table>
<tr><th>URI:</th><td>/job/QQQ/job/DEV/job/TICKETTEST2/5/logText/progressiveText</td></tr>
<tr><th>STATUS:</th><td>403</td></tr>

<tr><th>MESSAGE:</th><td>No valid crumb was included in the request</td></tr>
<tr><th>SERVLET:</th><td>Stapler</td></tr>
</table>
<hr/><a href="https://jetty.org">Powered by Jetty:// 10.0.24</a><hr/>

</body>

</html>

part of my code

does work case (with a buffer)

            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>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403 No valid crumb was included in the request</h2>
<table>
<tr><th>URI:</th><td>/job/QQQ/job/DEV/job/TICKETTEST2/5/logText/progressiveText</td></tr>
<tr><th>STATUS:</th><td>403</td></tr>

<tr><th>MESSAGE:</th><td>No valid crumb was included in the request</td></tr>
<tr><th>SERVLET:</th><td>Stapler</td></tr>
</table>
<hr/><a href="https://jetty.org">Powered by Jetty:// 10.0.24</a><hr/>

</body>

</html>

Anything else?

No response

Are you interested in contributing a fix?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions