DeltaCloud
  1. DeltaCloud
  2. DTACLOUD-169

Deltacloud API does not validate for the existence of an load balancer while deleting it in EC2 setup

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Component/s: Client (Ruby), Server
    • Labels:
      None
    • Environment:
      Deltacloud API 0.5.0
      commit - 7e372dfca79c02a799046287e5936129216b781b
      OS - Fedora 16, RHEl 6.1
      Setup - EC2

      Description

      Deltacloud API does not validate for the existence of an load balancer while deleting it for EC2 setup.

      Scenario's:
      ==========
      1. Try deleting the an existing load balancer multiple times
      2. Try deleting the non existing load balancer (can be executed multiple times also)

      Curl Command: (Note i have executed this command trice and deltacloud API does not seems to validate and give the same output in the console)
      ===========
      curl -X DELETE --user "user:password" "http://localhost:3003/api/load_balancers/ramesh-test-lb?format=xml"

      Console o/p:
      =========
      First time:
      ========
      I, 2012-03-22T18:08:14.750269 #11412 INFO – : New Aws::Elb using per_thread-connection mode
      I, 2012-03-22T18:08:14.750591 #11412 INFO – : Deleting Load Balancer - ramesh-test-lb
      W, 2012-03-22T18:08:14.751262 #11412 WARN – : Rightscale::HttpConnection : request failure count: 1, exception: #<Errno::EPIPE: Broken pipe>
      I, 2012-03-22T18:08:14.751330 #11412 INFO – : Opening new HTTPS connection to elasticloadbalancing.us-east-1.amazonaws.com:443
      127.0.0.1 - - [22/Mar/2012 18:08:16] "DELETE /api/load_balancers/ramesh-test-lb?format=xml HTTP/1.1" 204 - 1.6519

      Second Time:
      ==========
      I, 2012-03-22T18:08:25.004502 #11412 INFO – : New Aws::Elb using per_thread-connection mode
      I, 2012-03-22T18:08:25.004618 #11412 INFO – : Deleting Load Balancer - ramesh-test-lb
      W, 2012-03-22T18:08:25.005328 #11412 WARN – : Rightscale::HttpConnection : request failure count: 1, exception: #<Errno::EPIPE: Broken pipe>
      I, 2012-03-22T18:08:25.005416 #11412 INFO – : Opening new HTTPS connection to elasticloadbalancing.us-east-1.amazonaws.com:443
      127.0.0.1 - - [22/Mar/2012 18:08:26] "DELETE /api/load_balancers/ramesh-test-lb?format=xml HTTP/1.1" 204 - 1.6351

      Third Time:
      ========
      I, 2012-03-22T18:08:28.944863 #11412 INFO – : New Aws::Elb using per_thread-connection mode
      I, 2012-03-22T18:08:28.945209 #11412 INFO – : Deleting Load Balancer - ramesh-test-lb
      W, 2012-03-22T18:08:28.945891 #11412 WARN – : Rightscale::HttpConnection : request failure count: 1, exception: #<Errno::EPIPE: Broken pipe>
      I, 2012-03-22T18:08:28.945966 #11412 INFO – : Opening new HTTPS connection to elasticloadbalancing.us-east-1.amazonaws.com:443
      127.0.0.1 - - [22/Mar/2012 18:08:30] "DELETE /api/load_balancers/ramesh-test-lb?format=xml HTTP/1.1" 204 - 1.6125

        Activity

        Hide
        Michal Fojtik added a comment -

        commit c3dd00f17ad45633bd61357d4168d30f3e099dac
        Author: Michal Fojtik <mfojtik@redhat.com>
        Date: Wed May 9 15:37:50 2012 +0200

        EC2: Return HTTP_NOT_FOUND when deleting non-existing load-balancer (DTACLOUD-169)

        Show
        Michal Fojtik added a comment - commit c3dd00f17ad45633bd61357d4168d30f3e099dac Author: Michal Fojtik <mfojtik@redhat.com> Date: Wed May 9 15:37:50 2012 +0200 EC2: Return HTTP_NOT_FOUND when deleting non-existing load-balancer ( DTACLOUD-169 )
        Hide
        Ramesh A added a comment -

        Verification Failed. Hence re-opening this issue

        Environment:
        ==========
        OS- RHEL 6.2, Fedora 16
        [root@server ~]# rpm -qa| grep deltacloud
        deltacloud-core-ec2-0.6.0-2.el6.noarch
        deltacloud-core-0.6.0-2.el6.noarch
        deltacloud-core-all-0.6.0-2.el6.noarch
        deltacloud-core-rhevm-0.6.0-2.el6.noarch
        deltacloud-core-doc-0.6.0-2.el6.noarch
        deltacloud-core-vsphere-0.6.0-2.el6.noarch

        Also, found in commit - c71c8cceee27fb356651fd3100dc2ac6fd83accd

        Verification Details:
        ==============

        Deleting from Web-ui:
        ================
        1. Displays "Sinatra doesn’t know this ditty" on the web page
        2 Throws error in the terminal

        Log Snippet:
        ==========
        127.0.0.1 - - [12/Jun/2012 06:34:09] "GET /api/_sinatra_/404.png HTTP/1.1" 404 463 0.0129

        Deleting from cURL:
        ===============
        Tried two scenarios
        1. Deleting an existing Load Balancer
        2. Deleting an non-existing Load Balancer

        Both of the above scenarios yields the same result

        [rananda@rananda ~]$ curl -X Delete --user "username:password" "http://localhost:3003/api/load_balancers/ramesh-test-aws-lb?format=xml"
        curl: (52) Empty reply from server

        Log o/p:
        ========
        !! Invalid request
        Invalid HTTP format, parsing fails.
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/request.rb:82:in `execute'
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/request.rb:82:in `parse'
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data'
        /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
        /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in `start'
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/server.rb:159:in `start'
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/controllers/controller.rb:86:in `start'
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `send'
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `run_command'
        /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:151:in `run!'
        /usr/share/deltacloud-core/bin/deltacloudd:239
        /usr/bin/deltacloudd:5:in `load'
        /usr/bin/deltacloudd:5

        Show
        Ramesh A added a comment - Verification Failed. Hence re-opening this issue Environment: ========== OS- RHEL 6.2, Fedora 16 [root@server ~] # rpm -qa| grep deltacloud deltacloud-core-ec2-0.6.0-2.el6.noarch deltacloud-core-0.6.0-2.el6.noarch deltacloud-core-all-0.6.0-2.el6.noarch deltacloud-core-rhevm-0.6.0-2.el6.noarch deltacloud-core-doc-0.6.0-2.el6.noarch deltacloud-core-vsphere-0.6.0-2.el6.noarch Also, found in commit - c71c8cceee27fb356651fd3100dc2ac6fd83accd Verification Details: ============== Deleting from Web-ui: ================ 1. Displays "Sinatra doesn’t know this ditty" on the web page 2 Throws error in the terminal Log Snippet: ========== 127.0.0.1 - - [12/Jun/2012 06:34:09] "GET /api/_ sinatra _/404.png HTTP/1.1" 404 463 0.0129 Deleting from cURL: =============== Tried two scenarios 1. Deleting an existing Load Balancer 2. Deleting an non-existing Load Balancer Both of the above scenarios yields the same result [rananda@rananda ~] $ curl -X Delete --user "username:password" "http://localhost:3003/api/load_balancers/ramesh-test-aws-lb?format=xml" curl: (52) Empty reply from server Log o/p: ======== !! Invalid request Invalid HTTP format, parsing fails. /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/request.rb:82:in `execute' /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/request.rb:82:in `parse' /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/connection.rb:42:in `receive_data' /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine' /usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run' /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/backends/base.rb:61:in `start' /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/server.rb:159:in `start' /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/controllers/controller.rb:86:in `start' /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `send' /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:185:in `run_command' /usr/lib/ruby/gems/1.8/gems/thin-1.2.11/lib/thin/runner.rb:151:in `run!' /usr/share/deltacloud-core/bin/deltacloudd:239 /usr/bin/deltacloudd:5:in `load' /usr/bin/deltacloudd:5
        Hide
        Ramesh A added a comment - - edited

        Verified and working fine.

        I am sorry about my typo mistake error in my previous comment regarding the curl command. The correct command is supposed to be "curl -X DELETE" and not "curl -X Delete". Thanks Michal for pointing out this to me.

        Here is the test result w.r.t the above comments
        1. Deleting from Web-ui:
        ==================
        This was an error which has been fixed in https://issues.apache.org/jira/browse/DTACLOUD-231

        2. Deleting from cURL:
        ================
        a) Deleting an existing loadbalancer results in 204 response code
        log output
        =======
        I, 2012-06-12T06:21:24.288446 #3306 INFO – : New Aws::Elb using per_thread-connection mode
        I, 2012-06-12T06:21:24.289473 #3306 INFO – : New Aws::Elb using per_thread-connection mode
        I, 2012-06-12T06:21:24.291163 #3306 INFO – : Describing Load Balancers
        I, 2012-06-12T06:21:24.340342 #3306 INFO – : New Aws::Ec2 using per_thread-connection mode
        I, 2012-06-12T06:21:24.410757 #3306 INFO – : Deleting Load Balancer - ramesh-test-aws-lb
        10.11.10.162 - - [12/Jun/2012 06:21:24] "DELETE /api/load_balancers/ramesh-test-aws-lb?format=xml HTTP/1.1" 204 - 0.1917

        b) Deleting an non existing loadbalancer results in 404 response code
        log output:
        =======
        I, 2012-06-12T06:11:51.844047 #3268 INFO – : New Aws::Elb using per_thread-connection mode
        I, 2012-06-12T06:11:51.846874 #3268 INFO – : New Aws::Elb using per_thread-connection mode
        I, 2012-06-12T06:11:51.847014 #3268 INFO – : Describing Load Balancers
        I, 2012-06-12T06:11:51.848183 #3268 INFO – : Opening new HTTPS connection to elasticloadbalancing.us-east-1.amazonaws.com:443
        W, 2012-06-12T06:11:52.086191 #3268 WARN – : ##### Aws::Elb returned an error: 400 Bad Request
        <ErrorResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2009-05-15/">
        <Error>
        <Type>Sender</Type>
        <Code>LoadBalancerNotFound</Code>
        </Error>
        <RequestId>07ac5d56-b477-11e1-afb7-8f588567225c</RequestId>
        </ErrorResponse>
        #####
        W, 2012-06-12T06:11:52.086360 #3268 WARN – : ##### Aws::Elb request: elasticloadbalancing.us-east-1.amazonaws.com:443/?AWSAccessKeyId=AKIAIPXNUEQVP32G4T2A&Action=DescribeLoadBalancers&LoadBalancerNames.member.1=ramesh-test-lb-dc&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-06-12T10%3A11%3A51.000Z&Version=2009-05-15&Signature=GZxGTrmadmQx0Gk9K0mSxDH9FJcPmeTJopOU%2BVYSLXc%3D ####
        Aws::AwsError:400: Bad Request (elasticloadbalancing.us-east-1.amazonaws.com:443/?AWSAccessKeyId=AKIAIPXNUEQVP32G4T2A&Action=DescribeLoadBalancers&LoadBalancerNames.member.1=ramesh-test-lb-dc&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-06-12T10%3A11%3A51.000Z&Version=2009-05-15&Signature=GZxGTrmadmQx0Gk9K0mSxDH9FJcPmeTJopOU%2BVYSLXc%3D)
        REQUEST=elasticloadbalancing.us-east-1.amazonaws.com:443/?AWSAccessKeyId=AKIAIPXNUEQVP32G4T2A&Action=DescribeLoadBalancers&LoadBalancerNames.member.1=ramesh-test-lb-dc&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-06-12T10%3A11%3A51.000Z&Version=2009-05-15&Signature=GZxGTrmadmQx0Gk9K0mSxDH9FJcPmeTJopOU%2BVYSLXc%3D
        REQUEST ID=undefined
        /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/awsbase.rb:572:in `request_info_impl'
        /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/awsbase.rb:316:in `request_info2'
        /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/elb/elb_interface.rb:59:in `request_info'
        /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/elb/elb_interface.rb:161:in `describe_load_balancers'
        /usr/share/deltacloud-core/lib/deltacloud/./helpers/../drivers/ec2/ec2_driver.rb:363:in `load_balancers'
        /usr/share/deltacloud-core/lib/deltacloud/./drivers/exceptions.rb:173:in `call'
        /usr/share/deltacloud-core/lib/deltacloud/./drivers/exceptions.rb:173:in `safely'
        /usr/share/deltacloud-core/lib/deltacloud/./helpers/../drivers/ec2/ec2_driver.rb:362:in `load_balancers'
        /usr/share/deltacloud-core/lib/deltacloud/./helpers/../drivers/ec2/ec2_driver.rb:354:in `load_balancer'
        /usr/share/deltacloud-core/lib/deltacloud/./helpers/../drivers/ec2/ec2_driver.rb:385:in `destroy_load_balancer'
        /usr/share/deltacloud-core/lib/deltacloud/./collections/load_balancers.rb:72
        10.11.10.160 - - [12/Jun/2012 06:11:52] "DELETE /api/load_balancers/ramesh-test-lb-dc?format=xml HTTP/1.1" 404 18 0.2584

        Show
        Ramesh A added a comment - - edited Verified and working fine. I am sorry about my typo mistake error in my previous comment regarding the curl command. The correct command is supposed to be "curl -X DELETE" and not "curl -X Delete". Thanks Michal for pointing out this to me. Here is the test result w.r.t the above comments 1. Deleting from Web-ui: ================== This was an error which has been fixed in https://issues.apache.org/jira/browse/DTACLOUD-231 2. Deleting from cURL: ================ a) Deleting an existing loadbalancer results in 204 response code log output ======= I, 2012-06-12T06:21:24.288446 #3306 INFO – : New Aws::Elb using per_thread-connection mode I, 2012-06-12T06:21:24.289473 #3306 INFO – : New Aws::Elb using per_thread-connection mode I, 2012-06-12T06:21:24.291163 #3306 INFO – : Describing Load Balancers I, 2012-06-12T06:21:24.340342 #3306 INFO – : New Aws::Ec2 using per_thread-connection mode I, 2012-06-12T06:21:24.410757 #3306 INFO – : Deleting Load Balancer - ramesh-test-aws-lb 10.11.10.162 - - [12/Jun/2012 06:21:24] "DELETE /api/load_balancers/ramesh-test-aws-lb?format=xml HTTP/1.1" 204 - 0.1917 b) Deleting an non existing loadbalancer results in 404 response code log output: ======= I, 2012-06-12T06:11:51.844047 #3268 INFO – : New Aws::Elb using per_thread-connection mode I, 2012-06-12T06:11:51.846874 #3268 INFO – : New Aws::Elb using per_thread-connection mode I, 2012-06-12T06:11:51.847014 #3268 INFO – : Describing Load Balancers I, 2012-06-12T06:11:51.848183 #3268 INFO – : Opening new HTTPS connection to elasticloadbalancing.us-east-1.amazonaws.com:443 W, 2012-06-12T06:11:52.086191 #3268 WARN – : ##### Aws::Elb returned an error: 400 Bad Request <ErrorResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2009-05-15/"> <Error> <Type>Sender</Type> <Code>LoadBalancerNotFound</Code> </Error> <RequestId>07ac5d56-b477-11e1-afb7-8f588567225c</RequestId> </ErrorResponse> ##### W, 2012-06-12T06:11:52.086360 #3268 WARN – : ##### Aws::Elb request: elasticloadbalancing.us-east-1.amazonaws.com:443/?AWSAccessKeyId=AKIAIPXNUEQVP32G4T2A&Action=DescribeLoadBalancers&LoadBalancerNames.member.1=ramesh-test-lb-dc&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-06-12T10%3A11%3A51.000Z&Version=2009-05-15&Signature=GZxGTrmadmQx0Gk9K0mSxDH9FJcPmeTJopOU%2BVYSLXc%3D #### Aws::AwsError:400: Bad Request (elasticloadbalancing.us-east-1.amazonaws.com:443/?AWSAccessKeyId=AKIAIPXNUEQVP32G4T2A&Action=DescribeLoadBalancers&LoadBalancerNames.member.1=ramesh-test-lb-dc&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-06-12T10%3A11%3A51.000Z&Version=2009-05-15&Signature=GZxGTrmadmQx0Gk9K0mSxDH9FJcPmeTJopOU%2BVYSLXc%3D) REQUEST=elasticloadbalancing.us-east-1.amazonaws.com:443/?AWSAccessKeyId=AKIAIPXNUEQVP32G4T2A&Action=DescribeLoadBalancers&LoadBalancerNames.member.1=ramesh-test-lb-dc&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2012-06-12T10%3A11%3A51.000Z&Version=2009-05-15&Signature=GZxGTrmadmQx0Gk9K0mSxDH9FJcPmeTJopOU%2BVYSLXc%3D REQUEST ID= undefined /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/awsbase.rb:572:in `request_info_impl' /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/ses/../awsbase/awsbase.rb:316:in `request_info2' /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/elb/elb_interface.rb:59:in `request_info' /usr/lib/ruby/gems/1.8/gems/aws-2.5.5/lib/elb/elb_interface.rb:161:in `describe_load_balancers' /usr/share/deltacloud-core/lib/deltacloud/./helpers/../drivers/ec2/ec2_driver.rb:363:in `load_balancers' /usr/share/deltacloud-core/lib/deltacloud/./drivers/exceptions.rb:173:in `call' /usr/share/deltacloud-core/lib/deltacloud/./drivers/exceptions.rb:173:in `safely' /usr/share/deltacloud-core/lib/deltacloud/./helpers/../drivers/ec2/ec2_driver.rb:362:in `load_balancers' /usr/share/deltacloud-core/lib/deltacloud/./helpers/../drivers/ec2/ec2_driver.rb:354:in `load_balancer' /usr/share/deltacloud-core/lib/deltacloud/./helpers/../drivers/ec2/ec2_driver.rb:385:in `destroy_load_balancer' /usr/share/deltacloud-core/lib/deltacloud/./collections/load_balancers.rb:72 10.11.10.160 - - [12/Jun/2012 06:11:52] "DELETE /api/load_balancers/ramesh-test-lb-dc?format=xml HTTP/1.1" 404 18 0.2584

          People

          • Assignee:
            Ramesh A
            Reporter:
            Ramesh A
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development