jenkins-api.rs icon indicating copy to clipboard operation
jenkins-api.rs copied to clipboard

WinError 10013 reported when executing example code

Open frozenjackxp opened this issue 2 years ago • 2 comments

I follow the example in wiki,and my OS is windows 11 pro with gnu but I got a WinError 10013

Error: reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Ipv4(192.168.10.117)), port: Some(8080), path: "/jenkins/job/chipset_pipeline_release/api/json", query: Some("depth=1"), fragment: None }, source: hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 10013, kind: PermissionDenied, message: "An attempt was made to access a socket in a way forbidden by its access" })) }

I have tried to create a JenkinsBuilder with user and without user,but the same error was reported the following is my code:

extern crate jenkins_api;

use jenkins_api::JenkinsBuilder;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let jenkins = JenkinsBuilder::new("http://192.168.10.117:8080/jenkins").with_user("jenkins", Some("buildit123")).build()?;

    let job = jenkins.get_job("my_devops_job")?;
    let build = job.last_build.as_ref().unwrap().get_full_build(&jenkins)?;

    println!("last build for job {} at {} was {:?}", job.name, build.timestamp, build.result);
    Ok(())
}

Please give me some pointers, thank you

frozenjackxp avatar Aug 23 '21 11:08 frozenjackxp

Googling the error code or error message seems to be either about a port being already used, or a process needing increased privileges from Windows...

I don't have access to a Windows computer, so I'm not sure how to fix that, sorry

mockersf avatar Aug 24 '21 00:08 mockersf

Thank you all the same, i'll try to connect to jenkins with raw rust APIs on Windows

frozenjackxp avatar Aug 24 '21 08:08 frozenjackxp