Troubleshooting Templates
This page covers the messages Studio shows in the template editor and when you save. For errors raised while a workflow runs, see Using a Template in a Workflow.
"Line N: ..." followed by a parser message
Cause: The Handlebars syntax is wrong on that line, for example a block that is never closed. It applies to every template type and blocks saving.
Fix:
- Go to the line named in the message.
- Close the block or correct the placeholder.
"Unknown helper"
Cause: A placeholder calls a helper that is not in the helper list. It is a warning in the editor, but the activity stops with an error when it runs.
Fix: Correct the helper name, or remove the call.
"Not valid JSON: ..."
Cause: The JSON template has no {{ }} placeholders and does not parse as JSON.
Fix:
- Read the reason after the message.
- Correct the commas, quotes, or brackets it names.
"The template does not render valid JSON. Check commas, quotes and braces around the {{ }} expressions."
Cause: With sample data filled in, the template does not produce valid JSON. Typical reasons are an unquoted helper result such as {{uppercase name}}, a missing or extra comma around an {{#each}} block, or a block that renders text that is not JSON.
Fix:
- Put text values in quotes:
"name": "{{customer.name}}". - Check the commas between items that a loop writes.
- Use
{{json value}}for an object or a list.
Studio fills every field with sample data, so it does not catch a plain unquoted {{customer.points}} that has no value at run time. Test the workflow with real data.
"Not well-formed XML: ..."
Cause: The XML has a mismatched or unclosed tag, or more than one top-level element. The reason follows the colon, for example Only one root element is allowed.
Fix:
- Close every tag.
- Wrap the content in a single root element.
"The template could not be rendered to check that the XML is well formed."
Cause: Studio renders an XML template with sample data to check it, and the render failed. A syntax error shows its own Line N message instead, so this one points to something else, for example a partial that is not defined.
Fix: Look for placeholders that cannot be rendered, such as {{> name}}, and write the content in place.
"Executable <script> is not allowed in an HTTP template."
Cause: An HTTP (HTML) template contains a <script> that runs code. The full message adds: Use type="application/json" or "application/ld+json" for data.
Fix: Remove the script. To embed data, use one of those types. The types importmap+json, text/template, text/plain, text/html, and text/x-handlebars-template are also allowed.
Other HTTP (HTML) security messages
Cause: The template contains one of these, and Studio names it in the message:
| The message says | What it found |
|---|---|
A tag such as <iframe>, <object>, or <embed> embeds other content | An <iframe>, <frame>, <frameset>, <object>, <embed>, or <applet> element. |
<base> changes how every link resolves | A <base> element. |
<meta http-equiv="refresh"> redirects the reader | A refresh redirect. |
| Inline event handler "onX" runs script | An attribute such as onclick. |
| "srcdoc" embeds a document | A srcdoc attribute. |
| "attribute" holds a javascript:, vbscript: or data:text/html address | A script address in an attribute. |
| A style that runs script | A style attribute that runs script. |
Each message ends with "is not allowed in an HTTP template."
Fix: Remove the element or attribute the message names.
"<tag> is never closed" or "</tag> has no matching opening tag"
Cause: HTML tags are unbalanced. This is a warning and does not block saving. Studio shows up to 20 tag and raw-output warnings together, then N more tag warnings are not shown.
Fix: Close or remove the tag.
"{{{ }}} writes the value without escaping it. If the value comes from a caller it can inject markup."
Cause: An HTTP (HTML) template uses a triple-brace placeholder. This is a warning.
Fix: Use {{x}} unless you trust the value.
"The template is longer than 200,000 characters, so its syntax and format are not checked here."
Cause: Studio skips checks on very long templates. This is a warning.
Fix: Split the content into smaller templates. The service rejects text over 512,000 characters.
Save draft or Publish shows an error and nothing is saved
Cause: The template has an error. Name problems appear under the Template name field, such as Name is required. Editor problems appear under the editor, such as Add the template before publishing. An empty template can be saved as a draft but not published.
Fix: Correct the message shown.
"A template named 'name' already exists in this workspace"
Cause: Another template at the same level has that name. Capitalization is ignored. For an Organization template the message says organization.
Fix: Choose a different name.
"An organization template named 'name' already exists; rename this template first. Nothing was changed"
Cause: You promoted a workspace template whose name is already used in the organization.
Fix: Rename the workspace template and publish it so the name applies to every version, then promote it again.
"Failed to publish template", "Failed to save draft", or "Failed to promote template"
Cause: The service returned no message. These are the fallbacks Studio shows.
Fix: Try again. If it keeps failing, check your connection and sign in again.
Templates is not available
Cause: Templates is turned off for your organization. The notice reads Not in your plan. In some setups the tab is hidden instead.
Fix: Contact your organization administrator to get access.