Skip to content

upload WAL files failure S3ResponseError: 400 Bad Request - The authorization header is malformed; the region 'loca' is wrong; expecting 'us-east-1' #1609

Open
@zagr0

Description

@zagr0
  • Which image of the operator are you using?
    registry.opensource.zalan.do/acid/postgres-operator:v1.7.0
  • **Where do you run it - cloud or metal?
    AWS K8s
  • Are you running Postgres Operator in production?
    yes
  • Type of issue?
    Bug report

After 1.6.0 -> 1.7.0 migration we have found 3 of our clusters with the same issue in logs. WAL files were not able to be uploaded to S3 with the boto error. That caused to produce huge amount of logs, that is how we detected it actually.
Its not clear what is the issue but after pod delete/recreation there is no error happens.

logs:

        DETAIL: Uploading "pg_wal/00000003000000000000007D" to "s3://postgres-operator-backups/spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/wal_005/00000003000000000000007D.lzo".
        STRUCTURED: time=2021-09-03T11:25:52.368449-00 pid=362481 action=push-wal key=s3://postgres-operator-backups/spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/wal_005/00000003000000000000007D.lzo prefix=spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/ seg=00000003000000000000007D state=begin
wal_e.worker.upload INFO     MSG: begin archiving a file
        DETAIL: Uploading "pg_wal/00000003000000000000007E" to "s3://postgres-operator-backups/spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/wal_005/00000003000000000000007E.lzo".
        STRUCTURED: time=2021-09-03T11:25:52.371034-00 pid=362481 action=push-wal key=s3://postgres-operator-backups/spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/wal_005/00000003000000000000007E.lzo prefix=spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/ seg=00000003000000000000007E state=begin
wal_e.worker.upload INFO     MSG: begin archiving a file
        DETAIL: Uploading "pg_wal/00000003000000000000007F" to "s3://postgres-operator-backups/spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/wal_005/00000003000000000000007F.lzo".
        STRUCTURED: time=2021-09-03T11:25:52.373588-00 pid=362481 action=push-wal key=s3://postgres-operator-backups/spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/wal_005/00000003000000000000007F.lzo prefix=spilo/stage-short-url/7950e847-3c25-4015-a4dd-4146dc47b29e/wal/13/ seg=00000003000000000000007F state=begin
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gevent/greenlet.py", line 536, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/worker/upload.py", line 53, in __call__
    self.gpg_key_id)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/worker/worker_util.py", line 40, in do_lzop_put
    k = blobstore.uri_put_file(creds, url, tf)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/blobstore/s3/s3_util.py", line 57, in uri_put_file
    k.set_contents_from_file(fp, encrypt_key=True)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 1293, in set_contents_from_file
    chunked_transfer=chunked_transfer, size=size)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 750, in send_file
    chunked_transfer=chunked_transfer, size=size)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 951, in _send_file_internal
    query_args=query_args
  File "/usr/lib/python3/dist-packages/boto/s3/connection.py", line 668, in make_request
    retry_handler=retry_handler
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 1072, in make_request
    retry_handler=retry_handler)
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 941, in _mexe
    request.body, request.headers)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 884, in sender
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region 'loca' is wrong; expecting 'us-east-1'</Message><Region>us-east-1</Region><RequestId>ZVVNPYJ1HR48WFRH</RequestId><HostId>pODb4r+zRjQPzpx6bPzL0RNbAbCWrHOI3ikDAnd7NlmGzKO4mHHwqjKn1hjaiuRlLtSRJuBe0FA=</HostId></Error>
Fri Sep  3 11:25:52 2021 <Greenlet at 0x7f6320f8bcc0: <wal_e.worker.upload.WalUploader object at 0x7f6320ef94a8>(<wal_e.worker.pg.wal_transfer.WalSegment object at)> failed with S3ResponseError

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gevent/greenlet.py", line 536, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/worker/upload.py", line 53, in __call__
    self.gpg_key_id)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/worker/worker_util.py", line 40, in do_lzop_put
    k = blobstore.uri_put_file(creds, url, tf)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/blobstore/s3/s3_util.py", line 57, in uri_put_file
    k.set_contents_from_file(fp, encrypt_key=True)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 1293, in set_contents_from_file
    chunked_transfer=chunked_transfer, size=size)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 750, in send_file
    chunked_transfer=chunked_transfer, size=size)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 951, in _send_file_internal
    query_args=query_args
  File "/usr/lib/python3/dist-packages/boto/s3/connection.py", line 668, in make_request
    retry_handler=retry_handler
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 1072, in make_request
    retry_handler=retry_handler)
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 941, in _mexe
    request.body, request.headers)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 884, in sender
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the region 'loca' is wrong; expecting 'us-east-1'</Message><Region>us-east-1</Region><RequestId>ZVVRX3NHHT33B7J9</RequestId><HostId>Cd6anHiTnNWbKG7yMYBCauyRD8fXCTTAebipwiaeXb6/htN0RM5cMy7UQ/+TR5cfXO2tF7JjXLM=</HostId></Error>
Fri Sep  3 11:25:52 2021 <Greenlet at 0x7f6320f8bb90: <wal_e.worker.upload.WalUploader object at 0x7f6320ef94a8>(<wal_e.worker.pg.wal_transfer.WalSegment object at)> failed with S3ResponseError

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gevent/greenlet.py", line 536, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/worker/upload.py", line 53, in __call__
    self.gpg_key_id)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/worker/worker_util.py", line 40, in do_lzop_put
    k = blobstore.uri_put_file(creds, url, tf)
  File "/usr/local/lib/python3.6/dist-packages/wal_e/blobstore/s3/s3_util.py", line 57, in uri_put_file
    k.set_contents_from_file(fp, encrypt_key=True)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 1293, in set_contents_from_file
    chunked_transfer=chunked_transfer, size=size)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 750, in send_file
    chunked_transfer=chunked_transfer, size=size)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 951, in _send_file_internal
    query_args=query_args
  File "/usr/lib/python3/dist-packages/boto/s3/connection.py", line 668, in make_request
    retry_handler=retry_handler
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 1072, in make_request
    retry_handler=retry_handler)
  File "/usr/lib/python3/dist-packages/boto/connection.py", line 941, in _mexe
    request.body, request.headers)
  File "/usr/lib/python3/dist-packages/boto/s3/key.py", line 884, in sender
    response.status, response.reason, body)
boto.exception.S3ResponseError: S3ResponseError: 400 Bad Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions