PUTing a 0-byte object and supplying an Etag results in a 503 response

Bug #1516579 reported by Andreas Andersen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
High
Samuel Merritt

Bug Description

The expected behavior would be that the server returns 422 as it does when supplying an invalid Etag.

It can be reproduced the following way:

Create a 0-byte file to upload:
$ touch empty
Upload it with some random md5 sum supplied:
$ swift -A http://localhost:8888/auth/v1.0 -U images:imagesrw -K imagesrw upload images empty --header "Etag: 6b7a7293dd92d246a2570388b1462319"
Object PUT failed: http://localhost:8888/v1/AUTH_images/images/empty 503 Service Unavailable [first 60 chars of response] <html><h1>Service Unavailable</h1><p>The server is currently

Lots of errors show up in the proxy-server log:
2015-11-16T11:11:35 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/35 GET /auth/v1.0 HTTP/1.0 200 - python-swiftclient-2.6.0 - - - - tx0e0a825ac6c346a29a2d3-005649b9e7 - 0.0006 - - 1447672295.847012997 1447672295.847630978 -
2015-11-16T11:11:35 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/35 PUT /v1/AUTH_images/images HTTP/1.0 202 - python-swiftclient-2.6.0 AUTH_tk36a5f2643... - 76 - tx959c397a2c734286b2315-005649b9e7 - 0.0137 - - 1447672295.854751110 1447672295.868436098 0
2015-11-16T11:11:35 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/35 GET /auth/v1.0 HTTP/1.0 200 - python-swiftclient-2.6.0 - - - - tx6d339f5a1b15424e91c1c-005649b9e7 - 0.0004 - - 1447672295.889205933 1447672295.889605045 -
2015-11-16T11:11:35 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/35 HEAD /v1/AUTH_images/images/empty HTTP/1.0 404 - python-swiftclient-2.6.0 AUTH_tk36a5f2643... - - - txe3dae922b49f46a88438e-005649b9e7 - 0.0056 - - 1447672295.892796993 1447672295.898364067 0
2015-11-16T11:11:35 dev proxy-server: Object PUT returning 503, 0/1 required connections (txn: txdfc1aacc666d49b6b86b8-005649b9e7) (client_ip: 127.0.0.1)
2015-11-16T11:11:35 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/35 PUT /v1/AUTH_images/images/empty HTTP/1.0 503 - python-swiftclient-2.6.0 AUTH_tk36a5f2643... - 118 6b7a7293dd92d246a2570388b1462319 txdfc1aacc666d49b6b86b8-005649b9e7 - 0.0043 - - 1447672295.905363083 1447672295.909631968 0
2015-11-16T11:11:36 dev proxy-server: Object PUT returning 503, 0/1 required connections (txn: tx749197fc56a744da94956-005649b9e8) (client_ip: 127.0.0.1)
2015-11-16T11:11:36 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/36 PUT /v1/AUTH_images/images/empty HTTP/1.0 503 - python-swiftclient-2.6.0 AUTH_tk36a5f2643... - 118 6b7a7293dd92d246a2570388b1462319 tx749197fc56a744da94956-005649b9e8 - 0.0095 - - 1447672296.912669897 1447672296.922164917 0
2015-11-16T11:11:38 dev proxy-server: Object PUT returning 503, 0/1 required connections (txn: tx2381c76b54e849ce94a8c-005649b9ea) (client_ip: 127.0.0.1)
2015-11-16T11:11:38 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/38 PUT /v1/AUTH_images/images/empty HTTP/1.0 503 - python-swiftclient-2.6.0 AUTH_tk36a5f2643... - 118 6b7a7293dd92d246a2570388b1462319 tx2381c76b54e849ce94a8c-005649b9ea - 0.0079 - - 1447672298.926242113 1447672298.934129953 0
2015-11-16T11:11:42 dev proxy-server: Object PUT returning 503, 0/1 required connections (txn: tx20a12f2b3d1f4e02b9256-005649b9ee) (client_ip: 127.0.0.1)
2015-11-16T11:11:42 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/42 PUT /v1/AUTH_images/images/empty HTTP/1.0 503 - python-swiftclient-2.6.0 AUTH_tk36a5f2643... - 118 6b7a7293dd92d246a2570388b1462319 tx20a12f2b3d1f4e02b9256-005649b9ee - 0.0054 - - 1447672302.940390110 1447672302.945750952 0
2015-11-16T11:11:50 dev proxy-server: Object PUT returning 503, 0/1 required connections (txn: txf58401614cc444d8a0e0c-005649b9f6) (client_ip: 127.0.0.1)
2015-11-16T11:11:50 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/11/50 PUT /v1/AUTH_images/images/empty HTTP/1.0 503 - python-swiftclient-2.6.0 AUTH_tk36a5f2643... - 118 6b7a7293dd92d246a2570388b1462319 txf58401614cc444d8a0e0c-005649b9f6 - 0.0055 - - 1447672310.956351042 1447672310.961829901 0
2015-11-16T11:12:06 dev proxy-server: Object PUT returning 503, 0/1 required connections (txn: tx75e10ae3659b493990248-005649ba06) (client_ip: 127.0.0.1)
2015-11-16T11:12:06 dev proxy-server: 127.0.0.1 127.0.0.1 16/Nov/2015/11/12/06 PUT /v1/AUTH_images/images/empty HTTP/1.0 503 - python-swiftclient-2.6.0 AUTH_tk36a5f2643... - 118 6b7a7293dd92d246a2570388b1462319 tx75e10ae3659b493990248-005649ba06 - 0.0081 - - 1447672326.981029034 1447672326.989166021 0

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

