> For the complete documentation index, see [llms.txt](https://v2.dataos.info/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v2.dataos.info/references/resources/projections/troubleshooting.md).

# Troubleshooting

Resolve common projection template, context, and file-mount issues.

Use this checklist when a projection does not render or behave as expected.

### Debug in this order

#### 1. Verify the placement and template syntax

Check where the projection sits. In a Workflow, `use.projection` must be under a DAG step (`spec.dag[].spec.use.projection`). A projection under the Workflow's top-level `spec` is silently dropped.

Then check the syntax. Liquid is the default `templateType` and does not use a leading dot.

```yaml
template: "{{ secrets['db'].url | base64_decode }}"
```

Go Template syntax with a leading dot, such as `{{.secrets.db.url}}`, is not supported.

#### 2. Confirm the context source exists

Check that the referenced Secret, Depot, or address is valid and accessible.

Common checks:

* Secret ID is correct.
* Depot name is correct.
* The workload can access the referenced object.

#### 3. Check alias usage

If you define `contextAlias: "db"`, reference it through that alias.

```yaml
projection:
  secrets:
    - id: "my-database-secret"
      contextAlias: "db"
```

Use:

```yaml
{{ secrets['db'].username | base64_decode }}
```

Do not mix alias-based and raw ID-based references unless both are available.

#### 4. Inspect generated paths

Projection files can conflict with reserved runtime paths.

Avoid writing to these locations unless the workload expects them:

* `/etc/dataos/config`
* `/etc/dataos/secret`
* `/etc/dataos/work`

Use a custom directory for app-managed files.

#### 5. Test locally first

Use the CLI to isolate the problem.

* Use `dataos develop use` to test projection rendering.
* Use `dataos develop resource` to validate the full resource.

#### 6. Review rendered output

After deployment, inspect the effective environment variables, generated files, and command arguments.

Check that the final values match what the application expects.

### Common issues

#### Projected environment variables are missing at runtime

Possible causes:

* In a Workflow, `use.projection` is under the top-level `spec` instead of a DAG step. The Workflow top-level `spec` has no `use` field, so the projection is dropped without a validation error.
* The projection is defined on one DAG step, but another step expects the same values. Steps do not inherit projections.

What to do:

* Move `use.projection` under `spec.dag[].spec` for every step that needs it.
* Or define the values in the stack's `projection` if every job on that stack needs them.

#### Template is required

```
Error: envVar template is required
```

Possible causes:

* The projection item uses `value` instead of `template`. There is no `value` field, so it is ignored.
* The `template` field is missing.

What to do:

* Rename `value` to `template` on every projection item.

#### Template rendering error

Possible causes:

* Unmatched `{{` or `}}`, or unclosed `{% if %}` blocks
* Go Template syntax (leading dot) instead of Liquid
* A referenced secret or depot that does not exist

What to do:

* Recheck the expression.
* Validate `templateType`.
* Test the expression locally with a minimal context.

#### Secret not found

```
Error: secret 'my-secret' not found
```

Possible causes:

* Secret does not exist.
* Secret ID is misspelled.
* The workload lacks access.

What to do:

* Verify the secret ID.
* Confirm access in the target environment.
* Recheck the alias mapping.

#### Depot fields render as empty

Possible causes:

* Wrong depot alias
* Missing `includeSecrets: true` when secret-backed fields are required
* Incorrect field path in the template

What to do:

* Confirm the depot alias.
* Turn on secret inclusion only when needed.
* Inspect the expected depot object shape.

#### File mount conflict

```
Error: projection file directory cannot be the same as config mount path
```

Possible causes:

* The projection targets a reserved directory.
* Another mount already uses the same path.

What to do:

* Move the file to a custom directory.
* Recheck stack or workload mounts.

#### Template rendered as literal text

Possible causes:

* `templateType` is set to `none`, so `{{ }}` expressions are not processed.

What to do:

* Remove `templateType: "none"` or set it to `liquid` for items that reference context values.

#### Missing runtime values

Possible causes:

* The workload context does not expose the field.
* The template references the wrong object path.
* The value exists only in another environment.

What to do:

* Test with representative context files.
* Add defaults for optional values.
* Remove assumptions about tenant-specific fields.

### Quick validation tips

* Start with one variable.
* Add files and arguments after that works.
* Keep a small local test context for repeatable checks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://v2.dataos.info/references/resources/projections/troubleshooting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
