fedora-copr / resalloc-ibm-cloud

GNU General Public License v2.0
0 stars 2 forks source link

Traceback when deleting resource eventhough the resource was deleted sucessfully #21

Closed nikromen closed 8 months ago

nikromen commented 10 months ago
stopping per kill event
INFO: Removing the failed machine
INFO: Deleting instance test
DEBUG: https://us-east.iaas.cloud.ibm.com:443 "GET /v1/instances?version=2023-11-22&generation=2 HTTP/1.1" 200 None
DEBUG: Available: 0767_a90dee7d-f68d-48c1-bdf6-4a2e534d4db5 test running
DEBUG: Available: 0767_0dbc3aa7-8dab-4229-933d-18cdaabc904b ibm-cloud-production-s390x-00241766-20231122-113119 running
DEBUG: Available: 0767_b496e664-2ea8-452f-8b7c-0392178d303b ibm-cloud-production-s390x-00241691-20231122-044411 running
DEBUG: https://us-east.iaas.cloud.ibm.com:443 "GET /v1/floating_ips?version=2023-11-22&generation=2 HTTP/1.1" 200 None
DEBUG: https://us-east.iaas.cloud.ibm.com:443 "DELETE /v1/instances/0767_a90dee7d-f68d-48c1-bdf6-4a2e534d4db5?version=2023-11-22&generation=2 HTTP/1.1" 204 0
DEBUG: Delete instance request delivered
DEBUG: https://us-east.iaas.cloud.ibm.com:443 "GET /v1/volumes?version=2023-11-22&generation=2&limit=100 HTTP/1.1" 200 None
DEBUG: https://us-east.iaas.cloud.ibm.com:443 "DELETE /v1/volumes/r014-4c77af41-46b7-4495-a5a5-db212e995804?version=2023-11-22&generation=2 HTTP/1.1" 409 209
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/resalloc_ibm_cloud/ibm_cloud_vm.py", line 194, in create_instance
    _wait_for_ssh(ip_address)
  File "/usr/lib/python3.11/site-packages/resalloc_ibm_cloud/ibm_cloud_vm.py", line 289, in _wait_for_ssh
    subprocess.check_call(cmd, stdout=sys.stderr)
  File "/usr/lib64/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['resalloc-aws-wait-for-ssh', '--log', 'debug', '--timeout', '240', '10.130.8.85']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/resalloc-ibm-cloud-vm", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/resalloc_ibm_cloud/ibm_cloud_vm.py", line 344, in main
    create_instance(service, name, opts)
  File "/usr/lib/python3.11/site-packages/resalloc_ibm_cloud/ibm_cloud_vm.py", line 201, in create_instance
    delete_instance(service, instance_name, opts)
  File "/usr/lib/python3.11/site-packages/resalloc_ibm_cloud/ibm_cloud_vm.py", line 224, in delete_instance
    delete_instance_attempt(service, instance_name, opts)
  File "/usr/lib/python3.11/site-packages/resalloc_ibm_cloud/ibm_cloud_vm.py", line 275, in delete_instance_attempt
    resp = service.delete_volume(volume_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/ibm_vpc/vpc_v1.py", line 10001, in delete_volume
    response = self.send(request, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/ibm_cloud_sdk_core/base_service.py", line 329, in send
    raise ApiException(response.status_code, http_response=response)
ibm_cloud_sdk_core.api_exception.ApiException: Error: The volume is still attached to an instance., Code: 409
praiskup commented 10 months ago

The resources are deallocated, right? This seems like a cosmetics, still worth fixing.

nikromen commented 10 months ago

yes, it is only cosmetic issue

praiskup commented 8 months ago

This is a weird traceback anyways. The volume status claim to be "available" because we have this check: https://github.com/fedora-copr/resalloc-ibm-cloud/blob/6038690525f426fc2d51fbaf9a24e1656efdd18c/resalloc_ibm_cloud/ibm_cloud_vm.py#L288-L291