Fails for me on master (currently c03d53a) with a replication storage policy; passes with an EC one.

Changed in swift:
importance: Undecided → High
status: New → Confirmed
Changed in swift:
assignee: nobody → Samuel Merritt (torgomatic)
Changed in swift:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/246010
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=4dc4cbfc1ca50abc100d2302e928f9fc16f26195
Submitter: Jenkins
Branch: master

commit 4dc4cbfc1ca50abc100d2302e928f9fc16f26195
Author: Samuel Merritt <email address hidden>
Date: Mon Nov 16 14:27:51 2015 -0800

    Fix 503 on zero-byte replicated PUT with incorrect Etag

    Closes-Bug: 1516579
    Change-Id: Iac91ed61254d3ca232521191fec25c19acb66413

Changed in swift:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/crypto)

Fix proposed to branch: feature/crypto
Review: https://review.openstack.org/249975

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (feature/crypto)
Download full text (11.9 KiB)

Reviewed: https://review.openstack.org/249975
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=458d5ebb9ac8f2ea4662de86f3a2c5551b4961f6
Submitter: Jenkins
Branch: feature/crypto

commit 41897d96a7dc3ddceccf4eed71345439b83eb243
Author: Tim Burke <email address hidden>
Date: Mon Nov 23 13:53:27 2015 -0800

    Reverse-listings follow-up

     * With the end_prefix changes in the original commit, we no longer need
       the `or not name.startswith(prefix)` check.
     * Improve test coverage of reverse path listings.

    Change-Id: Iaa7d4b83647c3c150be95f88cb3cc9e4f0e33979

commit 7c1e6cd583debe43aca266643cd65f5103159dbf
Author: Matthew Oliver <email address hidden>
Date: Thu Sep 11 16:51:51 2014 +1000

    Add container and account reverse listings

    This change adds the ability to tell the container or account server to
    reverse their listings. This is done by sending a reverse=TRUE_VALUE,

    Where TRUE_VALUE is one of the values true can be in common/utils:

      TRUE_VALUES = set(('true', '1', 'yes', 'on', 't', 'y'))

    For example:

      curl -i -X GET -H "X-Auth-Token: $TOKEN" $STORAGE_URL/c/?reverse=on

    I borrowed the swapping of the markers code from Kevin's old change,
    thanks Kevin. And Tim Burke added some real nuggets of awesomeness.

    DocImpact
    Co-Authored-By: Kevin McDonald <email address hidden>
    Co-Authored-By: Tim Burke <email address hidden>
    Implements: blueprint reverse-object-listing

    Change-Id: I5eb655360ac95042877da26d18707aebc11c02f6

commit 898223398189f96628db7d9928f146c5bb11ba88
Author: Ganesh Maharaj Mahalingam <email address hidden>
Date: Fri Oct 30 21:30:51 2015 +0000

    Unit tests for account/backend.py

    Add test for database create request without account
    Partial test for migrate call on database with storage_policy_index

    Change-Id: I7cfbd6bc7e2b341f433d88f600b19e54826a0e22
    Signed-off-by: Ganesh Maharaj Mahalingam <email address hidden>

commit f80c97a6e964123e766c1e53d797a3b80433ac77
Author: Alistair Coles <email address hidden>
Date: Fri Nov 20 17:51:33 2015 +0000

    Update .mailmap entry

    Fix/add entries for authors that are known to now have
    @hpe.com email addresses.

    Change-Id: I62c83b64e2378cb3d6ad33ac9e6ab111b8a8c86f

commit 848d7299a26988ea1bab3e576ba10762624dfff6
Author: Tim Burke <email address hidden>
Date: Fri Nov 20 09:04:28 2015 -0800

    Ignore Content-Type from client on multipart-manifest=delete

    Otherwise, if a client includes something like:

        Content-Type: application/x-www-form-urlencoded

    ...we won't delete anything, and instead send back:

        Number Deleted: 0
        Number Not Found: 0
        Response Body:
        Response Status: 406 Not Acceptable
        Errors:

    ...despite the fact that we're managing the iterator, so we know it's
    acceptable.

    Change-Id: I791c7bda1d9df830d8dacd3783c2393db5a9ac09

commit c4eeea7820b7bbf6f5994c9878c8838c43e61b9b
Author: Sivasathurappan Radhakrishnan <email address hidden>
Date: Thu Oct 29 23:04:42 2015 +0000

    A...

tags: added: in-feature-crypto
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/hummingbird)

Fix proposed to branch: feature/hummingbird
Review: https://review.openstack.org/264517

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (feature/hummingbird)
Download full text (54.1 KiB)

Reviewed: https://review.openstack.org/264517
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=93ddaffaebb620bc712d52d0267194562dce02be
Submitter: Jenkins
Branch: feature/hummingbird

commit f53cf1043d078451c4b9957027bf3af378aa0166
Author: Ondřej Nový <email address hidden>
Date: Tue Jan 5 20:20:15 2016 +0100

    Fixed few misspellings in comments

    Change-Id: I8479c85cb8821c48b5da197cac37c80e5c1c7f05

commit 79222e327f9df6335b58e17a6c8dd0dc44b86c17
Author: ChangBo Guo(gcb) <email address hidden>
Date: Sat Dec 26 13:13:37 2015 +0800

    Fix AttributeError for LogAdapter

    LogAdapter object has no attribute 'warn' but has attribute
    'warning'.

    Closes-Bug: #1529321
    Change-Id: I0e0bd0a3dbc4bb5c1f0b343a8809e53491a1da5f

commit 684c4c04592278a280032002b5313b171ee7a4c0
Author: janonymous <email address hidden>
Date: Sun Aug 2 22:47:42 2015 +0530

    Python 3 deprecated the logger.warn method in favor of warning

    DeprecationWarning: The 'warn' method is deprecated, use 'warning'
    instead

    Change-Id: I35df44374c4521b1f06be7a96c0b873e8c3674d8

commit d0a026fcb8e8a9f5475699cc56e1998bdc4cd5ca
Author: Hisashi Osanai <email address hidden>
Date: Wed Dec 16 18:50:37 2015 +0900

    Fix duplication for headers in Access-Control-Expose-Headers

    There are following problems with Access-Control-Expose-Headers.

    * If headers in X-Container-Meta-Access-Control-Expose-Headers are
      configured, the headers are kept with case-sensitive string.
      Then a CORS request comes, the headers are merged into
      Access-Control-Expose-Headers as case-sensitive string even if
      there is a same header which is not case-sensitive string.

    * Access-Control-Expose-Headers is handled by a list.
      If X-Container/Object-Meta-XXX is configured in container/object
      and X-Container-Meta-Access-Control-Expose-Headers, same header
      is listed in Access-Control-Expose-Headers.

    This patch provides a fix for the problems.

    Change-Id: Ifc1c14eb3833ec6a851631cfc23008648463bd81

commit 0bcd7fd50ec0763dcb366dbf43a9696ca3806f15
Author: Bill Huber <email address hidden>
Date: Fri Nov 20 12:09:26 2015 -0600

    Update Erasure Coding Overview doc to remove Beta version

    The major functionality of EC has been released for Liberty and
    the beta version of the code has been removed since it is now
    in production.

    Change-Id: If60712045fb1af803093d6753fcd60434e637772

commit 84ba24a75640be4212e0f984c284faf4c894e7c6
Author: Alistair Coles <email address hidden>
Date: Fri Dec 18 11:24:34 2015 +0000

    Fix rst errors so that html docs are complete

    rst table format errors don't break the gate job
    but do cause sections of the documents to go missing
    from the html output.

    Change-Id: Ic8c9953c93d03dcdafd8f47b271d276c7b356dc3

commit 87f7e907ee412f5847f1f9ffca7a566fb148c6b1
Author: Matthew Oliver <email address hidden>
Date: Wed Dec 16 17:19:24 2015 +1100

    Pass HTTP_REFERER down to subrequests

    Currently a HTTP_REFERER (Referer) header isn't passed down to
    subreq...

tags: added: in-feature-hummingbird
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/swift 2.6.0

This issue was fixed in the openstack/swift 2.6.0 release.

Tim Burke (1-tim-z)
Changed in swift:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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