mockersf / jenkins-api.rs

Rust client for Jenkins API
MIT License
26 stars 17 forks source link

WinError 10013 reported when executing example code #79

Open frozenjackxp opened 3 years ago

frozenjackxp commented 3 years ago

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

mockersf commented 3 years ago

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

frozenjackxp commented 3 years ago

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