Repository navigation
Closed
Milestone
Description
When trying to delete a folder in an Amazon S3 bucket thru the web interface I get the following message: "Could not delete: folder name". Deleting the folder with the Mac desktop app works fine.
The logs show the following:
{"Message":"The specified key does not exist.","Code":0,"Trace":"
#0 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Aws\/Common\/Exception\/NamespaceExceptionFactory.php(76): Aws\\Common\\Exception\\NamespaceExceptionFactory->createException('Aws\\S3\\Exceptio...', Object(Guzzle\\Http\\Message\\Request), Object(Guzzle\\Http\\Message\\Response), Array)\n
#1 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Aws\/Common\/Exception\/ExceptionListener.php(55): Aws\\Common\\Exception\\NamespaceExceptionFactory->fromResponse(Object(Guzzle\\Http\\Message\\Request), Object(Guzzle\\Http\\Message\\Response))\n
#2 [internal function]: Aws\\Common\\Exception\\ExceptionListener->onRequestError(Object(Guzzle\\Common\\Event), 'request.error', Object(Symfony\\Component\\EventDispatcher\\EventDispatcher))\n
#3 \/var\/www\/owncloud\/3rdparty\/symfony\/event-dispatcher\/Symfony\/Component\/EventDispatcher\/EventDispatcher.php(164): call_user_func(Array, Object(Guzzle\\Common\\Event), 'request.error', Object(Symfony\\Component\\EventDispatcher\\EventDispatcher))\n
#4 \/var\/www\/owncloud\/3rdparty\/symfony\/event-dispatcher\/Symfony\/Component\/EventDispatcher\/EventDispatcher.php(53): Symfony\\Component\\EventDispatcher\\EventDispatcher->doDispatch(Array, 'request.error', Object(Guzzle\\Common\\Event))\n
#5 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Message\/Request.php(589): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch('request.error', Object(Guzzle\\Common\\Event))\n
#6 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Message\/Request.php(378): Guzzle\\Http\\Message\\Request->processResponse(Array)\n
#7 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Curl\/CurlMulti.php(286): Guzzle\\Http\\Message\\Request->setState('complete', Array)\n
#8 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Curl\/CurlMulti.php(244): Guzzle\\Http\\Curl\\CurlMulti->processResponse(Object(Guzzle\\Http\\Message\\Request), Object(Guzzle\\Http\\Curl\\CurlHandle), Array)\n
#9 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Curl\/CurlMulti.php(227): Guzzle\\Http\\Curl\\CurlMulti->processMessages()\n
#10 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Curl\/CurlMulti.php(211): Guzzle\\Http\\Curl\\CurlMulti->executeHandles()\n
#11 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Curl\/CurlMulti.php(105): Guzzle\\Http\\Curl\\CurlMulti->perform()\n
#12 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Curl\/CurlMultiProxy.php(91): Guzzle\\Http\\Curl\\CurlMulti->send()\n
#13 \/var\/www\/owncloud\/3rdparty\/guzzle\/http\/Guzzle\/Http\/Client.php(282): Guzzle\\Http\\Curl\\CurlMultiProxy->send()\n
#14 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Aws\/Common\/Client\/AbstractClient.php(262): Guzzle\\Http\\Client->send(Object(Guzzle\\Http\\Message\\Request))\n
#15 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Guzzle\/Service\/Client.php(136): Aws\\Common\\Client\\AbstractClient->send(Object(Guzzle\\Http\\Message\\Request))\n
#16 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Guzzle\/Service\/Command\/AbstractCommand.php(153): Guzzle\\Service\\Client->execute(Object(Aws\\S3\\Command\\S3Command))\n
#17 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Guzzle\/Service\/Command\/AbstractCommand.php(189): Guzzle\\Service\\Command\\AbstractCommand->execute()\n
#18 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Guzzle\/Service\/Client.php(76): Guzzle\\Service\\Command\\AbstractCommand->getResult()\n
#19 \/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Aws\/Common\/Client\/AbstractClient.php(107): Guzzle\\Service\\Client->__call('GetObject', Array)\n
#20 \/var\/www\/owncloud\/apps\/files_external\/lib\/amazons3.php(370): Aws\\Common\\Client\\AbstractClient->__call('getObject', Array)\n
#21 \/var\/www\/owncloud\/apps\/files_external\/lib\/amazons3.php(370): Aws\\S3\\S3Client->getObject(Array)\n
#22 \/var\/www\/owncloud\/lib\/private\/files\/storage\/wrapper\/wrapper.php(266): OC\\Files\\Storage\\AmazonS3->fopen('resmio Manageme...', 'r')\n
#23 \/var\/www\/owncloud\/lib\/private\/files\/view.php(834): OC\\Files\\Storage\\Wrapper\\Wrapper->fopen('resmio Manageme...', 'r')\n
#24 \/var\/www\/owncloud\/lib\/private\/files\/view.php(719): OC\\Files\\View->basicOperation('fopen', '\/files\/resmiocl...', Array, 'r')\n
#25 \/var\/www\/owncloud\/lib\/private\/files\/view.php(648): OC\\Files\\View->fopen('\/files\/resmiocl...', 'r')\n
#26 \/var\/www\/owncloud\/lib\/private\/files\/view.php(642): OC\\Files\\View->copy('\/files\/resmiocl...', '\/files_trashbin...', true)\n
#27 \/var\/www\/owncloud\/lib\/private\/files\/view.php(642): OC\\Files\\View->copy('\/files\/resmiocl...', '\/files_trashbin...', true)\n
#28 \/var\/www\/owncloud\/lib\/private\/files\/view.php(522): OC\\Files\\View->copy('\/files\/resmiocl...', '\/files_trashbin...', true)\n
#29 \/var\/www\/owncloud\/apps\/files_trashbin\/lib\/trashbin.php(172): OC\\Files\\View->rename('\/files\/resmiocl...', '\/files_trashbin...')\n
#30 \/var\/www\/owncloud\/apps\/files_trashbin\/lib\/storage.php(80): OCA\\Files_Trashbin\\Trashbin::move2trash('resmiocloud\/res...')\n
#31 \/var\/www\/owncloud\/lib\/private\/files\/view.php(836): OCA\\Files_Trashbin\\Storage->unlink('resmio Manageme...')\n
#32 \/var\/www\/owncloud\/lib\/private\/files\/view.php(442): OC\\Files\\View->basicOperation('unlink', '\/resmiocloud\/re...', Array)\n
#33 \/var\/www\/owncloud\/lib\/private\/files\/filesystem.php(653): OC\\Files\\View->unlink('\/resmiocloud\/re...')\n
#34 \/var\/www\/owncloud\/apps\/files\/ajax\/delete.php(31): OC\\Files\\Filesystem::unlink('\/resmiocloud\/re...')\n
#35 \/var\/www\/owncloud\/lib\/private\/route\/route.php(135) : runtime-created function(1): require_once('\/var\/www\/ownclo...')\n
#36 [internal function]: __lambda_func(Array)\n
#37 \/var\/www\/owncloud\/lib\/private\/route\/router.php(250): call_user_func('?lambda_1762', Array)\n
#38 \/var\/www\/owncloud\/lib\/base.php(767): OC\\Route\\Router->match('\/apps\/files\/aja...')\n
#39 \/var\/www\/owncloud\/index.php(36): OC::handleRequest()\n
#40 {main}","File":"\/var\/www\/owncloud\/apps\/files_external\/3rdparty\/aws-sdk-php\/Aws\/Common\/Exception\/NamespaceExceptionFactory.php
","Line":91}
Ubuntu 14.04 on Digital Ocean, Owncloud 8.0.2.
Edit: reformatted exception
Activity
PVince81 commentedon Apr 13, 2015
I tried the following with v8.0.2:
Folder was deleted properly. Works for me.
Can you tell us more about that folder ? Does it contain a lot of files ?
Is it a specific folder or any folder that cannot be deleted ? (even an empty one)
PVince81 commentedon Apr 13, 2015
Does its path contain any special characters ?
mmarder commentedon Apr 13, 2015
Thank you for taking a look at this.
Some more information:
As far as I understand the error from AWS "The specified key does not exist." means that the file does not exist in the S3 bucket.
Here are the logs which were created when I tried to delete the folder "companymaterial". There are some references to the folder name in the logs. Maybe they mean something to you.
PVince81 commentedon Apr 13, 2015
Can you confirm that the folder really exists by looking at the S3 web interface ? Does the folder appear there with the proper name ? If I remember well, the folder entry should have a trailing slash, so it should read "companymaterial/"
mmarder commentedon Apr 13, 2015
The folder looks fine in S3, but I don't have a trailing slash.
PVince81 commentedon Apr 13, 2015
Okay. Either that's the problem or maybe S3 is clever enough to interpret it as a folder (note: I'm not a S3 expert at all)
musicullum commentedon Jun 5, 2015
I have a (possibly related) problem with the s3 php stream wrapper:
if (file_exists ($key)) {
if (unlink ($key) === FALSE)
... never gets here
So it recognises the key and returns a successful deletion of the key (which has only a-z characters lowercase), but the "folder" is still present and accessible as seen in the S3 Management Console.
What am I missing?
PVince81 commentedon Jun 15, 2015
I managed to reproduce this once. The folder disappeared from the web UI.
Can you guys try the following patch #16938 ?
It seems that the S3 backend returned the folder itself in the list of folders. So basically if you had a folder "abc/" it would think there's a folder "abc/abc". So when deleting that folder, it would try to recurse into it but obviously that folder does not exist.
The PR above is likely to fix your issues.
MorrisJobke commentedon Jun 16, 2015
Fixed via #16938