Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when I use the all_builds #86

Open
Richardsh opened this issue Jul 14, 2021 · 2 comments
Open

error when I use the all_builds #86

Richardsh opened this issue Jul 14, 2021 · 2 comments

Comments

@Richardsh
Copy link

Richardsh commented Jul 14, 2021

the code is below
jenkins.all_builds('xxxx', 'id,timestamp,result,actions[*]', function(err, data) {
if (err){
console.log('err1', err);
}
console.log('data',data)
});
it runs error and returns ‘Server returned unexpected status code: 400’

but when I use last build it works successfully

jenkins.last_build_info('xxxx', function(err, data) {
if (err){ return console.log('err1', err); }
console.log(data)
});

who can tell me how to solve or the reason is about jenkins set not my code's problem

@see311
Copy link

see311 commented May 4, 2022

this error is caused by the invalid character, you can find '[]' this two is invalid in tomcat of the request url api/json?tree=allBuilds[id,timestamp,result,duration].
for the temporary solution, you can wrap the biuldUrl function by encodeURI in the lib/main.js of line 309. or you can overwrite this allBuilds function by yourself.

@see311
Copy link

see311 commented May 23, 2022

this error is caused by the invalid character, you can find '[]' this two is invalid in tomcat of the request url api/json?tree=allBuilds[id,timestamp,result,duration]. for the temporary solution, you can wrap the biuldUrl function by encodeURI in the lib/main.js of line 309. or you can overwrite this allBuilds function by yourself.

But this solution may caused another issue, that the params of build-with-params also be encode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants