I am debugging an interaction between Swift and Envoy, specifically when fetching account statistics from swift an HEAD request is issued and Swift answer with 204 + headers (below). The request is fine from Swift's perspective but the client talking to Envoy gets a 503.
thanos-fe1001:~# curl -k -i https://thanos-swift.discovery.wmnet/v1/AUTH_tegola --resolve thanos-swift.discovery.wmnet:443:127.0.0.1 -I -H "X-Auth-Token: AUTH_XXX" HTTP/1.1 503 Service Unavailable content-length: 95 content-type: text/plain date: Fri, 13 Aug 2021 12:11:16 GMT server: envoy
This is the response from swift:
HTTP/1.1 204 No Content Content-Type: text/plain; charset=utf-8 X-Account-Object-Count: 8787256 X-Account-Storage-Policy-Standard-Container-Count: 2 X-Timestamp: 1626432137.40592 X-Account-Storage-Policy-Standard-Object-Count: 8787256 X-Account-Bytes-Used: 26354037115 X-Account-Container-Count: 2 X-Account-Storage-Policy-Standard-Bytes-Used: 26354037115 Accept-Ranges: bytes Vary: Accept X-Trans-Id: txaf6619fbb7314c188b660-006116623d X-Openstack-Request-Id: txaf6619fbb7314c188b660-006116623d Date: Fri, 13 Aug 2021 12:14:53 GMT Transfer-Encoding: chunked
Apparently what confuses Envoy is TE or content-length on 204. The bandaid is to set envoy.reloadable_features.strict_1xx_and_204_response_headers=false which indeed does what it says:
thanos-fe1001:~# curl -X POST 'localhost:9631/runtime_modify?envoy.reloadable_features.strict_1xx_and_204_response_headers=false' OK
Wait some time for the config to be live (?)
thanos-fe1001:~# curl -k -i https://thanos-swift.discovery.wmnet/v1/AUTH_tegola --resolve thanos-swift.discovery.wmnet:443:127.0.0.1 -I -H "X-Auth-Token: AUTH_XXX" HTTP/1.1 204 No Content content-type: text/plain; charset=utf-8 x-account-object-count: 8787256 x-account-storage-policy-standard-container-count: 2 x-timestamp: 1626432137.40592 x-account-storage-policy-standard-object-count: 8787256 x-account-bytes-used: 26354037115 x-account-container-count: 2 x-account-storage-policy-standard-bytes-used: 26354037115 accept-ranges: bytes vary: Accept x-trans-id: txa82f71b6be5849e4b8515-0061166302 x-openstack-request-id: txa82f71b6be5849e4b8515-0061166302 date: Fri, 13 Aug 2021 12:18:10 GMT x-envoy-upstream-service-time: 16 server: envoy transfer-encoding: chunked
However I haven't been able to quite figure out what I'm supposed to put in the config to make this setting permanent.
I've opened a bug with Swift upstream for further enlightenment https://bugs.launchpad.net/swift/+bug/1939888