aws-samples/amazon-transcribe-live-call-analytics

Failed to run sam building template file for lca-genesys-audiohook-stack/0.8.2

diego-santamaria opened this issue · 4 comments

Description

I am following the instructions to deploy a custom template in a S3 bucket for CloudFormation. In my version, I made changes to use an existing VPC service, but confirmed that this is not relevant to the issue.

It is related to a sam command (sam building template) in the deployment code.

Version of the code being used: [v0.8.2]
AWS CLI and the AWS SAM CLI being used: [v2.13.0] & [v1.90.0]
Any modifications you've made relevant to the bug: None
Anything unusual about your environment or deployment: I am using Windows Subsystem for Linux (WSL) and Visual Studio Code terminal to run the command specified in the deployment instructions.

Observed result

[INFO] sam building template file for release 0.8.2
Starting Build use cache                                                                                                                                                                                      
Starting Build inside a container                                                                                                                                                                             

Error: Expecting value: line 1 column 1 (char 0)
Traceback:
  File "click/core.py", line 1055, in main
  File "click/core.py", line 1657, in invoke
  File "click/core.py", line 1404, in invoke
  File "click/core.py", line 760, in invoke
  File "click/decorators.py", line 84, in new_func
  File "click/core.py", line 760, in invoke
  File "samcli/lib/telemetry/metric.py", line 184, in wrapped
  File "samcli/lib/telemetry/metric.py", line 149, in wrapped
  File "samcli/lib/utils/version_checker.py", line 42, in wrapped
  File "samcli/cli/main.py", line 95, in wrapper
  File "samcli/commands/build/command.py", line 179, in cli
  File "samcli/commands/build/command.py", line 251, in do_cli
  File "samcli/commands/build/build_context.py", line 184, in __enter__
  File "samcli/commands/build/build_context.py", line 190, in set_up
  File "samcli/lib/providers/sam_stack_provider.py", line 255, in get_stacks
  File "samcli/lib/providers/sam_stack_provider.py", line 51, in __init__
  File "samcli/lib/providers/sam_base_provider.py", line 188, in get_template
  File "samcli/lib/samlib/wrapper.py", line 65, in run_plugins
  File "samtranslator/translator/translator.py", line 418, in prepare_plugins
  File "samtranslator/translator/translator.py", line 459, in make_policy_template_for_function_plugin
  File "samtranslator/policy_template_processor/processor.py", line 62, in __init__
  File "samtranslator/policy_template_processor/processor.py", line 122, in _is_valid_templates_dict
  File "jsonschema/validators.py", line 1117, in validate
  File "jsonschema/validators.py", line 226, in check_schema
  File "<attrs generated init jsonschema.validators.create.<locals>.Validator>", line 5, in __init__
    self.__attrs_post_init__()
  File "jsonschema/validators.py", line 216, in __attrs_post_init__
  File "jsonschema/validators.py", line 772, in from_schema
  File "jsonschema/validators.py", line 744, in __init__
  File "jsonschema/validators.py", line 109, in _store_schema_list
  File "json/__init__.py", line 346, in loads
  File "json/decoder.py", line 337, in decode
  File "json/decoder.py", line 355, in raw_decode

An unexpected error was encountered while executing "sam build".
Search for an existing issue:
https://github.com/aws/aws-sam-cli/issues?q=is%3Aissue+is%3Aopen+Bug%3A%20sam%20build%20-%20JSONDecodeError
Or create a bug report:
https://github.com/aws/aws-sam-cli/issues/new?template=Bug_report.md&title=Bug%3A%20sam%20build%20-%20JSONDecodeError

Steps to reproduce

Follow up the deployment instructions in the main README.md file:

  1. Run the script with up to 4 parameters: ./publish.sh <cfn_bucket_basename> <cfn_prefix> <region> [public]

Hi @diego-santamaria - We've also seen some issues running sam build. But the problems we have seen were related to the command hanging, so not quite the same as the symptoms you mentions. But perhaps your environment is missing other prerequisites, like docker.. not sure.

We made a few changes to our latest release - v0.8.5 - just released this weekend, to add some dependency check into the build script, and fix the hang problem some folks had been seeing.

Can you pull latest release from gitHub, and try the publish script again?

Also, I've not tested building on WSL.. Better if you use a Cloud9 or EC2 instance with Amazon Linux2, if you still have problems.

Any update, @diego-santamaria ?

Hello @rstrahan! I gave Cloud9 a shot, and I'm pleased to report that everything functioned as anticipated. Your suggestions were greatly appreciated.
We can close this one. Thank you.

Excellent! Thanks for circling back. Hope it works well for you! Good luck.