jenkinsci / openstack-cloud-plugin

Provision nodes from OpenStack on demand
https://plugins.jenkins.io/openstack-cloud
MIT License
47 stars 83 forks source link

Boot from volume snapshot issue #220

Closed tpaimpar closed 5 years ago

tpaimpar commented 6 years ago

Hello, I tried to use the 2.40 version, but unfortunately, my previous configuration failed. According to the issue : " jenkins-boot-volumesnapshot-description. Value: None. None is not of type 'string'," I checked that snap has a description.

could you have a look and give some help to solve this issue ?

Provisioning new openstack server zulysse_prod1-1 with options jenkins.plugins.openstack.compute.SlaveOptions@3a59552[bootSource=VolumeSnapshot 74737f0e-8867-4a6b-9a42-05df6b83e87a,hardwareId=fc976af7-2708-466c-9645-fea03b339afd,networkId=57814657-5df0-4847-a697-8d469d1eba86,userDataId=a5893f3f-6759-4ffe-9526-776665d3dc68,...]

Sep 14, 2018 8:26:53 PM WARNING jenkins.plugins.openstack.compute.JCloudsCloud$1 run

Provisioning failed
ClientResponseException{message=Invalid input for field/attribute jenkins-boot-volumesnapshot-description. Value: None. None is not of type 'string', status=400, status-code=BAD_REQUEST}
    at org.openstack4j.core.transport.HttpExceptionHandler.mapException(HttpExceptionHandler.java:38)
    at org.openstack4j.core.transport.HttpExceptionHandler.mapException(HttpExceptionHandler.java:23)
    at org.openstack4j.core.transport.HttpEntityHandler.handleLessThan500(HttpEntityHandler.java:101)
    at org.openstack4j.core.transport.HttpEntityHandler.handle(HttpEntityHandler.java:47)
    at org.openstack4j.connectors.okhttp.HttpResponseImpl.getEntity(HttpResponseImpl.java:69)
    at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:225)
    at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:207)
    at org.openstack4j.openstack.compute.internal.ServerServiceImpl.boot(ServerServiceImpl.java:136)
    at org.openstack4j.openstack.compute.internal.ServerServiceImpl.bootAndWaitActive(ServerServiceImpl.java:144)
    at jenkins.plugins.openstack.compute.internal.Openstack._bootAndWaitActive(Openstack.java:535)
    at jenkins.plugins.openstack.compute.internal.Openstack.bootAndWaitActive(Openstack.java:501)
Caused: jenkins.plugins.openstack.compute.internal.Openstack$ActionFailed: Invalid input for field/attribute jenkins-boot-volumesnapshot-description. Value: None. None is not of type 'string'
    at jenkins.plugins.openstack.compute.internal.Openstack.bootAndWaitActive(Openstack.java:528)
    at jenkins.plugins.openstack.compute.JCloudsSlaveTemplate.provision(JCloudsSlaveTemplate.java:333)
    at jenkins.plugins.openstack.compute.JCloudsSlaveTemplate.provision(JCloudsSlaveTemplate.java:262)
    at jenkins.plugins.openstack.compute.JCloudsSlaveTemplate.provisionSlave(JCloudsSlaveTemplate.java:207)
    at jenkins.plugins.openstack.compute.JCloudsCloud.provisionSlave(JCloudsCloud.java:420)
    at jenkins.plugins.openstack.compute.JCloudsCloud$1.run(JCloudsCloud.java:397)
    at jenkins.security.ImpersonatingScheduledExecutorService$1.run(ImpersonatingScheduledExecutorService.java:58)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

BR

olivergondza commented 6 years ago

This appears as a problem introduced in https://github.com/jenkinsci/openstack-cloud-plugin/commit/1cb26dd3092dcbf9b739dccb94eac339b6ad3d7e, occurring when snapshot you boot from have no description. Attaching it some dummy description sounds like a viable workaround until this is fixed.

@pjdarton, can you please have a look?

pjdarton commented 6 years ago

@olivergondza Yes, I'll take a look. My guess is that, if the description is empty, it's null, and that Value: None. None is not of type 'string' is what happens if you set a metadata field to null. Should be easy enough to fix...

olivergondza commented 6 years ago

@pjdarton, That is how I understand that, too. The fix looks good to me.

pjdarton commented 6 years ago

Prospective fix in #221. @tpaimpar Can you test the fix and let us know (either here or in PR #221) if that fixes the issue for you?

tpaimpar commented 6 years ago

Hello, I'll test as soon as my cloud comes back up !

tpaimpar commented 6 years ago

Hello, I installed the given hpi ( PR #221) and creation of slave from volume snapshot succeed ! ( the snap have a description and creation failed with v2.40) Thx

pjdarton commented 5 years ago

@olivergondza I think you can close this one as "fixed".

olivergondza commented 5 years ago

Great, thanks @pjdarton!