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

[Bug] Need to log but continue on template errors #511

Open
stewartshea opened this issue Jul 30, 2024 · 0 comments
Open

[Bug] Need to log but continue on template errors #511

stewartshea opened this issue Jul 30, 2024 · 0 comments
Assignees

Comments

@stewartshea
Copy link
Contributor

Observation
The following type of error causes discovery / rendering to halt. We need to log and continue.

Rendering output item: workspaces/b-sandbox/slxs/odo-od-grnsucsc1c-k8s-otlcllc-ba1046ff/slx.yaml
  File "/workspace-builder/workspace_builder/views.py", line 99, in post
    run_components(context, components)

  File "/workspace-builder/component.py", line 356, in run_components
    component.run_func(context)

  File "/workspace-builder/renderers/render_output_items.py", line 55, in render
    output_text = render_template_file(output_item.template_name,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/workspace-builder/template.py", line 83, in render_template_file
    raise WorkspaceBuilderException(message) from e

Caused by:

  File "/workspace-builder/template.py", line 74, in render_template_file
    template = env.get_template(template_file_name)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/pysetup/.venv/lib/python3.11/site-packages/jinja2/environment.py", line 1013, in get_template
    return self._load_template(name, globals)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/pysetup/.venv/lib/python3.11/site-packages/jinja2/environment.py", line 972, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/opt/pysetup/.venv/lib/python3.11/site-packages/jinja2/loaders.py", line 578, in load
    raise TemplateNotFound(name)

Internal Server Error: /run/
[30/Jul/2024 13:11:35] "POST /run/ HTTP/1.1" 500 16935
Error 500 from Workspace Builder service for command "run": Error opening template file: k8s-otelcollector-slx.yaml
10.107.160.6 - - [30/Jul/2024:13:11:51 +0000] "GET / HTTP/1.1" 200 35130 "-" "curl/7.88.1"
10.128.0.94 - - [30/Jul/2024:13:11:54 +0000] "GET / HTTP/1.1" 200 35130 "-" "kube-probe/1.27"

Possible Suggestions
Log and continue. This is an issue with a codecollection repository template which shouldn't cause discovery to fail.

Any other details or context

@stewartshea stewartshea self-assigned this Jul 30, 2024
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

1 participant