Skip to content

sam build fails, json.decoder.JSONDecodeError #3275

@pawelpreczynski-digica

Description

@pawelpreczynski-digica

Description:

sam build command is failing on my machine.

Steps to reproduce:

sam build --debug

Observed result:

Traceback (most recent call last):
  File "samcli/yamlhelper.py", line 118, in yaml_parse
  File "json/__init__.py", line 361, in loads
  File "json/decoder.py", line 337, in decode
  File "json/decoder.py", line 355, in raw_decode
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "samcli/__main__.py", line 12, in <module>
  File "click/core.py", line 829, in __call__
  File "click/core.py", line 782, in main
  File "click/core.py", line 1257, in invoke
  File "click/core.py", line 700, in make_context
  File "click/core.py", line 1048, in parse_args
  File "click/core.py", line 1630, in handle_parse_result
  File "click/core.py", line 123, in invoke_param_callback
  File "samcli/commands/_utils/options.py", line 66, in get_or_default_template_file_name
  File "samcli/commands/_utils/template.py", line 51, in get_template_data
  File "samcli/yamlhelper.py", line 122, in yaml_parse
  File "yaml/__init__.py", line 162, in safe_load
  File "yaml/__init__.py", line 114, in load
  File "yaml/constructor.py", line 51, in get_single_data
  File "yaml/constructor.py", line 55, in construct_document
  File "yaml/constructor.py", line 100, in construct_object
  File "samcli/yamlhelper.py", line 109, in _dict_constructor
  File "yaml/constructor.py", line 155, in construct_pairs
  File "yaml/constructor.py", line 100, in construct_object
  File "samcli/yamlhelper.py", line 109, in _dict_constructor
  File "yaml/constructor.py", line 155, in construct_pairs
  File "yaml/constructor.py", line 100, in construct_object
  File "samcli/yamlhelper.py", line 109, in _dict_constructor
  File "yaml/constructor.py", line 155, in construct_pairs
  File "yaml/constructor.py", line 100, in construct_object
  File "samcli/yamlhelper.py", line 109, in _dict_constructor
  File "yaml/constructor.py", line 155, in construct_pairs
  File "yaml/constructor.py", line 100, in construct_object
  File "samcli/yamlhelper.py", line 109, in _dict_constructor
TypeError: unhashable type: 'collections.OrderedDict'
[15183] Failed to execute script __main__

Expected result:

Expected to run without errors or print error message that could be understood.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Ubuntu 20.04.3 LTS
  2. If using SAM CLI, sam --version: SAM CLI, version 1.30.0
  3. AWS region: eu-west-2

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked/more-info-neededMore info is needed from the requester. If no response in 14 days, it will become stale.stage/bug-reproThe issue/bug needs to be reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions