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

deleteJob throws exception but works anyway... #154

Closed
cshupp1 opened this issue Apr 22, 2016 · 9 comments
Closed

deleteJob throws exception but works anyway... #154

cshupp1 opened this issue Apr 22, 2016 · 9 comments
Milestone

Comments

@cshupp1
Copy link

cshupp1 commented Apr 22, 2016

Consider the following JRuby code:

java_import 'com.offbytwo.jenkins.JenkinsServer' do |p, c|
  'JenkinsServer'
end
  jenkins = JenkinsServer.new(java.net.URI.new("some_url"), "user", "password")
  xml = IO.read('./config.xml')
jenkins.createJob("cris", xml, false)

The job does show up in Jenkins as expected.

If I delete the job it deletes it as expected:

jenkins.deleteJob("cris")

But it throws an exception:

irb(main):022:0>   jenkins.deleteJob("cris")
org.apache.http.client.HttpResponseException: Not Found
        at com.offbytwo.jenkins.client.validator.HttpResponseValidator.validateResponse(HttpResponseValidator.java:11)
        at com.offbytwo.jenkins.client.JenkinsHttpClient.get(JenkinsHttpClient.java:146)
        at com.offbytwo.jenkins.client.JenkinsHttpClient.getQuietly(JenkinsHttpClient.java:186)
        at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:226)
        at com.offbytwo.jenkins.client.JenkinsHttpClient.post(JenkinsHttpClient.java:397)
        at com.offbytwo.jenkins.JenkinsServer.deleteJob(JenkinsServer.java:482)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:452)

So, for clarity, the job is deleted from Jenkins, but it appears to have failed. I am using 0.3.3.
Jenkins ver. 1.656

@khmarbaise
Copy link
Member

Can you check if it happens with the current state of Jenkins Client ?

@cshupp1
Copy link
Author

cshupp1 commented May 3, 2016

What should I use?

I am using this right now:

    <dependency>
    <groupId>com.offbytwo.jenkins</groupId>
    <artifactId>jenkins-client</artifactId>
    <version>0.3.3</version>
    </dependency>

@khmarbaise khmarbaise added this to the Release 0.3.4 milestone May 3, 2016
@khmarbaise
Copy link
Member

Please use new release version 0.3.4

@cshupp1
Copy link
Author

cshupp1 commented May 5, 2016

0.3.4 is not out there.

http://mvnrepository.com/artifact/com.offbytwo.jenkins/jenkins-client

Now what? Is it in a private repo?

@khmarbaise
Copy link
Member

khmarbaise commented May 5, 2016

You should look here: http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.offbytwo.jenkins%22%20a%3A%22jenkins-client%22 cause this is maven Central. I don't know in which intervals mvnrepository.com will be synched....it must be more than 24 hours...cause i released it two days ago....

@cshupp1
Copy link
Author

cshupp1 commented May 5, 2016

Thanks!

On Thu, May 5, 2016 at 12:56 PM, Karl Heinz Marbaise <
[email protected]> wrote:

You should look here:
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.offbytwo.jenkins%22%20a%3A%22jenkins-client%22
cause this is maven Central. I don't know in which intervals
mvnrepository.com will be synched....


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#154 (comment)

@darmbrust
Copy link

Hi,
I work with Cris - for whatever reason, our nexus repo which mirrors from central was unable to find 0.3.4, then a quick google search lead to the link above, which also didn't show it.... I'll take another look at our nexus config and try to figure out why it couldn't find it on central.

@khmarbaise
Copy link
Member

You mean the mvnrepository.com didn't showed it? Does you nexus update the central index on a regular basis? Maybe only once a week ? That's often the problem...Just let your nexus pick update the index more often..may be once per day...

@darmbrust
Copy link

Must have been an interval miss or something - I see that our local nexus repo has picked it up now.

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

3 participants