GoogleCloudPlatform / solutions-builder

Apache License 2.0
55 stars 19 forks source link

sb set project-id $PROJECT_ID gives exception jinja2.exceptions #163

Open evekhm opened 4 months ago

evekhm commented 4 months ago
python3 -m venv ./venv
source venv/bin/activate
pip install -U solutions-builder
SB_DEBUG=true sb set project-id $PROJECT_ID
This will replace all project-id 'cda-prior-auth-02' to 'cda-prior-auth-02' in folder '.'. Continue? [Y/n]: Y
(Retrieving project number for cda-prior-auth-02...)
(Retrieving project number for cda-prior-auth-02...)
Setting project_id to 'cda-prior-auth-02'...
venv/lib/python3.12/site-packages/solutions_builder/template_root/terraform/stages/1-bootstrap/variables.tf
venv/lib/python3.12/site-packages/solutions_builder/template_root/.github/workflows/e2e_cloudrun_api_test.yaml
Traceback (most recent call last):
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/solutions_builder/cli/cli.py", line 304, in main
    app()
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/typer/main.py", line 326, in __call__
    raise e
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/typer/main.py", line 309, in __call__
    return get_command(self)(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/typer/core.py", line 723, in main
    return _main(
           ^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/typer/core.py", line 193, in _main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/typer/main.py", line 692, in wrapper
    return callback(**use_params)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/solutions_builder/cli/set.py", line 68, in project_id
    set_var("project_id", new_project_id)
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/solutions_builder/cli/vars.py", line 157, in set_var
    filenames = apply_var_to_folder(solution_path, var_name, var_value)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/solutions_builder/cli/vars.py", line 124, in apply_var_to_folder
    filedata, count = replace_var_to_value(var_name, var_value, filedata)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/solutions_builder/cli/vars.py", line 86, in replace_var_to_value
    template = jinja_env.from_string(text)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/jinja2/environment.py", line 1108, in from_string
    return cls.from_code(self, self.compile(source), gs, None)
                               ^^^^^^^^^^^^^^^^^^^^
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/jinja2/environment.py", line 768, in compile
    self.handle_exception(source=source_hint)
  File "/Users/evekhm/projects/genai-app/venv/lib/python3.12/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<unknown>", line 171, in template
jinja2.exceptions.TemplateSyntaxError: Encountered unknown tag 'endraw'.
Error: Encountered unknown tag 'endraw'.