Repository: localstack/localstack

Issue:
bug: S3 sync command fails for buckets with `expired_object_delete_marker` set in lifecycle configuration
### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

The `aws s3 sync` command fails when syncing objects into a bucket with a lifecycle configuration that includes `expired_object_delete_marker = true`. Also happens with the latest tag (currently 2.2.1)

The objects are copied into the bucket successfully, but the `S3Provider.put_object` method errors out later on when trying to return the expiration header. This happens when adding new objects, or modifying existing.

I'm getting the following stack trace:

```
upload failed: some_stuff/a to s3://test-bucket/a An error occurred (InternalError) when calling the PutObject operation (reached max retries: 2): exception while calling s3.PutObject: Traceback (most recent call last):
  File "/opt/code/localstack/localstack/aws/chain.py", line 90, in handle
    handler(self, self.context, response)
  File "/opt/code/localstack/localstack/aws/handlers/service.py", line 123, in __call__
    handler(chain, context, response)
  File "/opt/code/localstack/localstack/aws/handlers/service.py", line 93, in __call__
    skeleton_response = self.skeleton.invoke(context)
  File "/opt/code/localstack/localstack/aws/skeleton.py", line 154, in invoke
    return self.dispatch_request(context, instance)
  File "/opt/code/localstack/localstack/aws/skeleton.py", line 166, in dispatch_request
    result = handler(context, instance) or {}
  File "/opt/code/localstack/localstack/aws/forwarder.py", line 60, in _call
    return handler(context, req)
  File "/opt/code/localstack/localstack/aws/skeleton.py", line 118, in __call__
    return self.fn(*args, **kwargs)
  File "/opt/code/localstack/localstack/aws/api/core.py", line 167, in operation_marker
    return fn(*args, **kwargs)
  File "/opt/code/localstack/localstack/services/s3/provider.py", line 589, in put_object
    if expiration_header := self._get_expiration_header(rules, key_object, object_tags):
  File "/opt/code/localstack/localstack/services/s3/provider.py", line 326, in _get_expiration_header
    expiration_header = serialize_expiration_header(
  File "/opt/code/localstack/localstack/services/s3/utils.py", line 394, in serialize_expiration_header
    ) + datetime.timedelta(days=exp_days + 1)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
```

This started happening after upgrading to `2.2.0` it was working as expected on `2.1.0`.  I've had a look into the code and the PR that introduced the expiration header was https://github.com/localstack/localstack/pull/8651

### Expected Behavior

The `sync` command should not error out when copying objects into a bucket with a lifecycle configuration including `expired_object_delete_marker = true`

### How are you starting LocalStack?

With a `docker run` command

### Steps To Reproduce

#### How are you starting localstack

```
docker run --rm --env DEBUG=1 --name test-localstack --publish 4566:4566 --publish 4510-4559:4510-4559 localstack/localstack:2.2.0
```

#### Client commands 

Deploy the following, minimal, Terraform environment (with terraform init, then terraform apply). The bucket and lifecycle configuration are created as expected.

```hcl
provider "aws" {
  access_key                  = "oi"
  secret_key                  = "oi"
  region                      = "eu-west-1"

  s3_use_path_style           = true
  skip_credentials_validation = true
  skip_metadata_api_check     = true
  skip_requesting_account_id  = true

  endpoints {
    s3 = "http://localhost:4566"
  }
}

resource "aws_s3_bucket" "test" {
  bucket = "test-bucket"
}

resource "aws_s3_bucket_lifecycle_configuration" "test_lifecycle" {
  bucket = aws_s3_bucket.test.id
  rule {
    id     = "default"
    status = "Enabled"

    expiration {
      expired_object_delete_marker = true
    }
  }
}
```

Try to sync some files into the bucket, eg. with a directory containing a single file `some_stuff/a`:

```sh
aws s3 --no-sign-request --endpoint-url=https://localhost.localstack.cloud:4566 sync ./some_stuff s3://test-bucket
```

The command will error out, but listing the bucket shows that the object was created. Modifying the object and re-syncing results in another error


### Environment

