title: AWS Bucket Undeletable
body: <p>The AWS S3 web console lists buckets that were deleted. Selecting the bucket and trying to empty or delete it causes the "Empty bucket" or "Delete bucket" modal Confirm button to fail silently.</p>
  
  <p>If you click into the bucket and try to upload a file, you get an error message, "Error Data not found". If you try to create a folder, you get, "Error Failed to create folder with name ''." If you try to change and Property, Permissions, or Management, you also get error messages.</p>
  
  <p>If you try to create a bucket with the same name (presumably to overwrite the old bucket), you get an error message indicating that the bucket name is taken.</p>
  
  <p>Libraries such as s3-upload are similarly unable to delete or overwrite the bucket.</p>
  
  <p>AWS (Node) SDK:</p>
  
  <pre><code>var aws = require('aws-sdk');
  
  var s3 = new aws.S3();
  
  s3.listBuckets({}, (error, data) =&gt; {
    console.log(error);
    console.log(data);
  });
  </code></pre>
  
  <p>returns the bucket, even though it should not exist.</p>
  
  <pre><code>{ 
    Buckets: [ 
     { Name: 'bucket.that.shouldnt.exist', CreationDate: 2017-02-20T01:51:19.000Z },
    ],
    Owner: { 
     DisplayName: '...',
     ID: '...' 
    }     
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>s3.deleteBucket({
    Bucket: 'bucket.that.shouldnt.exist'
  }, (error, data) =&gt; {
    console.log(error);
    console.log(data);
  });
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>{ 
    NoSuchBucket: The specified bucket does not exist
    at Request.extractError (.../aws-sdk/lib/services/s3.js:585:35)
    at Request.callListeners (.../aws-sdk/lib/sequential_executor.js:106:20)
    at Request.emit (.../aws-sdk/lib/sequential_executor.js:78:10)
    at Request.emit (.../aws-sdk/lib/request.js:683:14)
    at Request.transition (.../aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (.../aws-sdk/lib/state_machine.js:14:12)
    at .../aws-sdk/lib/state_machine.js:26:10
    at Request.&lt;anonymous&gt; (.../aws-sdk/lib/request.js:38:9)
    at Request.&lt;anonymous&gt; (.../aws-sdk/lib/request.js:685:12)
    at Request.callListeners (.../aws-sdk/lib/sequential_executor.js:116:18)
    message: 'The specified bucket does not exist',
    code: 'NoSuchBucket',
    region: null,
    time: 2019-06-04T16:56:35.537Z,
    requestId: '...',
    extendedRequestId: '...',
    cfId: undefined,
    statusCode: 404,
    retryable: false,
    retryDelay: 33.90621042754991 
  }
  </code></pre>