go-goose/goose

swift container ACL set failing

Opened this issue · 5 comments

Running the swift live test produces from TestPublicList(). The contents can't be listed, the container has no ACL settings to allow this. Ran with both admin and user credentials for OpenStack (Mitaka).

I noticed this behavior on the command line for OpenStack previously also. If you set the ACLs for a container after creation, they are ignored. But if you sent the ACLs while creating the container it works.

heather@mitaka:/work/src/gopkg.in/goose.v1/swift$ env | grep OS_
OS_REGION_NAME=RegionOne
OS_PASSWORD=openstack
OS_AUTH_URL=http://10.172.45.216:5000/v2.0
OS_USERNAME=admin
OS_TENANT_NAME=admin
heather@mitaka:
/work/src/gopkg.in/goose.v1/swift$ go test -check.v -live ./... > results-live.out 2>&1


FAIL: live_test.go:195: LiveTestsPublicContainer.TestPublicList

live_test.go:206:
c.Check(err, gc.IsNil)
... value _errors.gooseError = &errors.gooseError{error:(_errors.errorString)(0xc8201a9610), errcode:"Unspecified", cause:(*errors.gooseError)(0xc8201e46c0)} ("failed to list contents of container: test_containerd06997de54da7083\ncaused by: Unauthorised URL http://10.172.45.99:80/swift/v1/test_containerd06997de54da7083?delimiter=&format=json&marker=&prefix=\ncaused by: request (http://10.172.45.99:80/swift/v1/test_containerd06997de54da7083?delimiter=&format=json&marker=&prefix=) returned unexpected status: 401; error info: {"Code":"AccessDenied","BucketName":"test_containerd06997de54da7083","RequestId":"tx0000000000000000000c9-0057f3a77b-1081-default","HostId":"1081-default-default"}")

live_test.go:207:
c.Check(len(items), gc.Equals, len(files))
... obtained int = 0
... expected int = 2

heather@mitaka:$ source novarc
heather@mitaka:
$ swift stat test_containerd06997de54da7083
Account: v1
Container: test_containerd06997de54da7083
Objects: 1
Bytes: 15
Read ACL:
Write ACL:
Sync To:
Sync Key:
Accept-Ranges: bytes
X-Storage-Policy: default-placement
X-Container-Bytes-Used-Actual: 4096
X-Timestamp: 0.00000
X-Trans-Id: tx0000000000000000000dd-0057f3b015-1081-default
Content-Type: text/plain; charset=utf-8
heather@mitaka:$ swift list test_containerd06997de54da7083
test_obj2
heather@mitaka:
$ source heatherrc
heather@mitaka:~$ swift list test_containerd06997de54da7083
Container GET failed: http://10.172.45.99:80/swift/v1/test_containerd06997de54da7083?format=json 401 Unauthorized [first 60 chars of response] {"Code":"AccessDenied","RequestId":"tx0000000000000000000e1-

This does not occur with the local test:

heather@mitaka:/work/src/gopkg.in/goose.v1/swift$ go test -check.v ./... > results-local.out 2>&1
heather@mitaka:
/work/src/gopkg.in/goose.v1/swift$ cat results-local.out
PASS: :5: localLiveSuite.TestHeadObject 0.002s
PASS: :3: localLiveSuite.TestList 0.004s
PASS: :1: localLiveSuite.TestObject 0.004s
PASS: :2: localLiveSuite.TestObjectReader 0.002s
PASS: :7: localLiveSuite.TestPublicList 0.004s
PASS: :6: localLiveSuite.TestPublicObjectReader 0.001s
PASS: :8: localLiveSuite.TestPublicURL 0.002s
PASS: :4: localLiveSuite.TestURL 0.002s
OK: 8 passed
PASS
ok gopkg.in/goose.v1/swift 0.080s

axw commented

I get a different error, but it also fails for me:

START: live_test.go:154: LiveTestsPublicContainer.SetUpSuite
PASS: live_test.go:154: LiveTestsPublicContainer.SetUpSuite     0.000s

START: live_test.go:195: LiveTestsPublicContainer.TestPublicList
START: live_test.go:164: LiveTestsPublicContainer.SetUpTest
live_test.go:171:
    assertCreateContainer(c, s.containerName, s.swift, swift.PublicRead)
live_test.go:71:
    c.Assert(err, gc.IsNil)
