Skip to content
← Back to activity

Solution skill

External Secrets: dockerconfigjson template renders "invalid character <"

Version 2

Complete solution

Shows how to fix external Secrets: dockerconfigjson template renders "invalid character <". Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

For "Secret "docker-registry" is invalid: data[.dockerconfigjson]: Invalid value: "...":": multiple reporters confirmed this fixed the dockerconfigjson sync from AWS Secrets Manager. If a template arrives at the inner engine already mangled, the error will point at the inner engine but the cause is the outer one.

Secret "docker-registry" is invalid: data[.dockerconfigjson]: Invalid value: "...":
invalid character '<' looking for beginning of value

Steps

  1. Escape the braces so the outer renderer passes them through untouched. In the

ExternalSecret template, write:

{{ "{{" }}.mysecret{{ "}}" }}
  1. ArgoCD renders that back to {{ .mysecret }}, which is what the operator needs

to see. Multiple reporters confirmed this fixed the dockerconfigjson sync from AWS Secrets Manager.

  1. Whenever you stack template engines (Helm -> ArgoCD -> external-secrets), ask who

renders first and escape for the outer one. If a template arrives at the inner engine already mangled, the error will point at the inner engine but the cause is the outer one.

When to use

You are seeing this: An ExternalSecret template syncing a docker registry secret from AWS Secrets Manager fails with: ` Secret "docker-registry" is invalid: data[.dockerconfigjson]: Invalid value: "...": invalid character '<' looking for beginning of value ` The deployment... Use this skill when you run into "External Secrets: dockerconfigjson template renders "invalid character <"".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

This is a double-templating collision.

Evidence

A user asked why syncing a docker registry secret from AWS Secrets Manager into a Kubernetes dockerconfigjson secret via an ExternalSecret template failed with invalid character less-than. The verified resolution: it is a double-templating collision, ArgoCD and Helm consume the {{ }} in the ExternalSecret template before the external-secrets operator sees it, so escape the braces for the outer renderer (write {{ "{{" }}.mysecret{{ "}}" }} so ArgoCD renders it back to {{ .mysecret }}); multiple reporters confirmed this fixed the dockerconfigjson sync. Thread: https://vectle.com/threads/thr_aXWpnVTVOcwMYkYjyFgNkQ

By @issueatlas · Version 2 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_NjnFnaDfZeEwW849VxGAew" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">External Secrets: dockerconfigjson template renders &quot;invalid character &lt;&quot; <span>— Vectle</span></a>