```markdown
- OS: macOS 11.7.8
- LocalStack: 2.2.0 (also happens on the current latest tag 2.2.1dev)
- Terraform: 1.4.0
- AWS CLI: aws-cli/2.13.0 Python/3.11.4 Darwin/20.6.0 source/x86_64 prompt/off
- Docker: Docker Desktop for mac 4.21.1 (114176)
```


### Anything else?

The error appears to be caused by a null value in the `last_modifed` field on the moto object that is returned after uploading a file. It looks like this modified value should always be a `datetime.datetime` instance however, unless the `replace` method is somehow returning a `None`.

---

Starting localstack in debug mode (using the command in the steps to reproduce) I get a couple of errors in the startup logs. Not sure if this could be related in some way but I didn't get any errors on startup with 2.1.0. Full startup log is:

```
LocalStack supervisor: starting
LocalStack supervisor: localstack process (PID 15) starting

LocalStack version: 2.2.0
LocalStack build date: 2023-07-20
LocalStack build git hash: 2d70f768

2023-07-26T11:58:44.068 DEBUG --- [  MainThread] stevedore._cache           : reading /root/.cache/python-entrypoints/95a6d80069fbb91e9c6f935e32045f150cf5fb00cb3c63836a9df27ca3b29f6e
2023-07-26T11:58:44.080 DEBUG --- [  MainThread] stevedore._cache           : writing to /root/.cache/python-entrypoints/95a6d80069fbb91e9c6f935e32045f150cf5fb00cb3c63836a9df27ca3b29f6e
2023-07-26T11:58:44.083 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_patch_botocore_json_parser', value='localstack.aws.client:_patch_botocore_json_parser', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.084 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_publish_config_as_analytics_event', value='localstack.runtime.analytics:_publish_config_as_analytics_event', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.084 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_publish_container_info', value='localstack.runtime.analytics:_publish_container_info', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.085 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_run_init_scripts_on_start', value='localstack.runtime.init:_run_init_scripts_on_start', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.087 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='deprecation_warnings', value='localstack.plugins:deprecation_warnings', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.088 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_partition_adjusting_proxy_listener', value='localstack.plugins:register_partition_adjusting_proxy_listener', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.088 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='validate_configuration', value='localstack.services.awslambda.plugins:validate_configuration', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.091 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_pickle_patches_runtime', value='localstack_persistence.pickling.__plugins__:register_pickle_patches_runtime', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.092 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_public_cloudpods_endpoints', value='localstack_persistence.pods.__plugins__:register_public_cloudpods_endpoints', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.092 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_reset_state_resource', value='localstack_persistence.reset.__plugins__:register_reset_state_resource', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.093 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_state_load_strategy', value='localstack_persistence.snapshot.__plugins__:register_state_load_strategy', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.238  WARN --- [  MainThread] l.services.internal        : Enabling diagnose endpoint, please be aware that this can expose sensitive information via your network.
2023-07-26T11:58:44.241 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_state_resource', value='localstack_persistence.snapshot.__plugins__:register_state_resource', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.242 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_state_save_strategy', value='localstack_persistence.snapshot.__plugins__:register_state_save_strategy', group='localstack.hooks.on_infra_start')
2023-07-26T11:58:44.242 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start._patch_botocore_json_parser = <function _patch_botocore_json_parser at 0x7fb45c5145e0>)
2023-07-26T11:58:44.242 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:_patch_botocore_json_parser
2023-07-26T11:58:44.242 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start._publish_config_as_analytics_event = <function _publish_config_as_analytics_event at 0x7fb45c514940>)
2023-07-26T11:58:44.243 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:_publish_config_as_analytics_event
2023-07-26T11:58:44.243 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start._publish_container_info = <function _publish_container_info at 0x7fb45c514c10>)
2023-07-26T11:58:44.243 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:_publish_container_info
2023-07-26T11:58:44.243 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start._run_init_scripts_on_start = <function _run_init_scripts_on_start at 0x7fb45c515870>)
2023-07-26T11:58:44.244 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:_run_init_scripts_on_start
2023-07-26T11:58:44.244 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.deprecation_warnings = <function deprecation_warnings at 0x7fb45c516050>)
2023-07-26T11:58:44.244 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:deprecation_warnings
2023-07-26T11:58:44.245 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.register_partition_adjusting_proxy_listener = <function register_partition_adjusting_proxy_listener at 0x7fb45c515f30>)
2023-07-26T11:58:44.245 DEBUG --- [  MainThread] plugin.manager             : plugin localstack.hooks.on_infra_start:register_partition_adjusting_proxy_listener is disabled
2023-07-26T11:58:44.246 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.validate_configuration = <function validate_configuration at 0x7fb45c534280>)
2023-07-26T11:58:44.246 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:validate_configuration
2023-07-26T11:58:44.247 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.register_pickle_patches_runtime = <function register_pickle_patches_runtime at 0x7fb45c5344c0>)
2023-07-26T11:58:44.248 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:register_pickle_patches_runtime
2023-07-26T11:58:44.248 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.register_public_cloudpods_endpoints = <function register_public_cloudpods_endpoints at 0x7fb45c534820>)
2023-07-26T11:58:44.248 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_start:register_public_cloudpods_endpoints
2023-07-26T11:58:44.249 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.register_reset_state_resource = <function register_reset_state_resource at 0x7fb45c5349d0>)
2023-07-26T11:58:44.249 DEBUG --- [  MainThread] plugin.manager             : plugin localstack.hooks.on_infra_start:register_reset_state_resource is disabled
2023-07-26T11:58:44.249 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.register_state_load_strategy = <function register_state_load_strategy at 0x7fb45bdb48b0>)
2023-07-26T11:58:44.250 DEBUG --- [  MainThread] plugin.manager             : plugin localstack.hooks.on_infra_start:register_state_load_strategy is disabled
2023-07-26T11:58:44.250 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.register_state_resource = <function register_state_resource at 0x7fb45bdb4790>)
2023-07-26T11:58:44.250 DEBUG --- [  MainThread] plugin.manager             : plugin localstack.hooks.on_infra_start:register_state_resource is disabled
2023-07-26T11:58:44.251 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_start.register_state_save_strategy = <function register_state_save_strategy at 0x7fb45bdb4af0>)
2023-07-26T11:58:44.251 DEBUG --- [  MainThread] plugin.manager             : plugin localstack.hooks.on_infra_start:register_state_save_strategy is disabled
2023-07-26T11:58:44.254 DEBUG --- [-functhread1] l.u.c.docker_sdk_client    : Creating Docker SDK client failed: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen
    httplib_response = self._make_request(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 415, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen
    retries = retries.increment(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen
    httplib_response = self._make_request(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 415, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/adapters.py", line 501, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/utils/container_utils/docker_sdk_client.py", line 75, in _create_client
    return docker.from_env(timeout=DOCKER_SDK_DEFAULT_TIMEOUT_SECONDS)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/client.py", line 96, in from_env
    return cls(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
2023-07-26T11:58:44.256 DEBUG --- [  MainThread] localstack.runtime.init    : Init scripts discovered: {BOOT: [], START: [], READY: [], SHUTDOWN: []}
2023-07-26T11:58:44.258 DEBUG --- [  MainThread] localstack.plugins         : Checking for the usage of deprecated community features and configs...
2023-07-26T11:58:44.262 DEBUG --- [-functhread1] l.u.c.docker_sdk_client    : Creating Docker SDK client failed: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen
    httplib_response = self._make_request(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 415, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/adapters.py", line 486, in send
    resp = conn.urlopen(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 798, in urlopen
    retries = retries.increment(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/packages/six.py", line 769, in reraise
    raise value.with_traceback(tb)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 714, in urlopen
    httplib_response = self._make_request(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/urllib3/connectionpool.py", line 415, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.10/http/client.py", line 1283, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1329, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1278, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.10/http/client.py", line 1038, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.10/http/client.py", line 976, in send
    self.connect()
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/transport/unixconn.py", line 30, in connect
    sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/client.py", line 214, in _retrieve_server_version
    return self.version(api_version=False)["ApiVersion"]
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/daemon.py", line 181, in version
    return self._result(self._get(url), json=True)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/utils/decorators.py", line 46, in inner
    return f(self, *args, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/client.py", line 237, in _get
    return self.get(url, **self._set_request_timeout(kwargs))
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/sessions.py", line 602, in get
    return self.request("GET", url, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/requests/adapters.py", line 501, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/utils/container_utils/docker_sdk_client.py", line 75, in _create_client
    return docker.from_env(timeout=DOCKER_SDK_DEFAULT_TIMEOUT_SECONDS)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/client.py", line 96, in from_env
    return cls(
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/client.py", line 197, in __init__
    self._version = self._retrieve_server_version()
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/docker/api/client.py", line 221, in _retrieve_server_version
    raise DockerException(
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
2023-07-26T11:58:44.415 DEBUG --- [  MainThread] localstack.utils.threads   : start_thread called without providing a custom name
2023-07-26T11:58:44.424 DEBUG --- [-functhread2] localstack.utils.ssl       : Attempting to download local SSL certificate file
2023-07-26T11:58:44.620 DEBUG --- [-functhread2] localstack.utils.http      : Starting download from https://github.com/localstack/localstack-artifacts/raw/master/local-certs/server.key to /var/lib/localstack/cache/server.test.pem
2023-07-26T11:58:44.624 DEBUG --- [-functhread2] localstack.utils.http      : Done downloading https://github.com/localstack/localstack-artifacts/raw/master/local-certs/server.key, response code 200, total 7K
2023-07-26T11:58:44.633  INFO --- [-functhread5] hypercorn.error            : Running on https://0.0.0.0:4566 (CTRL + C to quit)
2023-07-26T11:58:44.633  INFO --- [-functhread5] hypercorn.error            : Running on https://0.0.0.0:4566 (CTRL + C to quit)
2023-07-26T11:58:44.720 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='acm:default', value='localstack.services.providers:acm', group='localstack.aws.provider')
2023-07-26T11:58:44.728 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='apigateway:default', value='localstack.services.providers:apigateway', group='localstack.aws.provider')
2023-07-26T11:58:44.729 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='cloudformation:default', value='localstack.services.providers:cloudformation', group='localstack.aws.provider')
2023-07-26T11:58:44.729 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='cloudwatch:default', value='localstack.services.providers:cloudwatch', group='localstack.aws.provider')
2023-07-26T11:58:44.730 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='config:default', value='localstack.services.providers:awsconfig', group='localstack.aws.provider')
2023-07-26T11:58:44.730 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='dynamodb:default', value='localstack.services.providers:dynamodb', group='localstack.aws.provider')
2023-07-26T11:58:44.731 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='dynamodbstreams:default', value='localstack.services.providers:dynamodbstreams', group='localstack.aws.provider')
2023-07-26T11:58:44.732 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='ec2:default', value='localstack.services.providers:ec2', group='localstack.aws.provider')
2023-07-26T11:58:44.732 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='es:default', value='localstack.services.providers:es', group='localstack.aws.provider')
2023-07-26T11:58:44.733 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='events:default', value='localstack.services.providers:events', group='localstack.aws.provider')
2023-07-26T11:58:44.733 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='firehose:default', value='localstack.services.providers:firehose', group='localstack.aws.provider')
2023-07-26T11:58:44.734 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='iam:default', value='localstack.services.providers:iam', group='localstack.aws.provider')
2023-07-26T11:58:44.734 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='kinesis:default', value='localstack.services.providers:kinesis', group='localstack.aws.provider')
2023-07-26T11:58:44.734 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='kms:default', value='localstack.services.providers:kms', group='localstack.aws.provider')
2023-07-26T11:58:44.735 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='lambda:asf', value='localstack.services.providers:awslambda_asf', group='localstack.aws.provider')
2023-07-26T11:58:44.735 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='lambda:default', value='localstack.services.providers:awslambda', group='localstack.aws.provider')
2023-07-26T11:58:44.735 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='lambda:legacy', value='localstack.services.providers:awslambda_legacy', group='localstack.aws.provider')
2023-07-26T11:58:44.735 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='lambda:v1', value='localstack.services.providers:awslambda_v1', group='localstack.aws.provider')
2023-07-26T11:58:44.735 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='lambda:v2', value='localstack.services.providers:awslambda_v2', group='localstack.aws.provider')
2023-07-26T11:58:44.735 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='logs:default', value='localstack.services.providers:logs', group='localstack.aws.provider')
2023-07-26T11:58:44.736 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='opensearch:default', value='localstack.services.providers:opensearch', group='localstack.aws.provider')
2023-07-26T11:58:44.736 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='redshift:default', value='localstack.services.providers:redshift', group='localstack.aws.provider')
2023-07-26T11:58:44.736 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='resource-groups:default', value='localstack.services.providers:resource_groups', group='localstack.aws.provider')
2023-07-26T11:58:44.737 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='resourcegroupstaggingapi:default', value='localstack.services.providers:resourcegroupstaggingapi', group='localstack.aws.provider')
2023-07-26T11:58:44.737 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='route53:default', value='localstack.services.providers:route53', group='localstack.aws.provider')
2023-07-26T11:58:44.737 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='route53resolver:default', value='localstack.services.providers:route53resolver', group='localstack.aws.provider')
2023-07-26T11:58:44.738 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:asf', value='localstack.services.providers:s3_asf', group='localstack.aws.provider')
2023-07-26T11:58:44.738 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:default', value='localstack.services.providers:s3', group='localstack.aws.provider')
2023-07-26T11:58:44.739 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:legacy', value='localstack.services.providers:s3_legacy', group='localstack.aws.provider')
2023-07-26T11:58:44.739 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:stream', value='localstack.services.providers:s3_stream', group='localstack.aws.provider')
2023-07-26T11:58:44.739 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:v1', value='localstack.services.providers:s3_v1', group='localstack.aws.provider')
2023-07-26T11:58:44.739 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3:v2', value='localstack.services.providers:s3_v2', group='localstack.aws.provider')
2023-07-26T11:58:44.740 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='s3control:default', value='localstack.services.providers:s3control', group='localstack.aws.provider')
2023-07-26T11:58:44.740 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='secretsmanager:default', value='localstack.services.providers:secretsmanager', group='localstack.aws.provider')
2023-07-26T11:58:44.740 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='ses:default', value='localstack.services.providers:ses', group='localstack.aws.provider')
2023-07-26T11:58:44.741 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='sns:default', value='localstack.services.providers:sns', group='localstack.aws.provider')
2023-07-26T11:58:44.741 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='sqs:default', value='localstack.services.providers:sqs', group='localstack.aws.provider')
2023-07-26T11:58:44.742 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='ssm:default', value='localstack.services.providers:ssm', group='localstack.aws.provider')
2023-07-26T11:58:44.742 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='stepfunctions:default', value='localstack.services.providers:stepfunctions', group='localstack.aws.provider')
2023-07-26T11:58:44.742 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='stepfunctions:v1', value='localstack.services.providers:stepfunctions_v1', group='localstack.aws.provider')
2023-07-26T11:58:44.743 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='stepfunctions:v2', value='localstack.services.providers:stepfunctions_v2', group='localstack.aws.provider')
2023-07-26T11:58:44.743 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='sts:default', value='localstack.services.providers:sts', group='localstack.aws.provider')
2023-07-26T11:58:44.744 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='support:default', value='localstack.services.providers:support', group='localstack.aws.provider')
2023-07-26T11:58:44.744 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='swf:default', value='localstack.services.providers:swf', group='localstack.aws.provider')
2023-07-26T11:58:44.745 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='transcribe:default', value='localstack.services.providers:transcribe', group='localstack.aws.provider')
Ready.
2023-07-26T11:58:44.746 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='_run_init_scripts_on_ready', value='localstack.runtime.init:_run_init_scripts_on_ready', group='localstack.hooks.on_infra_ready')
2023-07-26T11:58:44.746 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='register_virtual_host_routes', value='localstack.services.s3.virtual_host:register_virtual_host_routes', group='localstack.hooks.on_infra_ready')
2023-07-26T11:58:44.776 DEBUG --- [  MainThread] stevedore.extension        : found extension EntryPoint(name='do_run_state_load_all', value='localstack_persistence.snapshot.__plugins__:do_run_state_load_all', group='localstack.hooks.on_infra_ready')
2023-07-26T11:58:44.777 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_ready._run_init_scripts_on_ready = <function _run_init_scripts_on_ready at 0x7fb45c515990>)
2023-07-26T11:58:44.777 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_ready:_run_init_scripts_on_ready
2023-07-26T11:58:44.777 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_ready.register_virtual_host_routes = <function register_virtual_host_routes at 0x7fb45832cee0>)
2023-07-26T11:58:44.778 DEBUG --- [  MainThread] plugin.manager             : loading plugin localstack.hooks.on_infra_ready:register_virtual_host_routes
2023-07-26T11:58:44.778 DEBUG --- [  MainThread] plugin.manager             : instantiating plugin PluginSpec(localstack.hooks.on_infra_ready.do_run_state_load_all = <function do_run_state_load_all at 0x7fb45bdb49d0>)
2023-07-26T11:58:44.779 DEBUG --- [  MainThread] plugin.manager             : plugin localstack.hooks.on_infra_ready:do_run_state_load_all is disabled
2023-07-26T11:58:53.471 DEBUG --- [   asgi_gw_0] l.a.p.service_router       : building service catalog index cache file /var/lib/localstack/cache/service-catalog-2_2_0-1_31_7.pickle
2023-07-26T11:58:55.520 DEBUG --- [-functhread5] localstack.http.asgi       : Error while writing responses: Connection closed (client_info: 127.0.0.1:60654)
2023-07-26T11:58:55.522 ERROR --- [-functhread5] hypercorn.error            : Error in ASGI Framework
Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/asyncio/task_group.py", line 23, in _handle
    await app(scope, receive, send, sync_spawn, call_soon)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/app_wrappers.py", line 33, in __call__
    await self.app(scope, receive, send)
  File "/opt/code/localstack/localstack/aws/serving/asgi.py", line 67, in __call__
    return await self.wsgi(scope, receive, send)
  File "/opt/code/localstack/localstack/http/asgi.py", line 319, in __call__
    return await self.handle_http(scope, receive, send)
  File "/opt/code/localstack/localstack/http/asgi.py", line 388, in handle_http
    await response.close()
  File "/opt/code/localstack/localstack/http/asgi.py", line 269, in close
    await self.send({"type": "http.response.body", "body": b"", "more_body": False})
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/protocol/http_stream.py", line 188, in app_send
    await self.send(EndBody(stream_id=self.stream_id))
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/protocol/h11.py", line 138, in stream_send
    await self._send_h11_event(h11.EndOfMessage())
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/protocol/h11.py", line 240, in _send_h11_event
    data = self.connection.send(event)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/h11/_connection.py", line 512, in send
    data_list = self.send_with_data_passthrough(event)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/h11/_connection.py", line 545, in send_with_data_passthrough
    writer(event, data_list.append)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/h11/_writers.py", line 67, in __call__
    self.send_eom(event.headers, write)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/h11/_writers.py", line 96, in send_eom
    raise LocalProtocolError("Too little data for declared Content-Length")
h11._util.LocalProtocolError: Too little data for declared Content-Length
2023-07-26T11:58:55.522 ERROR --- [-functhread5] hypercorn.error            : Error in ASGI Framework
Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/asyncio/task_group.py", line 23, in _handle
    await app(scope, receive, send, sync_spawn, call_soon)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/app_wrappers.py", line 33, in __call__
    await self.app(scope, receive, send)
  File "/opt/code/localstack/localstack/aws/serving/asgi.py", line 67, in __call__
    return await self.wsgi(scope, receive, send)
  File "/opt/code/localstack/localstack/http/asgi.py", line 319, in __call__
    return await self.handle_http(scope, receive, send)
  File "/opt/code/localstack/localstack/http/asgi.py", line 388, in handle_http
    await response.close()
  File "/opt/code/localstack/localstack/http/asgi.py", line 269, in close
    await self.send({"type": "http.response.body", "body": b"", "more_body": False})
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/protocol/http_stream.py", line 188, in app_send
    await self.send(EndBody(stream_id=self.stream_id))
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/protocol/h11.py", line 138, in stream_send
    await self._send_h11_event(h11.EndOfMessage())
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/hypercorn/protocol/h11.py", line 240, in _send_h11_event
    data = self.connection.send(event)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/h11/_connection.py", line 512, in send
    data_list = self.send_with_data_passthrough(event)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/h11/_connection.py", line 545, in send_with_data_passthrough
    writer(event, data_list.append)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/h11/_writers.py", line 67, in __call__
    self.send_eom(event.headers, write)
  File "/opt/code/localstack/.venv/lib/python3.10/site-packages/h11/_writers.py", line 96, in send_eom
    raise LocalProtocolError("Too little data for declared Content-Length")
h11._util.LocalProtocolError: Too little data for declared Content-Length
```


