Repository navigation
Description
Description:
Command used:
sam deploy \
--guided \
--template-file template/template.yml \
--capabilities CAPABILITY_AUTO_EXPAND CAPABILITY_IAM
Observed result:
Read timed out. (read timeout=0.1)
Error: unhashable type: 'list'
Traceback:
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 1082, in main
rv = self.invoke(ctx)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\cli\cli_config_file.py", line 366, in wrapper
return func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\cli_validation\image_repository_validation.
py", line 111, in wrapped
return func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\decorators.py", line 92, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\click\core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\telemetry\metric.py", line 190, in wrapped
raise exception # pylint: disable=raising-bad-type
^^^^^^^^^^^^^^^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\telemetry\metric.py", line 155, in wrapped
return_value = func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\utils\version_checker.py", line 43, in wrap
ped
actual_result = func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\cli\main.py", line 95, in wrapper
return func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands_utils\cdk_support_decorators.py", lin
e 40, in wrapped
return func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands_utils\command_exception_handler.py",
line 89, in wrapper_command_exception_handler
raise ex
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands_utils\command_exception_handler.py",
line 69, in wrapper_command_exception_handler
return func(*args, **kwargs)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands\deploy\command.py", line 208, in cli
do_cli(
~~~~~~^
template_file,
^^^^^^^^^^^^^^
...<28 lines>...
max_wait_duration,
^^^^^^^^^^^^^^^^^^
) # pragma: no cover
^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands\deploy\command.py", line 304, in do_cl
i
guided_context.run()
~~~~~~~~~~~~~~~~~~^^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands\deploy\guided_context.py", line 572, i
n run
self.guided_prompts(_parameter_override_keys)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\commands\deploy\guided_context.py", line 140, i
n guided_prompts
stacks, _ = SamLocalStackProvider.get_stacks(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
self.template_file,
^^^^^^^^^^^^^^^^^^^
parameter_overrides=sanitize_parameter_overrides(input_parameter_overrides),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
global_parameter_overrides=global_parameter_overrides,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\providers\sam_stack_provider.py", line 281,
in get_stacks
stacks_in_child, remote_stack_full_paths_in_child = SamLocalStackProvider.get_stacks(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
child_stack.location,
^^^^^^^^^^^^^^^^^^^^^
...<5 lines>...
use_sam_transform=use_sam_transform,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\providers\sam_stack_provider.py", line 270,
in get_stacks
current = SamLocalStackProvider(
template_file,
...<4 lines>...
use_sam_transform=use_sam_transform,
)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\providers\sam_stack_provider.py", line 62,
in init
self._template_dict = self.get_template(
~~~~~~~~~~~~~~~~~^
template_dict,
^^^^^^^^^^^^^^
SamLocalStackProvider.merge_parameter_overrides(parameter_overrides, global_parameter_overrides),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
use_sam_transform=use_sam_transform,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\providers\sam_base_provider.py", line 200,
in get_template
template_dict = resolver.resolve_template(ignore_errors=True)
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\intrinsic_resolver\intrinsic_property_resol
ver.py", line 253, in resolve_template
processed_template["Outputs"] = self.resolve_attribute(self._outputs, ignore_errors)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Amazon\AWSSAMCLI\runtime\Lib\site-packages\samcli\lib\intrinsic_resolver\intrinsic_property_resol
ver.py", line 277, in resolve_attribute
processed_dict[processed_key] = processed_resource
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^An unexpected error was encountered while executing "sam deploy".
Search for an existing issue:
https://github.com/aws/aws-sam-cli/issues?q=is%3Aissue+is%3Aopen+Bug%3A%20sam%20deploy%20-%20TypeError
Or create a bug report:
https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20deploy%20-%20TypeError
2026-02-05 01:09:40,197 | HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443):
Read timed out. (read timeout=0.1)
Expected result:
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Windows
sam --version: 1.153.1- AWS region: Sydney
# Paste the output of `sam --info` here
Add --debug flag to command you are running
Activity
reedham-aws commentedon Feb 4, 2026
Thank you for raising this issue. Could you provide an example of the template that gives you this issue? That would help to determine what is causing the malformed structure.
reedham-aws commentedon Feb 4, 2026
I think this might also be a similar issue to what we saw in #8499, although I haven't investigated too deeply.
RitikaLaddha5 commentedon Feb 6, 2026
Here is the example template.yml
reedham-aws commentedon Feb 6, 2026
I think the issue is coming from your nested stack
Cluster. What's happening is that we are trying to resolve the attributes of theOutputssection of the template. I see that you haveVpcSubnetIdsas an output of that template, and also as a parameter with typeCommaSeparatedList.In the
resolve_attribute()function where the error is occuring, we're gettingprocessed_keyfrom a function calledget_translation(), which returns a list when there's aCommaSeparatedList:aws-sam-cli/samcli/lib/intrinsic_resolver/intrinsics_symbol_table.py
Lines 345 to 347 in e0bf888
I believe that is what is ultimately causing the issue; the fact that the
ParameterandOutputhave the same name is colliding in the resolution. The output name gets resolved incorrectly as the parameter, which causes it to break.I think this is a bug in the SAM CLI code with how we're resolving things. At the very least, we could not use the value if it's a list, but I think we shouldn't be resolving the output name like this at all. For now, I think a workaround for you would be to change the output name so there's no collision (even though it should be valid). Could you try that and let me know if it works?
reedham-aws commentedon Feb 6, 2026
Also, for reference, I was able to reproduce with
[-]Bug: sam deploy - TypeError[/-][+]Bug: sam deploy - collisions between parameter name and logical IDs for CommaDelimitedLists[/+]RitikaLaddha5 commentedon Feb 9, 2026
Thanks, this worked. Able to run the command now.
reedham-aws commentedon Feb 9, 2026
I'm gonna reopen this just so we can track it as an issue to be potentially fixed in the future, but the above workaround should work for anybody who finds this issue.
dcabib commentedon Feb 20, 2026
Hi @reedham-aws, I've been looking more closely at the root cause you identified and I'd like to share my analysis.
As you pointed out, the issue is in
resolve_attribute()whereprocessed_keyis obtained fromget_translation(). The core problem is a semantic one:get_translation()was designed to resolve reference values (e.g.!Ref AppName), but here it is also being called on Output/Resource key names. When an Output key name (e.g."AppName") collides with aCommaDelimitedListparameter of the same name,get_translation()correctly splits"hello, world"into["hello", "world"]— which is valid CloudFormation behavior for that parameter type, and the input itself is not wrong. But using that list as a dictionary key then causes theTypeError: unhashable type: 'list'crash.Before proposing a fix, I also looked at the existing tests and noticed that
get_translation()inresolve_attribute()does serve a legitimate purpose for Resources: it handles logical ID renaming vialogical_id_translator(e.g."RestApi.Deployment"→"RestApi"). Removing the call entirely would break that behavior.Taking that into account, the minimal and safe fix is to only use the translated key when it resolves to a string — which covers all valid renaming cases — and fall back to the original key otherwise:
This preserves the existing logical ID renaming behavior for Resources, fixes the crash for
CommaDelimitedListcollisions, and handles all other cases gracefully.Would you be open to me submitting a PR with this fix along with a unit test covering the collision scenario?
vishwakt commentedon May 13, 2026
@reedham-aws I have a fix up for this in #8987.
Root cause confirmed
The crash happens in
resolve_attribute()insamcli/lib/intrinsic_resolver/intrinsic_property_resolver.py. The lineassumes
get_translation()returns eitherNoneor a string. For aCommaDelimitedListparameter, though,IntrinsicsSymbolTable.get_translation()intentionally splits the resolved string value into a Pythonlist(seeintrinsics_symbol_table.py#L344-L347). When an Output (or Resource) logical ID happens to share its name with such a parameter, that list ends up being assigned as a dict key on the next line, which raisesTypeError: unhashable type: 'list'.That matches the analysis above, and the minimal template @reedham-aws posted reproduces it deterministically.
The fix
Use the translated key only when it actually resolves to a string (which covers the legitimate logical-ID renaming case used by
logical_id_translator, e.g.RestApi.Deployment→RestApi), and fall back to the original key otherwise:This is the minimal change that:
CommaDelimitedListname collisions (both Output and Resource cases).Tests
The PR adds three regression tests under
tests/unit/lib/intrinsic_resolver/test_intrinsic_resolver.py:CommaDelimitedListparameter — exactly the minimal repro template @reedham-aws posted. Verifies the Output key is preserved and the!Refvalue still expands to a list.CommaDelimitedListparameter — covers the secondresolve_attribute()call site so we don't regress that branch either.logical_id_translatorstill works — guards the legitimate renaming behavior that the original line was actually written for.I verified that tests 1 and 2 reproduce the original
TypeError: unhashable type: 'list'against the un-patched code, and all three pass after the fix. The widertests/unit/lib/intrinsic_resolver/andtests/unit/lib/providers/suites also pass.Workaround (renaming the colliding Output) still works on the released version while the fix goes through review.
fix: avoid TypeError when CommaDelimitedList parameter name collides …
github-actions commentedon Nov 11, 2026
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
fix: avoid TypeError on CommaDelimitedList parameter / logical ID col…