Breaking errors when using some custom templates #820

Closed
opened 2026-04-05 23:46:52 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @nevaran on 11/27/2024

Vaultwarden Support String

After adding custom templates/email files with environment, the email and organization invitations cease to function. Tested most of the /email .hbs files and for now I found just the send_org_invite.hbs and send_org_invite.html.hbs to be breaking functionality in the /email folder. It would seem that it just simply cannot find a org_id variable from looking at the logs.
Adding the /admin templates breaks the admin panel as well, though I have not tested that one any further than "buttons does not even react and the web GUI is wrong colors".

Vaultwarden Build Version

v1.32.5

Deployment method

Official Container Image

Custom deployment method

Portainer compose with pre-made directories

Reverse Proxy

NPM v2.12.1

Host/Server Operating System

Linux

Operating System Version

Ubuntu 24.04 LTS

Clients

Web Vault, Browser Extension, Desktop, Android

Client Version

latest

Steps To Reproduce

  1. Add "TEMPLATES_FOLDER=/data/templates" environment variable
  2. Add templates/email folder with the mentioned file downloaded from the github repo - does not matter if it is modified or not afterwards
  3. Restart container
  4. Attempt to send invites from admin panel

Expected Result

Send invites to join vault and/or organization

Actual Result

Cannot send invite; Handlebars error.
image

Container logs:
image

Logs

[2024-11-27 08:07:43.134][request][INFO] POST /admin/invite

[2024-11-27 08:07:43.136][error][ERROR] Handlebars.

[CAUSE] RenderError {

    template_name: Some(

        "email/send_org_invite.html",

    ),

    line_no: Some(

        12,

    ),

    column_no: Some(

        65,

    ),

    reason: MissingVariable(

        Some(

            "org_id",

        ),

    ),

    unimplemented: false,

}

[2024-11-27 08:07:43.136][response][INFO] (invite_user) POST /admin/invite => 500 Internal Server Error

[2024-11-27 08:07:44.470][request][INFO] GET /admin/users/overview

[2024-11-27 08:07:44.471][response][INFO] (users_overview) GET /admin/users/overview => 200 OK

Screenshots or Videos

image

image

Additional Context

Without the template file the invite is send and the link's org_id is just _ , attempting to modify the .hbs file with just that as well instead of variable fetching results in the same error.

*Originally created by @nevaran on 11/27/2024* ### Vaultwarden Support String After adding custom templates/email files with environment, the email and organization invitations cease to function. Tested most of the /email .hbs files and for now I found just the **send_org_invite.hbs** and **send_org_invite.html.hbs** to be breaking functionality in the **/email** folder. It would seem that it just simply cannot find a **org_id** variable from looking at the logs. Adding the /admin templates breaks the admin panel as well, though I have not tested that one any further than "buttons does not even react and the web GUI is wrong colors". ### Vaultwarden Build Version v1.32.5 ### Deployment method Official Container Image ### Custom deployment method Portainer compose with pre-made directories ### Reverse Proxy NPM v2.12.1 ### Host/Server Operating System Linux ### Operating System Version Ubuntu 24.04 LTS ### Clients Web Vault, Browser Extension, Desktop, Android ### Client Version latest ### Steps To Reproduce 1. Add "TEMPLATES_FOLDER=/data/templates" environment variable 2. Add templates/email folder with the mentioned file downloaded from the github repo - does not matter if it is modified or not afterwards 3. Restart container 4. Attempt to send invites from admin panel ### Expected Result Send invites to join vault and/or organization ### Actual Result Cannot send invite; Handlebars error. ![image](https://github.com/user-attachments/assets/6e9ebbef-884b-478c-821a-fb717a59fc23) Container logs: ![image](https://github.com/user-attachments/assets/f78cc940-2510-4fe4-8fb7-d1b21f324a42) ### Logs ```text [2024-11-27 08:07:43.134][request][INFO] POST /admin/invite [2024-11-27 08:07:43.136][error][ERROR] Handlebars. [CAUSE] RenderError { template_name: Some( "email/send_org_invite.html", ), line_no: Some( 12, ), column_no: Some( 65, ), reason: MissingVariable( Some( "org_id", ), ), unimplemented: false, } [2024-11-27 08:07:43.136][response][INFO] (invite_user) POST /admin/invite => 500 Internal Server Error [2024-11-27 08:07:44.470][request][INFO] GET /admin/users/overview [2024-11-27 08:07:44.471][response][INFO] (users_overview) GET /admin/users/overview => 200 OK ``` ### Screenshots or Videos ![image](https://github.com/user-attachments/assets/6e9ebbef-884b-478c-821a-fb717a59fc23) ![image](https://github.com/user-attachments/assets/f78cc940-2510-4fe4-8fb7-d1b21f324a42) ### Additional Context Without the template file the invite is send and the link's **org_id** is just **_** , attempting to modify the .hbs file with just that as well instead of variable fetching results in the same error.
Sign in to join this conversation.
No Label bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug bug
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#820