Issues

ZF-7199: Objects are never removed from S3

Issue Type: Sub-task Created: 2009-07-06T01:56:41.000+0000 Last Updated: 2009-07-15T17:11:50.000+0000 Status: Resolved Fix version(s): Reporter: Peter Ritter (pinopinelli) Assignee: Stanislav Malyshev (stas) Tags: - Zend_Service_Amazon

Related issues: Attachments:

Description

I am not sure if this is really a sub-task. But when I try to DELETE objects from one of my buckets (that are all located in the EU), then I get a positive response-message from S3. But the objects are still there. I guess the problem is that the function first tries to DELETE the object from my bucket (assuming that it is located in the US). But Amazon's API even returns a positive response when you try to delete an object that does not even exist (in this location). And that is why the DELETE does never reach the correct location (in EU). I did not test other operations, yet. But wouldn't it be better to give the location to Zend_Service_Amazon_S3 as a parameter?

Comments

Posted by Matthew Weier O'Phinney (matthew) on 2009-07-06T05:31:45.000+0000

Assigning to Stas.

Posted by Stanislav Malyshev (stas) on 2009-07-06T10:00:33.000+0000

You can specify the location when creating the bucket. But Amazon API doesn't have any means to specify location on deletion. Could you provide the exact sequence of actions (since the bucket creation) that you performed to lead to this problem?

Posted by Peter Ritter (pinopinelli) on 2009-07-07T00:34:16.000+0000

Well, first I created the bucket using the Firefox extension S3Fox. Then I have an upload-method in my code, that looks like this:

<pre class="highlight">

 if(is_file($media_file) && is_readable($media_file)){
$s3 = new Zend_Service_Amazon_S3(AWS_KEY, AWS_SEC_KEY);
            $sucess = $s3->putFile($media_file, 'ictv/'.$this->getClientid().'/media/'.$this->getMediatype().'/'.$this->getPath(), 
                            array(Zend_Service_Amazon_S3::S3_ACL_HEADER =>
                                  Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ));
            $logger->info(Zend_Debug::dump($sucess, 'ret', false));
            //jetzt das urspr√ľngliche medium im temp-ordner l√∂schen:
            @unlink($media_file);
            
        } 

Posted by Peter Ritter (pinopinelli) on 2009-07-07T00:45:15.000+0000

(Sorry for the double-post...)

Well, first I created the bucket using the Firefox extension S3Fox. Then I have an upload-method in my code, that looks like this:

<pre class="highlight">
$media_file = 'path/to/my/file';
if(is_file($media_file) && is_readable($media_file)){
$s3 = new Zend_Service_Amazon_S3(AWS_KEY, AWS_SEC_KEY);
      $sucess = $s3->putFile($media_file, $bucket_name.'/media/'.$media_file_name, 
    array(Zend_Service_Amazon_S3::S3_ACL_HEADER => Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ));
    @unlink($media_file);           
}

After that my file is at the right place in my bucket and it is public readable and I can use it. But when I want to delete it, I do the following in my deleting-method:

<pre class="highlight">
$s3_media_file = $bucket_name.'/media/'.$media_file_name;
$s3 = new Zend_Service_Amazon_S3(AWS_KEY, AWS_SEC_KEY);
$response = $s3->removeObject($s3_media_file);

Then I get the right response from S3 but my object is still there...

Posted by Stanislav Malyshev (stas) on 2009-07-07T00:59:29.000+0000

Does it happen with any objects at all or just specific ones (i.e. if you just create $bucket_name."/test" is it deleted)? Does it happen for you only with EU-based buckets?

Posted by Peter Ritter (pinopinelli) on 2009-07-08T02:26:20.000+0000

I am now a little bit confused.... My buckets were not available for about one hour or more yesterday and now it all works fine. Can it be, that this could have been an amazon-error or something? Does anybody else have a similar problem?

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts