jinja2.exceptions.TemplateNotFound

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Bamboo fails to start when migrating a standalone instance to Kubernetes cluster using Helm chart with an error seen in the UI "Database contains existing data", and with the log;

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 INFO:root:Generating /opt/atlassian/bamboo/atlassian-bamboo/WEB-INF/classes/database-defaults/[postgresql].properties from template [postgresql].properties.j2 Traceback (most recent call last): File "/entrypoint.py", line 39, in <module> gen_cfg(f"{ATL_DB_TYPE}.properties.j2", File "/entrypoint_helpers.py", line 66, in gen_cfg cfg = jenv.get_template(tmpl).render(env) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 997, in get_template return self._load_template(name, globals) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 958, in _load_template template = self.loader.load(self, name, self.make_globals(globals)) File "/usr/lib/python3/dist-packages/jinja2/loaders.py", line 125, in load source, filename, uptodate = self.get_source(environment, name) File "/usr/lib/python3/dist-packages/jinja2/loaders.py", line 214, in get_source raise TemplateNotFound(template) jinja2.exceptions.TemplateNotFound: [postgresql].properties.j2

Cause

  1. Bamboo Exported shared data is not present in the shared volume mount location.

  2. Wrong database connection configuration .

    1 2 3 4 database: type: postgresql url: - 'jdbc:postgresql://domain:5432/bamboo'

Solution

  1. To export Bamboo to a K8 cluster, ensure Bamboo shared home data is exported or present in the shared persistent volume directory.

  2. Use key:value pair for the database URL configuration

    1 url:jdbc:postgresql://domain:5432/bamboo

    and not list value key:[value]

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.