我们已经完成了下面 hello-spinnaker 示例中描述的所有步骤。我们已经使用 AWS spinnaker 映像在 AWS 中直接配置 spinnaker。
www.spinnaker.io/docs/hello-spinnaker。
我正在尝试创建一个示例管道,如上述示例中所述。但是当我在第一步中创建触发器并选择 jenkins 时,作业没有被填充并且在浏览器中出现错误。
GET http://localhost:8084/v2/builds/Jenkins/jobs 429(请求太多)
实际问题看起来像,当改造试图将来自 jenkins getjobs 的响应映射到 JobList 类时,它在 jenkins 响应 xml 中找到一个属性 _class 并且在 JobList groovy 类中不存在。下面是我们如何尝试找到问题
1)登录 AWS Spinnaker 实例
2) Gate 服务暴露在 8084 端口。
curl http://localhost:8084/v2/builds/Jenkins/jobs。
{"failureCause":"retrofit.RetrofitError: 429 Too Many Requests","error":"Too Many Requests","message":"429 Too Many Requests","status":429,"url":"http://localhost:8088/jobs/Jenkins","timestamp":1462793944530}
3)Igor服务暴露在8088端口。
curl http://localhost:8088/jobs/Jenkins
{"fallbackException":"java.lang.UnsupportedOperationException: No fallback available.","failureType":"COMMAND_EXCEPTION","failureCause":"retrofit.converter.ConversionException: org.simpleframework.xml.core.AttributeException: Attribute '_class' does not have a match in class com.netflix.spinnaker.igor.jenkins.client.model.JobList at line 1","error":"Hystrix Failure","message":"jenkins-Jenkins-getJobs failed and no fallback available.","status":429,"timestamp":1462793896853}
当我检查 igor 日志时,詹金斯民意调查在 getprojects 期间发生的异常很少
Caused by: retrofit.converter.ConversionException: org.simpleframework.xml.core.AttributeException: Attribute '_class' does not have a match in class com.netflix.spinnaker.igor.jenkins.client.model.ProjectsList at line 2
at retrofit.converter.SimpleXMLConverter.fromBody(SimpleXMLConverter.java:38)
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:367)
... 39 common frames omitted
Caused by: org.simpleframework.xml.core.AttributeException: Attribute '_class' does not have a match in class com.netflix.spinnaker.igor.jenkins.client.model.ProjectsList at line 2
4)连接到jenkins并在大三角帆代码中完成工作https://github.com/spinnaker/igor/blob/master/igor-web/src/main/groovy/com/netflix/spinnaker/igor/詹金斯/客户端/JenkinsClient.groovy
resp = requests.get(' http://jenkinserverip:8080/api/xml?tree=jobs[name,jobs[name,jobs[name,jobs[name,jobs[name,jobs[name,jobs[name,jobs] [name,jobs[name,jobs[name]]]]]]]]] ',auth=('admin','password'))
print resp.text
<hudson _class='hudson.model.Hudson'><job _class='hudson.model.FreeStyleProject'><name>Hello Build</name></job><job _class='hudson.model.FreeStyleProject'><name>Hello Poll</name></job></hudson>
因此,由于 jenkins 响应具有 _class 属性,retrofit 在这一行抛出错误http://grepcode.com/file/repo1.maven.org/maven2/com.squareup.retrofit/retrofit/1.9.0/retrofit /RestAdapter.java#383
我想看看我们怎样才能快速解决这个问题,因为它看起来像是 jenkins 兼容性的某个版本。