Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L LbAPCommon
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 10
    • Issues 10
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • lhcb-dpa
  • Analysis Productions
  • LbAPCommon
  • Issues
  • #15
Closed
Open
Created Feb 08, 2022 by Aidan Richard Wiederhold@aiwiederOwner

Jinja exceptions are not exposed in the user-facing CI log.

Pointed out by @cburr

Currently an exception raised by Jinja will appear in the CI as

INFO:Creating production B02DDbarKPi
FATAL:Error creating production: Failed to create production for B02DDbarKPi
WARN:not enough values to unpack (expected 7, got 5)

If one were to test locally they would see

Traceback (most recent call last):
  File "/miniconda/envs/analysis-productions/lib/python3.9/site-packages/LbAnalysisProductions/gitlab_runner.py", line 200, in create_productions
    production = Production.create(
  File "/miniconda/envs/analysis-productions/lib/python3.9/site-packages/LbAnalysisProductions/models/production.py", line 64, in create
    self.rendered_yaml = LbAPCommon.render_yaml(self.yaml)
  File "/miniconda/envs/analysis-productions/lib/python3.9/site-packages/LbAPCommon/parsing.py", line 187, in render_yaml
    rendered_yaml = jinja2.Template(
  File "/miniconda/envs/analysis-productions/lib/python3.9/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/miniconda/envs/analysis-productions/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 132, in top-level template code
ValueError: not enough values to unpack (expected 7, got 5)

which specifies the line causing the exception so is much more useful for a user to debug their YAML.

We should try have a message like Exception running jinja2 templating on line 132 of xxx/yyy.yaml: ValueError: not enough values to unpack (expected 7, got 5)

Edited Feb 08, 2022 by Aidan Richard Wiederhold
Assignee
Assign to
Time tracking