Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

404 on view configSubmit if there are more than one missing views #31

Open
strayer opened this issue Dec 4, 2012 · 9 comments
Open

Comments

@strayer
Copy link

strayer commented Dec 4, 2012

Hi,

not sure what's happening here, but I constantly get this exception:

getting project names from http://localhost:8080/api/json
getting views - nestedWithinView:ourrepo-branches at path: view/ourrepo-branches/api/json
Missing views: [ourrepo-force-https, ourrepo-jenkins, ourrepo-master, ourrepo-new-data-model, ourrepo-save-reports, ourrepo-scrape-kdp-stats, ourrepo-sentry]
creating view - viewName:ourrepo-force-https, nestedView:ourrepo-branches
Trying to find crumb: http://localhost:8080/crumbIssuer/api/json
Couldn't find crumbIssuer for jenkins. Just moving on it may not be needed.
configuring view ourrepo-force-https
creating view - viewName:ourrepo-jenkins, nestedView:ourrepo-branches
configuring view ourrepo-jenkins
creating view - viewName:ourrepo-master, nestedView:ourrepo-branches
configuring view ourrepo-master
Exception in thread "main" java.lang.Exception: Unexpected failure on http://localhost:8080/view/ourrepo-branches/view/ourrepo-master/configSubmit: HTTP/1.1 404 Not Found 404

This only happens when the job needs to create more than one view.

When I run the job several times again until all the views are created it runs like it should - maybe our server is just not fast enough to create the view so configuring fails? No idea... Jenkins is pretty fast, so I don't think this is the problem...

Jenkins version: 1.492

@strayer
Copy link
Author

strayer commented Dec 4, 2012

After some more fiddling it seems this is rather random... I deleted all the views in the nested view, ran the sync job again and it worked. After that I deleted them AGAIN and it failed like this at the last view it had to create.

Very. Confusing.

@aqscucumber
Copy link

This is the stacktrace what I get:

getting project names from http://localhost:8080/jenkins/api/json
Exception in thread "main" java.lang.Exception: Unexpected failure with path http://localhost:8080/jenkins/api/json, HTTP Status Code: 404, full map: [path:api/json]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194)
at com.entagen.jenkins.JenkinsApi.get(JenkinsApi.groovy:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:267)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at com.entagen.jenkins.JenkinsApi.getJobNames(JenkinsApi.groovy:42)
at com.entagen.jenkins.JenkinsApi.getJobNames(JenkinsApi.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3465)
at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:84)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at com.entagen.jenkins.JenkinsJobManager.syncWithRepo(JenkinsJobManager.groovy:33)
at com.entagen.jenkins.JenkinsJobManager$syncWithRepo.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at com.entagen.jenkins.Main.main(Main.groovy:29)
Caused by: groovyx.net.http.HttpResponseException: Not Found
at groovyx.net.http.RESTClient.defaultFailureHandler(RESTClient.java:240)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1047)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:914)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:877)
at groovy.lang.Closure.call(Closure.java:412)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:508)
at groovyx.net.http.RESTClient.get(RESTClient.java:118)
at groovyx.net.http.RESTClient$get.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.entagen.jenkins.JenkinsApi.get(JenkinsApi.groovy:139)
... 26 more

FAILURE: Build failed with an exception.

@oded-simplee
Copy link

If someone is still watching this, I may have fixed this here: #49

@strayer
Copy link
Author

strayer commented Nov 20, 2013

We don't use Jenkins anymore, so I won't be able to comment on this :(

@oded-simplee
Copy link

No worries, just like I found this issue when I was looking for a solution, others will probably find it too.

@MisterXY
Copy link

I got the same problem. Is there any solution?

stacktrace:
getting project names from http://localhost:8080/jenkins/api/json

Exception in thread "main" java.lang.Exception: Unexpected failure with path http://localhost:8080/jenkins/api/json, HTTP Status Code: 404, full map: [path:api/json]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:77)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:71)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrap.callConstructor(ConstructorSite.java:81)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:54)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:182)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:194)
at com.entagen.jenkins.JenkinsApi.get(JenkinsApi.groovy:155)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:46)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at com.entagen.jenkins.JenkinsApi.getJobNames(JenkinsApi.groovy:42)
at com.entagen.jenkins.JenkinsApi.getJobNames(JenkinsApi.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl$GetBeanMethodMetaProperty.getProperty(MetaClassImpl.java:3489)
at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.getProperty(GetEffectivePogoPropertySite.java:84)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGroovyObjectGetProperty(AbstractCallSite.java:231)
at com.entagen.jenkins.JenkinsJobManager.syncWithRepo(JenkinsJobManager.groovy:34)
at com.entagen.jenkins.JenkinsJobManager$syncWithRepo.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at com.entagen.jenkins.Main.main(Main.groovy:30)
Caused by: groovyx.net.http.HttpResponseException: Not Found
at groovyx.net.http.RESTClient.defaultFailureHandler(RESTClient.java:263)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1071)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:938)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:901)
at groovy.lang.Closure.call(Closure.java:415)
at groovyx.net.http.HTTPBuilder$1.handleResponse(HTTPBuilder.java:503)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1070)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:1044)
at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:515)
at groovyx.net.http.RESTClient.get(RESTClient.java:119)
at groovyx.net.http.RESTClient$get.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at com.entagen.jenkins.JenkinsApi.get(JenkinsApi.groovy:146)
... 26 more
:syncWithRepo FAILED

@odedniv
Copy link

odedniv commented Sep 30, 2014

You can use my fork, didn't have any problems since using it

@jamesdh
Copy link
Contributor

jamesdh commented Jun 28, 2015

If you are frequently getting random 404's, I think that is indicative of other issues with your Jenkins/Tomcat setup. Retrying repeatedly is more of a hack than a solution. I'd rather find out what the real problem is.

We've seen very similar (identical?) issues when working with Jenkins instances that were proxied by Apache/Nginx. I'd have to really jog my memory but I'll try and dig up what that was exactly.

@kenorb
Copy link

kenorb commented Sep 19, 2017

Couldn't find crumbIssuer for jenkins

Make sure to enable CSRF Protection by going to Global Security and selecting Prevent Cross Site Request Forgery exploits. This should enable the proper access to /crumbIssuer/api/json address, otherwise it won't exist.

screen shot 2017-09-18 at 17 09 19

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

No branches or pull requests

7 participants