Discussion:
Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our [Slack Community](https://localstack.cloud/contact/) for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our [contributing guidelines](https://github.com/localstack/.github/blob/main/CONTRIBUTING.md) and our [contributing guide](https://docs.localstack.cloud/contributing/).

Resolving patch:
diff --git a/localstack/services/s3/provider.py b/localstack/services/s3/provider.py
--- a/localstack/services/s3/provider.py
+++ b/localstack/services/s3/provider.py
@@ -1925,7 +1925,11 @@ def validate_lifecycle_configuration(lifecycle_conf: BucketLifecycleConfiguratio
             if len(rule_filter) > 1:
                 raise MalformedXML()
 
-        if exp_date := (rule.get("Expiration", {}).get("Date")):
+        if (expiration := rule.get("Expiration", {})) and "ExpiredObjectDeleteMarker" in expiration:
+            if len(expiration) > 1:
+                raise MalformedXML()
+
+        if exp_date := (expiration.get("Date")):
             if exp_date.timetz() != datetime.time(
                 hour=0, minute=0, second=0, microsecond=0, tzinfo=ZoneInfo("GMT")
             ):
diff --git a/localstack/services/s3/utils.py b/localstack/services/s3/utils.py
--- a/localstack/services/s3/utils.py
+++ b/localstack/services/s3/utils.py
@@ -399,7 +399,7 @@ def get_lifecycle_rule_from_object(
     lifecycle_conf_rules: LifecycleRules, moto_object: FakeKey, object_tags: dict[str, str]
 ) -> LifecycleRule:
     for rule in lifecycle_conf_rules:
-        if "Expiration" not in rule:
+        if not (expiration := rule.get("Expiration")) or "ExpiredObjectDeleteMarker" in expiration:
             continue
 
         if not (rule_filter := rule.get("Filter")):


Test patch:
diff --git a/tests/integration/s3/test_s3.py b/tests/integration/s3/test_s3.py
--- a/tests/integration/s3/test_s3.py
+++ b/tests/integration/s3/test_s3.py
@@ -8337,6 +8337,24 @@ def test_put_bucket_lifecycle_conf_exc(self, s3_bucket, snapshot, aws_client):
 
         snapshot.match("duplicate-tag-keys", e.value.response)
 
+        with pytest.raises(ClientError) as e:
+            lfc["Rules"] = [
+                {
+                    "ID": "expired-delete-marker-and-days",
+                    "Filter": {},
+                    "Status": "Enabled",
+                    "Expiration": {
+                        "Days": 1,
+                        "ExpiredObjectDeleteMarker": True,
+                    },
+                }
+            ]
+            aws_client.s3.put_bucket_lifecycle_configuration(
+                Bucket=s3_bucket, LifecycleConfiguration=lfc
+            )
+
+        snapshot.match("expired-delete-marker-and-days", e.value.response)
+
     @markers.parity.aws_validated
     def test_bucket_lifecycle_configuration_date(self, s3_bucket, snapshot, aws_client):
         snapshot.add_transformer(
@@ -8748,6 +8766,41 @@ def test_bucket_lifecycle_tag_rules(self, s3_bucket, snapshot, aws_client):
         snapshot.match("put-object-no-match", put_object_3)
         assert "Expiration" not in put_object_3
 
+    @markers.parity.aws_validated
+    @markers.snapshot.skip_snapshot_verify(paths=["$..ServerSideEncryption"])
+    def test_lifecycle_expired_object_delete_marker(self, s3_bucket, snapshot, aws_client):
+        snapshot.add_transformer(
+            [
+                snapshot.transform.key_value("BucketName"),
+                snapshot.transform.key_value(
+                    "Expiration", reference_replacement=False, value_replacement="<expiration>"
+                ),
+            ]
+        )
+        rule_id = "rule-marker"
+        lfc = {
+            "Rules": [
+                {
+                    "Expiration": {"ExpiredObjectDeleteMarker": True},
+                    "ID": rule_id,
+                    "Filter": {},
+                    "Status": "Enabled",
+                }
+            ]
+        }
+        aws_client.s3.put_bucket_lifecycle_configuration(
+            Bucket=s3_bucket, LifecycleConfiguration=lfc
+        )
+        result = aws_client.s3.get_bucket_lifecycle_configuration(Bucket=s3_bucket)
+        snapshot.match("get-bucket-lifecycle-conf", result)
+
+        key = "test-expired-object-delete-marker"
+        put_object = aws_client.s3.put_object(Body=b"test", Bucket=s3_bucket, Key=key)
+        snapshot.match("put-object", put_object)
+
+        response = aws_client.s3.head_object(Bucket=s3_bucket, Key=key)
+        snapshot.match("head-object", response)
+
 
 def _anon_client(service: str):
     conf = Config(signature_version=UNSIGNED)
diff --git a/tests/integration/s3/test_s3.snapshot.json b/tests/integration/s3/test_s3.snapshot.json
--- a/tests/integration/s3/test_s3.snapshot.json
+++ b/tests/integration/s3/test_s3.snapshot.json
@@ -8062,7 +8062,7 @@
     }
   },
   "tests/integration/s3/test_s3.py::TestS3BucketLifecycle::test_put_bucket_lifecycle_conf_exc": {
-    "recorded-date": "07-07-2023, 20:42:44",
+    "recorded-date": "26-07-2023, 15:06:44",
     "recorded-content": {
       "missing-id": {
         "Error": {
@@ -8135,6 +8135,16 @@
           "HTTPHeaders": {},
           "HTTPStatusCode": 400
         }
+      },
+      "expired-delete-marker-and-days": {
+        "Error": {
+          "Code": "MalformedXML",
+          "Message": "The XML you provided was not well-formed or did not validate against our published schema"
+        },
+        "ResponseMetadata": {
+          "HTTPHeaders": {},
+          "HTTPStatusCode": 400
+        }
       }
     }
   },
@@ -8634,5 +8644,45 @@
         "Message": "Bucket is missing Object Lock Configuration"
       }
     }
