Uploaded image for project: 'jclouds'
  1. jclouds
  2. JCLOUDS-1155

CleanupServer (Openstack Nova) tries to delete in use Security Group.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.0
    • None
    • jclouds-compute
    • Openstack Kilo

    Description

      The CleanupServer class tries to delete the created security groups after deleting the server to clean up security groups created by jclouds.

      However, the logic does not cater for the circumstance, that the security group may be in use by another server started in the same nodegroup. Thus, the delete command for the security group fails, as it is still in use by other nodes started in the same nodegroup.

      Caused by: org.jclouds.http.HttpResponseException: command: DELETE *** failed with response: HTTP/1.1 400 Bad Request; content: [{"badRequest": {"message": "Security Group ac186db1-0f4e-4c1f-8e55-a108a8a2f752 in use.", "code": 400}}]
      at org.jclouds.openstack.nova.v2_0.handlers.NovaErrorHandler.handleError(NovaErrorHandler.java:78) ~[openstack-nova-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:139) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:108) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:90) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:73) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:44) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.reflect.FunctionalReflection$FunctionalInvocationHandler.handleInvocation(FunctionalReflection.java:117) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at com.google.common.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:87) ~[guava.jar:na]
      at com.sun.proxy.$Proxy128.delete(Unknown Source) ~[na:na]
      at org.jclouds.openstack.nova.v2_0.compute.functions.CleanupServer.apply(CleanupServer.java:106) ~[openstack-nova-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.openstack.nova.v2_0.compute.NovaComputeServiceAdapter.destroyNode(NovaComputeServiceAdapter.java:269) ~[openstack-nova-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.compute.strategy.impl.AdaptingComputeServiceStrategies.destroyNode(AdaptingComputeServiceStrategies.java:182) ~[jclouds-compute-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.compute.internal.BaseComputeService$2.apply(BaseComputeService.java:298) ~[jclouds-compute-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.compute.internal.BaseComputeService$2.apply(BaseComputeService.java:295) ~[jclouds-compute-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.util.Predicates2$RetryablePredicate.apply(Predicates2.java:117) ~[jclouds-core-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.compute.internal.BaseComputeService.doDestroyNode(BaseComputeService.java:309) ~[jclouds-compute-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at org.jclouds.compute.internal.BaseComputeService.destroyNode(BaseComputeService.java:250) ~[jclouds-compute-2.0.0-SNAPSHOT.jar:2.0.0-SNAPSHOT]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_91]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_91]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91]
      at com.google.inject.internal.DelegatingInvocationHandler.invoke(DelegatingInvocationHandler.java:50) ~[guice-4.1.0.jar:na]
      at com.sun.proxy.$Proxy104.destroyNode(Unknown Source) ~[na:na]

      It seams that problem occurs only if using Openstack Kilo that has reached EOL.

      When using Openstack Liberty, this error is hidden as:

      server = novaApi.getServerWithSecurityGroupsApi(regionAndId.getRegion()).get()
      .get(regionAndId.getId());

      returns null. This causes the "containsMetadata" function to return false, causing the security group cleanup to be never called.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dbaur Daniel Baur
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: