Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookiecutter setup script fails with command not available error message #19

Closed
matthewheathoyster opened this issue Jul 30, 2022 · 5 comments

Comments

@matthewheathoyster
Copy link

Attempting to run sam init --location "gh:customink/lamby-cookiecutter" and after entering the project name returns the following error

Command /tmp/tmpawy2lirz.py not available
...
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 1259, in invoke
  File "click/core.py", line 1066, in invoke
  File "click/core.py", line 610, in invoke
  File "samcli/commands/init/__init__.py", line 128, in wrapped
  File "click/decorators.py", line 73, in new_func
  File "click/core.py", line 610, in invoke
  File "samcli/lib/telemetry/metric.py", line 166, in wrapped
  File "samcli/lib/telemetry/metric.py", line 124, in wrapped
  File "samcli/lib/utils/version_checker.py", line 41, in wrapped
  File "samcli/cli/main.py", line 87, in wrapper
  File "samcli/commands/init/__init__.py", line 281, in cli
  File "samcli/commands/init/__init__.py", line 350, in do_cli
  File "samcli/commands/init/init_generator.py", line 31, in do_generate
  File "samcli/lib/init/__init__.py", line 97, in generate_project
  File "cookiecutter/main.py", line 120, in cookiecutter
  File "cookiecutter/generate.py", line 374, in generate_files
  File "cookiecutter/generate.py", line 179, in generate_file
  File "jinja2/environment.py", line 1090, in render
  File "jinja2/environment.py", line 832, in handle_exception
  File "jinja2/_compat.py", line 28, in reraise
  File "./docker-compose.yml", line 3, in top-level template code
  File "jinja2/loaders.py", line 197, in get_source
jinja2.exceptions.TemplateNotFound: _cctmp/dash_name.txt
[29023] Failed to execute script __main__

I am running SAM v1.53.0 and Docker v20.10.17, build 100c701. My Python version is 3.8.10 and my Ruby version is 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-linux].

@matthewheathoyster
Copy link
Author

Oh, maybe it's the Ruby version. I see that Lamby only supports 2.7 at the latest. 😄

@matthewheathoyster
Copy link
Author

I'm re-opening this because the same error persists when using Ruby v2.7.x (in this case, 2.7.6) but the alternative setup using the docker run command works as expected (although it then throws up its own error messages when running ./bin/bootstrap)

@metaskills
Copy link
Member

I see that Lamby only supports 2.7 at the latest.

So Lamby is a rack adapter and supports any Ruby version on any container for Rails that supports Rack v2 or higher. That is typically Rails 5.0 and higher. I think what you meant to say is that the AWS Lambda Containers provided only go as high as Ruby 2.7 (sadly). I've been meaning to find some time build a guide on how folks can bring their own containers and push past that Ruby limitation. But Lamby should be fine either way.

I'm re-opening this because the same error persists

I'll take a look.

@metaskills
Copy link
Member

FWIW, I tested and it worked. Here is my local info. I think the SAM binary encapsulates Python.

> sam --version
SAM CLI, version 1.53.0
> docker --version
Docker version 20.10.17, build 100c701
> uname
Darwin
> python --version
zsh: command not found: python

@metaskills
Copy link
Member

New cookiecutter and docker usage method landed with new guides. Solves this issue too. https://lamby.custominktech.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants