Can't able to delete pseudo folder under container

Bug #1340040 reported by Anand TS
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Opinion
Undecided
Unassigned
OpenStack Object Storage (swift)
Invalid
Undecided
Unassigned

Bug Description

Hi all,

I can't able to delete pseudo folders created under Container. I installed openstack using packstack all-in-one in a CentOS machine.

I can create multiple containers and upload objects in to it without a problem, but when I create a pseudo folder, I click on that dashboard goes to "something went wrong". I fix that temporarily using the fix here https://bugs.launchpad.net/horizon/+bug/1312222

Now I can create subfolders and upload objects in to that file, but I can't able to delete any of these pseudo folders.
When I try to delete pseudo folder named (for eg test), I'm getting error Error: You are not allowed to delete object:test.

When using cli, I get this
[root@icestack ~(keystone_admin)]# swift list test
test1/
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift delete test test1
Object 'test/test1' not found

I think it is a known issue, any workaround for this problem.

Thanks & Regards,
Anand TS

Revision history for this message
Julie Pichon (jpichon) wrote :

I'm opening a task against Swift as well since the description seems mostly made up of Swift commands.

Are there objects in test1? If I remember correctly, pseudo-folders are "created" based on "/" in object names but don't actually exist. When you delete objects within test1/ does the pseudo-directory eventually gets removed from the list?

Changed in horizon:
status: New → Incomplete
Revision history for this message
Anand TS (ts-anand) wrote :

Hi jpichon,

I tested both scenarios, with objects and without objects in pseudo folder. In both case when I try to delete pseudo folder I get this, Error: You are not allowed to delete object: test1.

I created pseudo folder without "/" in object names. If I create a pseudo folder with "/" for eg, /openstack. I can't find that pseudo folder in horizon but through CLI I can see.

[root@icestack ~(keystone_admin)]# swift list
knowledge Base
test
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift list test
/open/
/openstack/
test1/
test1/test file
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift delete /openstack
WARNING: / in container name; you might have meant ' openstack' instead of '/openstack'.
Container GET failed: http://10.54.3.70:8080/v1/AUTH_649e8657215f4535b54d21a44d4afe62//openstack?format=json 412 Precondition Failed Bad URL
[root@icestack ~(keystone_admin)]# swift delete openstack
Container 'openstack' not found
[root@icestack ~(keystone_admin)]# swift stat test
       Account: AUTH_649e8657215f4535b54d21a44d4afe62
     Container: test
       Objects: 4
         Bytes: 38931
      Read ACL:
     Write ACL:
       Sync To:
      Sync Key:
 Accept-Ranges: bytes
   X-Timestamp: 1404455013.94303
    X-Trans-Id: tx42a70c062954428998fa3-0053be9f52
  Content-Type: text/plain; charset=utf-8
[root@icestack ~(keystone_admin)]#

Please find the attachment also.

Revision history for this message
Samuel Merritt (torgomatic) wrote :

When you create pseudo-directory objects in Swift, they are stored as plain old objects whose names happen to contain slashes. You're trying to delete the object "test1/" (with a slash) by running "swift delete test test1" (without a slash), and those are two different names, so Swift correctly returns a 404.

In the second comment, you've forgotten the container name in the "swift delete" command, so it's not working.

I think Swift is performing as intended here.

Changed in swift:
status: New → Invalid
Revision history for this message
Anand TS (ts-anand) wrote :

hi,

Through Horizon and command line I cannot delete pseudo folders.

If there are pseudo folders inside a container, I cannot delete container from horizon but through CLI it is possible by issuing swift delete container command. All the objects inside container also gets deleted. It is strange behaviour. Also If I create a Container with two words I cannot issue any swift commands to that container.

please see the example below.

[root@icestack ~(keystone_admin)]# swift list
knowledge Base
test
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift list Knowledge Base
Usage: swift list [--long] [--lh] [--totals] [--prefix <prefix>]
                  [--delimiter <delimiter>]

Lists the containers for the account or the objects for a container.

Positional arguments:
  [container] Name of container to list object in.

Optional arguments:
  --long Long listing format, similar to ls -l.
  --lh Report sizes in human readable format similar to
                        ls -lh.
  --totals Used with -l or --lh, only report totals.
  --prefix Only list items beginning with the prefix.
  --delimiter Roll up items with the given delimiter. For containers
                        only. See OpenStack Swift API documentation for what
                        this means.
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift list test
/test1/
anand/
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift delete test/test1/
WARNING: / in container name; you might have meant 'test test1/' instead of 'test/test1/'.
Container 'test/test1/' not found
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift delete test test1/
Object 'test/test1/' not found
[root@icestack ~(keystone_admin)]# swift delete test test1/anand/
Object 'test/test1/anand/' not found
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift delete test
anand/
test1/
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]# swift list
knowledge Base
[root@icestack ~(keystone_admin)]#
[root@icestack ~(keystone_admin)]#

Changed in horizon:
status: Incomplete → Opinion
Revision history for this message
clayg (clay-gerrard) wrote :

That all looks correct to me. I believe in a couple of cases you failed to correctly describe your intent to the command line client - and we don't yet have a blueprint to add a mind reading feature :\

e.g.

    swift list Knowledge Base

vs.

    swift list "Knowledge Base"

e.g.

    swift delete test test1/

vs.

    swift delete test /test1/

e.g.

    swift delete test test1/anand/

vs.

    swift delete test anand/

It's possible that the horizon client talking to swift may be making similar mistakes, but you haven't really described the problem you're seeing there. Perhaps you could post screenshots and/or swift logs coupled with the output from the command client and an interested on the horizon team may be able to educate/confirm.

For now the "invalid" status seems appropriate against swift.

You should consider making an effort to catch folks on IRC in #openstack-swift or #openstack-horizon for some more real time feedback from people working on these projects.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.