localstack / aws-sam-cli-local

Simple wrapper around AWS SAM CLI for use with LocalStack
Apache License 2.0
48 stars 8 forks source link

`samlocal delete` doesn't seem to work with nested stacks #19

Open sbochoa opened 3 months ago

sbochoa commented 3 months ago

Hello,

I have an application using nested stacks, after deploying it successfully, whenever I want to delete it I get the following error:

Error: URL given to the parse method is not a valid S3 url http://localhost:4566/aws-sam-cli-managed-default-samclisourcebucket-fff8ca17/{PROJECT}/ebfc970d7f651f86f94bc8312cf2870c.template Traceback: File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1078, in main rv = self.invoke(ctx) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\cli\cli_config_file.py", line 347, in wrapper return func(*args, **kwargs) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\click\decorators.py", line 92, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\click\core.py", line 783, in invoke return __callback(*args, **kwargs) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\lib\telemetry\metric.py", line 185, in wrapped raise exception # pylint: disable=raising-bad-type File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\lib\telemetry\metric.py", line 150, in wrapped return_value = func(*args, **kwargs) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\lib\utils\version_checker.py", line 43, in wrapped actual_result = func(*args, **kwargs) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\cli\main.py", line 95, in wrapper return func(*args, **kwargs) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\commands\_utils\command_exception_handler.py", line 89, in wrapper_command_exception_handler raise ex File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\commands\_utils\command_exception_handler.py", line 69, in wrapper_command_exception_handler return func(*args, **kwargs) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\commands\delete\command.py", line 86, in cli do_cli( File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\commands\delete\command.py", line 117, in do_cli delete_context.run() File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\commands\delete\delete_context.py", line 316, in run self.delete() File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\commands\delete\delete_context.py", line 244, in delete s3_info = template.get_s3_info() File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\lib\package\artifact_exporter.py", line 369, in get_s3_info s3_info = exporter.get_property_value(resource_dict) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\lib\package\packageable_resources.py", line 201, in get_property_value return parse_s3_url(resource_path) File "C:\Users\{USER}\AppData\Roaming\Python\Python310\site-packages\samcli\lib\utils\s3.py", line 26, in parse_s3_url raise ValueError("URL given to the parse method is not a valid S3 url {0}".format(url))

Command:

samlocal delete --profile {PROFILE} --region us-east-1 --stack-name {STACK} --no-prompts

LocalStack version: 1.3.3 PRO SAMLocal version: 1.69.0

While researching similar issues, I discovered a related problem encountered during a nested stack deployment, as detailed here: LocalStack Issue #4965. It seems that this issue might have been resolved, but I'm uncertain if the fix should have also applied to the delete command.

Does anyone have any suggestions on the next steps?

Thank you in advance for your guidance.