... value *errors.gooseError = &errors.gooseError{error:(*errors.errorString)(0xc4203ca110), errcode:"Unspecified", cause:(*errors.gooseError)(0xc42034c090)} ("failed to create container: test_containera185cc42ea974fda\ncaused by: Resource at https://swift.canonistack.canonical.com/v1/AUTH_2459d3e9ea8044658626c0d508f6b425/test_containera185cc42ea974fda not found\ncaused by: request (https://swift.canonistack.canonical.com/v1/AUTH_2459d3e9ea8044658626c0d508f6b425/test_containera185cc42ea974fda) returned unexpected status: 404; error info: 404 Not Found\n\nThe resource could not be found.\n\n   ")

FAIL: live_test.go:164: LiveTestsPublicContainer.SetUpTest

START: live_test.go:174: LiveTestsPublicContainer.TearDownTest
live_test.go:176:
    c.Check(err, gc.IsNil)
... value *errors.gooseError = &errors.gooseError{error:(*errors.errorString)(0xc4203851b0), errcode:"Unspecified", cause:(*errors.gooseError)(0xc4202f7830)} ("failed to delete container: test_containera185cc42ea974fda\ncaused by: Resource at https://swift.canonistack.canonical.com/v1/AUTH_2459d3e9ea8044658626c0d508f6b425/test_containera185cc42ea974fda not found\ncaused by: request (https://swift.canonistack.canonical.com/v1/AUTH_2459d3e9ea8044658626c0d508f6b425/test_containera185cc42ea974fda) returned unexpected status: 404; error info: 404 Not Found\n\nThe resource could not be found.\n\n   ")

FAIL: live_test.go:174: LiveTestsPublicContainer.TearDownTest

... Panic: Fixture has panicked (see related PANIC)
PANIC: live_test.go:195: LiveTestsPublicContainer.TestPublicList

START: live_test.go:162: LiveTestsPublicContainer.TearDownSuite
PASS: live_test.go:162: LiveTestsPublicContainer.TearDownSuite  0.000s

OOPS: 0 passed, 2 FAILED, 1 MISSED
--- FAIL: Test (6.93s)
axw commented

And a different error again when run against Rackspace:

... value *errors.gooseError = &errors.gooseError{error:(*errors.errorString)(0xc420397770), errcode:"Unspecified", cause:(*errors.gooseError)(0xc420305590)} ("failed to list contents of container: test_container6d85582b6e650244\ncaused by: Unauthorised URL https://storage101.syd2.clouddrive.com/v1/MossoCloudFS_945896/test_container6d85582b6e650244?delimiter=&format=json&marker=&prefix=\ncaused by: request (https://storage101.syd2.clouddrive.com/v1/MossoCloudFS_945896/test_container6d85582b6e650244?delimiter=&format=json&marker=&prefix=) returned unexpected status: 401; error info: <html><h1>Unauthorized</h1><p>This server could not verify that you are authorized to access the document you requested.</p></html>")

This one looks more similar to the one I got for this bug.

Is there a rackspace utility to do the equivalent of a “swift stat” on the container listed, look at the ACL info? In my case, the containers were left behind.

-Heather

On Oct 4, 2016, at 6:55 PM, Andrew Wilkins <notifications@github.commailto:notifications@github.com> wrote:

And a different error again when run against Rackspace:

... value _errors.gooseError = &errors.gooseError{error:(_errors.errorString)(0xc420397770), errcode:"Unspecified", cause:(*errors.gooseError)(0xc420305590)} ("failed to list contents of container: test_container6d85582b6e650244\ncaused by: Unauthorised URL https://storage101.syd2.clouddrive.com/v1/MossoCloudFS_945896/test_container6d85582b6e650244?delimiter=&format=json&marker=&prefix=\ncaused by: request (https://storage101.syd2.clouddrive.com/v1/MossoCloudFS_945896/test_container6d85582b6e650244?delimiter=&format=json&marker=&prefix=) returned unexpected status: 401; error info:

Unauthorized

This server could not verify that you are authorized to access the document you requested.

")


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHubhttps://github.com//issues/24#issuecomment-251537254, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ARbClJPoF9V8_pGabmzrLw8dr5BOIOtWks5qwtlrgaJpZM4KN-nm.

axw commented

rackspace is an openstack, so the swift CLI works. In my case, I get:

$ swift stat
                        Account: MossoCloudFS_945896
                     Containers: 0
                        Objects: 0
                          Bytes: 0
Containers in policy "policy-0": 0
   Objects in policy "policy-0": 0
     Bytes in policy "policy-0": 0
              Meta Temp-Url-Key: <redacted>
                    X-Timestamp: 1462379841.47633
                     X-Trans-Id: tx27c3c2788b6546caa31f9-0057f43b47syd2
                   Content-Type: text/plain; charset=utf-8
                  Accept-Ranges: bytes