+  },
+  "tests/integration/s3/test_s3.py::TestS3BucketLifecycle::test_lifecycle_expired_object_delete_marker": {
+    "recorded-date": "26-07-2023, 15:14:49",
+    "recorded-content": {
+      "get-bucket-lifecycle-conf": {
+        "Rules": [
+          {
+            "Expiration": "<expiration>",
+            "Filter": {},
+            "ID": "rule-marker",
+            "Status": "Enabled"
+          }
+        ],
+        "ResponseMetadata": {
+          "HTTPHeaders": {},
+          "HTTPStatusCode": 200
+        }
+      },
+      "put-object": {
+        "ETag": "\"098f6bcd4621d373cade4e832627b4f6\"",
+        "ServerSideEncryption": "AES256",
+        "ResponseMetadata": {
+          "HTTPHeaders": {},
+          "HTTPStatusCode": 200
+        }
+      },
+      "head-object": {
+        "AcceptRanges": "bytes",
+        "ContentLength": 4,
+        "ContentType": "binary/octet-stream",
+        "ETag": "\"098f6bcd4621d373cade4e832627b4f6\"",
+        "LastModified": "datetime",
+        "Metadata": {},
+        "ServerSideEncryption": "AES256",
+        "ResponseMetadata": {
+          "HTTPHeaders": {},
+          "HTTPStatusCode": 200
+        }
+      }
+    }
   }
 }