kratos: Invalid courier template file called email.body.plaintext.gotmpl

Describe the bug

I’m receiving an error on forgot password action, and even though I have the necessary templates, and it did work before the 0.6 release, it now throws an error:

open /conf/courier-templates/recovery/invalid/email.body.plaintext.gotmpl: no such file or directory

Reproducing the bug

Steps to reproduce the behavior:

  1. Deploy using the helm chart
  2. Use v0.6.2-alpha.1

Server logs

time=2021-05-17T15:39:30Z level=info msg=Encountered self-service recovery error. audience=audit error=map[message:open /conf/courier-templates/recovery/invalid/email.body.plaintext.gotmpl: no such file or directory] http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 accept-encoding:gzip accept-language:en-US,en;q=0.9,tr;q=0.8 cache-control:max-age=0 cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://WEB_DOMAIN_URL referer:https://WEB_DOMAIN_URL/ user-agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Edg/90.0.818.56 x-forwarded-for:XFORWARDEDFOR x-forwarded-proto:http] host:KRATOS_URL method:POST path:/self-service/recovery query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:10.244.0.187:58618 scheme:http] recovery_flow=&{afda7f1a-bda2-4b46-9c94-41b934002055 browser 2021-05-17 16:39:14.250301 +0000 UTC 2021-05-17 15:39:14.250301 +0000 UTC http://KRATOS_URL/self-service/recovery/browser 0xc000bac730 choose_method qHD1dh7UexjU1BNpuJl+RAwvqCcmvRcaKpvKViIV/zmgVAM3Ke7ltYeQwuHQYYLoVQoRk4aCiaNl4aNbcpgz+g== 2021-05-17 15:39:14.25136 +0000 UTC 2021-05-17 15:39:14.25136 +0000 UTC {00000000-0000-0000-0000-000000000000 false} 8f5b721e-862a-43c1-ba4f-6137567952c2} service_name=Ory Kratos service_version=v0.6.2-alpha.1
time=2021-05-17T15:39:30Z level=error msg=An error occurred and is being forwarded to the error user interface. audience=application error=map[message:open /conf/courier-templates/recovery/invalid/email.body.plaintext.gotmpl: no such file or directory] http_request=map[headers:map[accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 accept-encoding:gzip accept-language:en-US,en;q=0.9,tr;q=0.8 cache-control:max-age=0 cookie:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". origin:https://WEB_DOMAIN_URL referer:https://WEB_DOMAIN_URL/ user-agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36 Edg/90.0.818.56 x-forwarded-for:XFORWARDEDFOR x-forwarded-proto:http] host:KRATOS_URL method:POST path:/self-service/recovery query:Value is sensitive and has been redacted. To see the value set config key "log.leak_sensitive_values = true" or environment variable "LOG_LEAK_SENSITIVE_VALUES=true". remote:10.244.0.187:58618 scheme:http] service_name=Ory Kratos service_version=v0.6.2-alpha.1

Server configuration

  emailTemplates:
    recovery:
      valid:
        subject: Recover access to your account
        body: |-
          EMAIL
      invalid:
        subject: Account access attempted
        body: |-
          EMAIL
    verification:
      valid:
        subject: Please verify your email address
        body: |-
          EMAIL
      invalid:
        subject:
        body:

Expected behavior

It should send a proper password recovery email.

Environment

  • Version: v0.6.2-alpha.1
  • Environment: Helm

Additional context

I checked, /conf/courier-templates/recovery/invalid/email.body.plaintext.gotmpl file does not exist but email.body.gotmpl exists.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (17 by maintainers)

Commits related to this issue

Most upvoted comments

Additionally, whoami function name changed to toSession but it’s not included in the latest release. It’s getting hard to keep track of these things.

Awesome, thank you so much! And sorry for missing this during the writing of patch notes. It is sometimes very difficult to keep track of everything, especially with great contributions from the community 😃