bug: LocalStack.NET SQS DeleteQueue fails on LocalStack 2.2

I've discovered a bug related to deleting SQS queues when testing against LocalStack version 2.2. Notably, this operation is successful with previous versions like 1.3.1 and 2.0.

Description of the Problem: When attempting to delete an SQS queue using the LocalStack.NET library, the operation fails (specifically, the test fails during the queue deletion step). There isn't a clear error message, but the logs provided below might offer more insight.

2023-08-15T20:28:51.761985583Z 2023-08-15T20:28:51.761  INFO --- [   asgi_gw_0] localstack.request.aws     : AWS sqs.CreateQueue => 200; CreateQueueRequest({'QueueName': 'c85c8994-510d-4f6e-801d-4b7753932583-DLQ.fifo', 'Attributes': {'FifoQueue': 'true'}}, headers={'User-Agent': 'aws-sdk-dotnet-coreclr/3.7.200.18 aws-sdk-dotnet-core/3.7.200.17 .NET_Core/7.0.9 OS/Microsoft_Windows_10.0.22621 ClientAsync', 'amz-sdk-invocation-id': '87581c5c-6d6c-40ae-99bb-d2f979236c08', 'amz-sdk-request': 'attempt=1; max=5', 'x-amz-security-token': 'my-AwsSessionToken', 'Host': 'sqs.eu-central-1.amazonaws.com', 'X-Amz-Date': '20230815T202851Z', 'X-Amz-Content-SHA256': '62743f562eb66199a917d414916c2c9ea1c35200bcaccc4b457e5ad914a1d7ed', 'Authorization': 'AWS4-HMAC-SHA256 Credential=my-AwsAccessKeyId/20230815/eu-central-1/sqs/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=1e97ce548572fc8dc72f91ff36b259d479f86fcd6706d2ee14e1fb266cbf7713', 'Content-Length': '143', 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'x-localstack-tgt-api': 'sqs', 'x-moto-account-id': '000000000000'}); CreateQueueResult({'QueueUrl': 'http://sqs.eu-central-1.amazonaws.com/000000000000/c85c8994-510d-4f6e-801d-4b7753932583-DLQ.fifo'}, headers={'Content-Type': 'text/xml', 'Content-Length': '385', 'Connection': 'close', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH', 'Access-Control-Allow-Headers': 'authorization,cache-control,content-length,content-md5,content-type,etag,location,x-amz-acl,x-amz-content-sha256,x-amz-date,x-amz-request-id,x-amz-security-token,x-amz-tagging,x-amz-target,x-amz-user-agent,x-amz-version-id,x-amzn-requestid,x-localstack-target,amz-sdk-invocation-id,amz-sdk-request', 'Access-Control-Expose-Headers': 'etag,x-amz-version-id'})
2023-08-15T20:28:51.781754058Z 2023-08-15T20:28:51.781 DEBUG --- [   asgi_gw_0] l.aws.serving.wsgi         : POST sqs.eu-central-1.amazonaws.comhttp://sqs.eu-central-1.amazonaws.com/000000000000/c85c8994-510d-4f6e-801d-4b7753932583-DLQ.fifo
2023-08-15T20:28:51.783127552Z 2023-08-15T20:28:51.783 DEBUG --- [   asgi_gw_0] l.aws.protocol.serializer  : No accept header given. Using request's Content-Type (application/x-www-form-urlencoded; charset=utf-8) as preferred response Content-Type.
2023-08-15T20:28:51.783548737Z 2023-08-15T20:28:51.783  INFO --- [   asgi_gw_0] localstack.request.aws     : AWS sqs.GetQueueAttributes => 200; GetQueueAttributesRequest({'QueueUrl': None, 'AttributeNames': ['QueueArn']}, headers={'User-Agent': 'aws-sdk-dotnet-coreclr/3.7.200.18 aws-sdk-dotnet-core/3.7.200.17 .NET_Core/7.0.9 OS/Microsoft_Windows_10.0.22621 ClientAsync', 'amz-sdk-invocation-id': '012b6c13-4afa-4555-b090-e78392da68ec', 'amz-sdk-request': 'attempt=1; max=5', 'x-amz-security-token': 'my-AwsSessionToken', 'Host': 'sqs.eu-central-1.amazonaws.com', 'X-Amz-Date': '20230815T202851Z', 'X-Amz-Content-SHA256': '6af491181b9d88aef50bfaefb28263f67b71658ce5c3820d3db0f4de1aeed054', 'Authorization': 'AWS4-HMAC-SHA256 Credential=my-AwsAccessKeyId/20230815/eu-central-1/sqs/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=01f05262c5cb1615577f075b22310dfebcbbfff71b5597ebb7116f7189f4db9e', 'Content-Length': '69', 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'x-localstack-tgt-api': 'sqs', 'x-moto-account-id': '000000000000'}); GetQueueAttributesResult({'Attributes': {'QueueArn': 'arn:aws:sqs:eu-central-1:000000000000:c85c8994-510d-4f6e-801d-4b7753932583-DLQ.fifo'}}, headers={'Content-Type': 'text/xml', 'Content-Length': '438', 'Connection': 'close', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH', 'Access-Control-Allow-Headers': 'authorization,cache-control,content-length,content-md5,content-type,etag,location,x-amz-acl,x-amz-content-sha256,x-amz-date,x-amz-request-id,x-amz-security-token,x-amz-tagging,x-amz-target,x-amz-user-agent,x-amz-version-id,x-amzn-requestid,x-localstack-target,amz-sdk-invocation-id,amz-sdk-request', 'Access-Control-Expose-Headers': 'etag,x-amz-version-id'})
2023-08-15T20:28:51.801249377Z 2023-08-15T20:28:51.801 DEBUG --- [   asgi_gw_0] l.aws.serving.wsgi         : POST sqs.eu-central-1.amazonaws.comhttp://sqs.eu-central-1.amazonaws.com/
2023-08-15T20:28:51.802294585Z 2023-08-15T20:28:51.802 DEBUG --- [   asgi_gw_0] l.services.sqs.provider    : creating queue key=c85c8994-510d-4f6e-801d-4b7753932583.fifo attributes={'FifoQueue': 'true', 'RedrivePolicy': '{"maxReceiveCount":"1","deadLetterTargetArn":"arn:aws:sqs:eu-central-1:000000000000:c85c8994-510d-4f6e-801d-4b7753932583-DLQ.fifo"}'} tags=None
2023-08-15T20:28:51.802379784Z 2023-08-15T20:28:51.802 DEBUG --- [   asgi_gw_0] l.aws.protocol.serializer  : No accept header given. Using request's Content-Type (application/x-www-form-urlencoded; charset=utf-8) as preferred response Content-Type.
2023-08-15T20:28:51.802886258Z 2023-08-15T20:28:51.802  INFO --- [   asgi_gw_0] localstack.request.aws     : AWS sqs.CreateQueue => 200; CreateQueueRequest({'QueueName': 'c85c8994-510d-4f6e-801d-4b7753932583.fifo', 'Attributes': {'FifoQueue': 'true', 'RedrivePolicy': '{"maxReceiveCount":"1","deadLetterTargetArn":"arn:aws:sqs:eu-central-1:000000000000:c85c8994-510d-4f6e-801d-4b7753932583-DLQ.fifo"}'}}, headers={'User-Agent': 'aws-sdk-dotnet-coreclr/3.7.200.18 aws-sdk-dotnet-core/3.7.200.17 .NET_Core/7.0.9 OS/Microsoft_Windows_10.0.22621 ClientAsync', 'amz-sdk-invocation-id': '461c8546-c9aa-4a10-8ddd-db4d158c79e0', 'amz-sdk-request': 'attempt=1; max=5', 'x-amz-security-token': 'my-AwsSessionToken', 'Host': 'sqs.eu-central-1.amazonaws.com', 'X-Amz-Date': '20230815T202851Z', 'X-Amz-Content-SHA256': '1dc9cc6f3965102c46707d37a16b9e67ca44e96240792183727e004b50e33c2c', 'Authorization': 'AWS4-HMAC-SHA256 Credential=my-AwsAccessKeyId/20230815/eu-central-1/sqs/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=c36009b0b3e34498c2b70d3bdc73f3dcf69b047de6b2e751d6154ad632026761', 'Content-Length': '356', 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'x-localstack-tgt-api': 'sqs', 'x-moto-account-id': '000000000000'}); CreateQueueResult({'QueueUrl': 'http://sqs.eu-central-1.amazonaws.com/000000000000/c85c8994-510d-4f6e-801d-4b7753932583.fifo'}, headers={'Content-Type': 'text/xml', 'Content-Length': '381', 'Connection': 'close', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH', 'Access-Control-Allow-Headers': 'authorization,cache-control,content-length,content-md5,content-type,etag,location,x-amz-acl,x-amz-content-sha256,x-amz-date,x-amz-request-id,x-amz-security-token,x-amz-tagging,x-amz-target,x-amz-user-agent,x-amz-version-id,x-amzn-requestid,x-localstack-target,amz-sdk-invocation-id,amz-sdk-request', 'Access-Control-Expose-Headers': 'etag,x-amz-version-id'})
2023-08-15T20:28:51.808230863Z 2023-08-15T20:28:51.808 DEBUG --- [   asgi_gw_0] l.aws.serving.wsgi         : POST sqs.eu-central-1.amazonaws.comhttp://sqs.eu-central-1.amazonaws.com/000000000000/c85c8994-510d-4f6e-801d-4b7753932583.fifo
2023-08-15T20:28:51.809442889Z 2023-08-15T20:28:51.808 ERROR --- [   asgi_gw_0] l.aws.handlers.logging     : exception during call chain
2023-08-15T20:28:51.809457699Z Traceback (most recent call last):
2023-08-15T20:28:51.809460599Z   File "/opt/code/localstack/localstack/aws/chain.py", line 90, in handle
2023-08-15T20:28:51.809462449Z     handler(self, self.context, response)
2023-08-15T20:28:51.809463979Z   File "/opt/code/localstack/localstack/aws/handlers/service.py", line 123, in __call__
2023-08-15T20:28:51.809465439Z     handler(chain, context, response)
2023-08-15T20:28:51.809466779Z   File "/opt/code/localstack/localstack/aws/handlers/service.py", line 93, in __call__
2023-08-15T20:28:51.809468169Z     skeleton_response = self.skeleton.invoke(context)
2023-08-15T20:28:51.809469499Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 154, in invoke
2023-08-15T20:28:51.809470869Z     return self.dispatch_request(context, instance)
2023-08-15T20:28:51.809472219Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 166, in dispatch_request
2023-08-15T20:28:51.809473639Z     result = handler(context, instance) or {}
2023-08-15T20:28:51.809474999Z   File "/opt/code/localstack/localstack/aws/forwarder.py", line 60, in _call
2023-08-15T20:28:51.809483999Z     return handler(context, req)
2023-08-15T20:28:51.809485819Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 118, in __call__
2023-08-15T20:28:51.809487309Z     return self.fn(*args, **kwargs)
2023-08-15T20:28:51.809488709Z   File "/opt/code/localstack/localstack/services/sqs/provider.py", line 759, in delete_queue
2023-08-15T20:28:51.809494308Z     account_id, region, name = parse_queue_url(queue_url)
2023-08-15T20:28:51.809495798Z   File "/opt/code/localstack/localstack/services/sqs/utils.py", line 32, in parse_queue_url
2023-08-15T20:28:51.809497358Z     url = urlparse(queue_url.rstrip("/"))
2023-08-15T20:28:51.809498768Z AttributeError: 'NoneType' object has no attribute 'rstrip'
2023-08-15T20:28:51.809582387Z 2023-08-15T20:28:51.809 DEBUG --- [   asgi_gw_0] l.aws.protocol.serializer  : No accept header given. Using request's Content-Type (application/x-www-form-urlencoded; charset=utf-8) as preferred response Content-Type.
2023-08-15T20:28:51.810237589Z 2023-08-15T20:28:51.810  INFO --- [   asgi_gw_0] localstack.request.aws     : AWS sqs.DeleteQueue => 500 (InternalError); DeleteQueueRequest({'QueueUrl': None}, headers={'User-Agent': 'aws-sdk-dotnet-coreclr/3.7.200.18 aws-sdk-dotnet-core/3.7.200.17 .NET_Core/7.0.9 OS/Microsoft_Windows_10.0.22621 ClientAsync', 'amz-sdk-invocation-id': 'aeb4c6dc-5a11-48d0-9e47-fa12ba44d49e', 'amz-sdk-request': 'attempt=1; max=5', 'x-amz-security-token': 'my-AwsSessionToken', 'Host': 'sqs.eu-central-1.amazonaws.com', 'X-Amz-Date': '20230815T202851Z', 'X-Amz-Content-SHA256': '234f83d4860d1a65d3197e883f74f64ea74ddb51defe9f1e5d6d1f592e3d93d5', 'Authorization': 'AWS4-HMAC-SHA256 Credential=my-AwsAccessKeyId/20230815/eu-central-1/sqs/aws4_request, SignedHeaders=content-type;host;user-agent;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=169401817cbf42532a02242bde240e6c75ad1fa9d111ff907b037afae39dd449', 'Content-Length': '37', 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', 'x-localstack-tgt-api': 'sqs', 'x-moto-account-id': '000000000000'}); InternalError(exception while calling sqs.DeleteQueue: Traceback (most recent call last):
2023-08-15T20:28:51.810258679Z   File "/opt/code/localstack/localstack/aws/chain.py", line 90, in handle
2023-08-15T20:28:51.810261319Z     handler(self, self.context, response)
2023-08-15T20:28:51.810262919Z   File "/opt/code/localstack/localstack/aws/handlers/service.py", line 123, in __call__
2023-08-15T20:28:51.810264469Z     handler(chain, context, response)
2023-08-15T20:28:51.810265779Z   File "/opt/code/localstack/localstack/aws/handlers/service.py", line 93, in __call__
2023-08-15T20:28:51.810267199Z     skeleton_response = self.skeleton.invoke(context)
2023-08-15T20:28:51.810268559Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 154, in invoke
2023-08-15T20:28:51.810269959Z     return self.dispatch_request(context, instance)
2023-08-15T20:28:51.810271259Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 166, in dispatch_request
2023-08-15T20:28:51.810272659Z     result = handler(context, instance) or {}
2023-08-15T20:28:51.810273939Z   File "/opt/code/localstack/localstack/aws/forwarder.py", line 60, in _call
2023-08-15T20:28:51.810275319Z     return handler(context, req)
2023-08-15T20:28:51.810276589Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 118, in __call__
2023-08-15T20:28:51.810277959Z     return self.fn(*args, **kwargs)
2023-08-15T20:28:51.810279709Z   File "/opt/code/localstack/localstack/services/sqs/provider.py", line 759, in delete_queue
2023-08-15T20:28:51.810285069Z     account_id, region, name = parse_queue_url(queue_url)
2023-08-15T20:28:51.810286729Z   File "/opt/code/localstack/localstack/services/sqs/utils.py", line 32, in parse_queue_url
2023-08-15T20:28:51.810288239Z     url = urlparse(queue_url.rstrip("/"))
2023-08-15T20:28:51.810289609Z AttributeError: 'NoneType' object has no attribute 'rstrip'
2023-08-15T20:28:51.810291039Z , headers={'Content-Type': 'text/xml', 'Content-Length': '1634', 'Connection': 'close', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH', 'Access-Control-Allow-Headers': 'authorization,cache-control,content-length,content-md5,content-type,etag,location,x-amz-acl,x-amz-content-sha256,x-amz-date,x-amz-request-id,x-amz-security-token,x-amz-tagging,x-amz-target,x-amz-user-agent,x-amz-version-id,x-amzn-requestid,x-localstack-target,amz-sdk-invocation-id,amz-sdk-request', 'Access-Control-Expose-Headers': 'etag,x-amz-version-id'})
2023-08-15T20:28:52.228157360Z 2023-08-15T20:28:52.227 DEBUG --- [   asgi_gw_0] l.aws.serving.wsgi         : POST sqs.eu-central-1.amazonaws.comhttp://sqs.eu-central-1.amazonaws.com/000000000000/c85c8994-510d-4f6e-801d-4b7753932583.fifo
2023-08-15T20:28:52.229107389Z 2023-08-15T20:28:52.228 ERROR --- [   asgi_gw_0] l.aws.handlers.logging     : exception during call chain
2023-08-15T20:28:52.229124879Z Traceback (most recent call last):
2023-08-15T20:28:52.229128259Z   File "/opt/code/localstack/localstack/aws/chain.py", line 90, in handle
2023-08-15T20:28:52.229138019Z     handler(self, self.context, response)
2023-08-15T20:28:52.229139999Z   File "/opt/code/localstack/localstack/aws/handlers/service.py", line 123, in __call__
2023-08-15T20:28:52.229141999Z     handler(chain, context, response)
2023-08-15T20:28:52.229143739Z   File "/opt/code/localstack/localstack/aws/handlers/service.py", line 93, in __call__
2023-08-15T20:28:52.229145609Z     skeleton_response = self.skeleton.invoke(context)
2023-08-15T20:28:52.229147329Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 154, in invoke
2023-08-15T20:28:52.229149099Z     return self.dispatch_request(context, instance)
2023-08-15T20:28:52.229150849Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 166, in dispatch_request
2023-08-15T20:28:52.229152729Z     result = handler(context, instance) or {}
2023-08-15T20:28:52.229154499Z   File "/opt/code/localstack/localstack/aws/forwarder.py", line 60, in _call
2023-08-15T20:28:52.229156319Z     return handler(context, req)
2023-08-15T20:28:52.229158069Z   File "/opt/code/localstack/localstack/aws/skeleton.py", line 118, in __call__
2023-08-15T20:28:52.229159919Z     return self.fn(*args, **kwargs)
2023-08-15T20:28:52.229161649Z   File "/opt/code/localstack/localstack/services/sqs/provider.py", line 759, in delete_queue
2023-08-15T20:28:52.229163449Z     account_id, region, name = parse_queue_url(queue_url)
2023-08-15T20:28:52.229165199Z   File "/opt/code/localstack/localstack/services/sqs/utils.py", line 32, in parse_queue_url
2023-08-15T20:28:52.229174549Z     url = urlparse(queue_url.rstrip("/"))
2023-08-15T20:28:52.229176619Z AttributeError: 'NoneType' object has no attribute 'rstrip'

Using the LocalStack.NET library, the SQS queue should be deleted successfully when calling the DeleteQueue function, consistent with the behavior observed on LocalStack versions 1.3.1 and 2.0.

Using TestContainers with the specific configurations mentioned above.

Using the LocalStack.NET client library mentioned above. I can provide and example project for this specific case as well.