[GH-ISSUE #4988] [bug]: no such file or directory, open '/dist/backend/dist/mailer/templates/user-invitation.hbs' #1896

Closed
opened 2026-03-16 22:17:42 +03:00 by kerem · 5 comments
Owner

Originally created by @Pezhvak on GitHub (Apr 13, 2025).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4988

Is there an existing issue for this?

  • I have searched existing issues and this bug hasn't been reported yet

Current behavior

When i try to send an email i get this error in the logs

Steps to reproduce

Installed with helm-chart

Logs and Screenshots

Backend Server |     at throwErr (/dist/backend/dist/utils.js:26:11)
Backend Server |     at MailerService.sendEmail (/dist/backend/dist/mailer/mailer.service.js:47:41)
Backend Server |     at async AuthService.signInMagicLink (/dist/backend/dist/auth/auth.service.js:159:9)
Backend Server |     at async AuthController.signInMagicLink (/dist/backend/dist/auth/auth.controller.js:48:31)
Backend Server | node:fs:448
Backend Server |     return binding.readFileUtf8(path, stringToFlags(options.flag));
Backend Server |                    ^
Backend Server |
Backend Server | Error: ENOENT: no such file or directory, open '/dist/backend/dist/mailer/templates/user-invitation.hbs'
Backend Server |     at Object.readFileSync (node:fs:448:20)
Backend Server |     at precompile (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/adapters/handlebars.adapter.js:38:41)
Backend Server |     at HandlebarsAdapter.compile (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/adapters/handlebars.adapter.js:52:34)
Backend Server |     at /dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:17:40
Backend Server |     at processPlugins (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:283:13)
Backend Server |     at /dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:287:17
Backend Server |     at Mail._convertDataImages (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:391:20)
Backend Server |     at Mail._defaultPlugins.compile (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:31:41)
Backend Server |     at processPlugins (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:283:13)
Backend Server |     at Mail._processPlugins (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:291:9) {
Backend Server |   errno: -2,
Backend Server |   code: 'ENOENT',
Backend Server |   syscall: 'open',
Backend Server |   path: '/dist/backend/dist/mailer/templates/user-invitation.hbs'
Backend Server | }
Backend Server |
Backend Server | Node.js v20.15.1
App/Admin Dashboard Caddy | {"level":"warn","ts":1744502084.6786168,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"localhost:8080","duration":0.364844457,"request":{"remote_ip":"10.1.147.164","remote_port":"44464","client_ip":"10.1.147.164","proto":"HTTP/1.1","method":"POST","host":"hoppscotch.imvx.org","uri":"/v1/auth/signin","headers":{"Sec-Ch-Ua-Mobile":["?0"],"X-Forwarded-Host":["hoppscotch.imvx.org"],"X-Scheme":["https"],"Sec-Fetch-Dest":["empty"],"Sec-Fetch-Site":["same-origin"],"Sec-Ch-Ua-Platform":["\"macOS\""],"Content-Type":["application/json"],"X-Forwarded-Scheme":["https"],"Accept":["application/json, text/plain, */*"],"Origin":["https://hoppscotch.imvx.org"],"X-Forwarded-For":["10.1.147.164"],"Accept-Encoding":["gzip, deflate, br, zstd"],"X-Forwarded-Proto":["http"],"X-Request-Id":["3173788c0c76fde238234ab6ab8a16aa"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36"],"Accept-Language":["en-US,en;q=0.9"],"Content-Length":["28"],"Cache-Control":["no-cache"],"Referer":["https://hoppscotch.imvx.org/"],"Pragma":["no-cache"],"Priority":["u=1, i"],"Sec-Ch-Ua":["\"Chromium\";v=\"135\", \"Not-A.Brand\";v=\"8\""],"Sec-Fetch-Mode":["cors"],"X-Forwarded-Port":["443"],"X-Real-Ip":["45.136.155.249"],"Dnt":["1"],"Cookie":["REDACTED"]}},"error":"reading: unexpected EOF"}
Exiting process because Backend Server exited with code 1
Loading...

Environment

Production

Hoppscotch Version

Self-hosted

Interceptor

Not Applicable - Issue not related to network requests

Browsers Affected

No response

Operating System

Linux

Additional Information

I used helm chart, everything is working expect the email provider.

 13       enable: true
 12       useCustomConfigs: true
 11       addressFrom: '"HoppScotch" <hoppscotch@imvx.org>'
 10       smtp:
  9         url: "smtps://hoppscotch@imvx.org:1Rkmy9kx4AVJJy@mail.imvx.org"
  8         host: "mail.imvx.org"
  7         port: "465"
  6         secure: false
  5         user: "hoppscotch@imvx.org"
  4         password: "1Rkmy9kx4AVJJy"
  3         tlsRejectUnauthorized: false
Originally created by @Pezhvak on GitHub (Apr 13, 2025). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4988 ### Is there an existing issue for this? - [x] I have searched existing issues and this bug hasn't been reported yet ### Current behavior When i try to send an email i get this error in the logs ### Steps to reproduce Installed with helm-chart ### Logs and Screenshots ```shell Backend Server | at throwErr (/dist/backend/dist/utils.js:26:11) Backend Server | at MailerService.sendEmail (/dist/backend/dist/mailer/mailer.service.js:47:41) Backend Server | at async AuthService.signInMagicLink (/dist/backend/dist/auth/auth.service.js:159:9) Backend Server | at async AuthController.signInMagicLink (/dist/backend/dist/auth/auth.controller.js:48:31) Backend Server | node:fs:448 Backend Server | return binding.readFileUtf8(path, stringToFlags(options.flag)); Backend Server | ^ Backend Server | Backend Server | Error: ENOENT: no such file or directory, open '/dist/backend/dist/mailer/templates/user-invitation.hbs' Backend Server | at Object.readFileSync (node:fs:448:20) Backend Server | at precompile (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/adapters/handlebars.adapter.js:38:41) Backend Server | at HandlebarsAdapter.compile (/dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/adapters/handlebars.adapter.js:52:34) Backend Server | at /dist/backend/node_modules/.pnpm/@nestjs-modules+mailer@2.0.2_@nestjs+common@10.4.4_class-transformer@0.5.1_class-valida_280615842527df026e7c134e32758d6c/node_modules/@nestjs-modules/mailer/dist/mailer.service.js:17:40 Backend Server | at processPlugins (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:283:13) Backend Server | at /dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:287:17 Backend Server | at Mail._convertDataImages (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:391:20) Backend Server | at Mail._defaultPlugins.compile (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:31:41) Backend Server | at processPlugins (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:283:13) Backend Server | at Mail._processPlugins (/dist/backend/node_modules/.pnpm/nodemailer@6.9.15/node_modules/nodemailer/lib/mailer/index.js:291:9) { Backend Server | errno: -2, Backend Server | code: 'ENOENT', Backend Server | syscall: 'open', Backend Server | path: '/dist/backend/dist/mailer/templates/user-invitation.hbs' Backend Server | } Backend Server | Backend Server | Node.js v20.15.1 App/Admin Dashboard Caddy | {"level":"warn","ts":1744502084.6786168,"logger":"http.handlers.reverse_proxy","msg":"aborting with incomplete response","upstream":"localhost:8080","duration":0.364844457,"request":{"remote_ip":"10.1.147.164","remote_port":"44464","client_ip":"10.1.147.164","proto":"HTTP/1.1","method":"POST","host":"hoppscotch.imvx.org","uri":"/v1/auth/signin","headers":{"Sec-Ch-Ua-Mobile":["?0"],"X-Forwarded-Host":["hoppscotch.imvx.org"],"X-Scheme":["https"],"Sec-Fetch-Dest":["empty"],"Sec-Fetch-Site":["same-origin"],"Sec-Ch-Ua-Platform":["\"macOS\""],"Content-Type":["application/json"],"X-Forwarded-Scheme":["https"],"Accept":["application/json, text/plain, */*"],"Origin":["https://hoppscotch.imvx.org"],"X-Forwarded-For":["10.1.147.164"],"Accept-Encoding":["gzip, deflate, br, zstd"],"X-Forwarded-Proto":["http"],"X-Request-Id":["3173788c0c76fde238234ab6ab8a16aa"],"User-Agent":["Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36"],"Accept-Language":["en-US,en;q=0.9"],"Content-Length":["28"],"Cache-Control":["no-cache"],"Referer":["https://hoppscotch.imvx.org/"],"Pragma":["no-cache"],"Priority":["u=1, i"],"Sec-Ch-Ua":["\"Chromium\";v=\"135\", \"Not-A.Brand\";v=\"8\""],"Sec-Fetch-Mode":["cors"],"X-Forwarded-Port":["443"],"X-Real-Ip":["45.136.155.249"],"Dnt":["1"],"Cookie":["REDACTED"]}},"error":"reading: unexpected EOF"} Exiting process because Backend Server exited with code 1 Loading... ``` ### Environment Production ### Hoppscotch Version Self-hosted ### Interceptor Not Applicable - Issue not related to network requests ### Browsers Affected _No response_ ### Operating System Linux ### Additional Information I used helm chart, everything is working expect the email provider. ``` 13 enable: true 12 useCustomConfigs: true 11 addressFrom: '"HoppScotch" <hoppscotch@imvx.org>' 10 smtp: 9 url: "smtps://hoppscotch@imvx.org:1Rkmy9kx4AVJJy@mail.imvx.org" 8 host: "mail.imvx.org" 7 port: "465" 6 secure: false 5 user: "hoppscotch@imvx.org" 4 password: "1Rkmy9kx4AVJJy" 3 tlsRejectUnauthorized: false ```
kerem 2026-03-16 22:17:42 +03:00
Author
Owner

@Pezhvak commented on GitHub (Apr 13, 2025):

I've used older docker image hoppscotch/hoppscotch:2024.3. as mentioned here #3949 and it works, the weird thing is that this tag is one year old and at the time it supposed to address an issue which was happening before, it seems the issue is returned at some point.

<!-- gh-comment-id:2799533237 --> @Pezhvak commented on GitHub (Apr 13, 2025): I've used older docker image `hoppscotch/hoppscotch:2024.3.` as mentioned here #3949 and it works, the weird thing is that this tag is one year old and at the time it supposed to address an issue which was happening before, it seems the issue is returned at some point.
Author
Owner

@Pezhvak commented on GitHub (Apr 13, 2025):

After adding missing templates under /dist/backend/dist/mailer/templates inside the docker image the issue will be fixed, it seems something is wrong with the dockerfile. it does not fix the issue since if container gets destroyed it will revert to not having these files.

<!-- gh-comment-id:2799540602 --> @Pezhvak commented on GitHub (Apr 13, 2025): After adding [missing templates](https://raw.githubusercontent.com/hoppscotch/hoppscotch/80b63545f14b43067ba290ab6bf15e3d8438f966/packages/hoppscotch-backend/src/mailer/templates/) under `/dist/backend/dist/mailer/templates` inside the docker image the issue will be fixed, it seems something is wrong with the dockerfile. it does not fix the issue since if container gets destroyed it will revert to not having these files.
Author
Owner

@liyasthomas commented on GitHub (Apr 13, 2025):

@Pezhvak, this issue has been resolved in the latest release. Please upgrade to the latest version.

<!-- gh-comment-id:2799648473 --> @liyasthomas commented on GitHub (Apr 13, 2025): @Pezhvak, this issue has been resolved in the latest release. Please upgrade to the latest version.
Author
Owner

@Pezhvak commented on GitHub (Apr 13, 2025):

@liyasthomas I'm using the latest version:
hoppscotch/hoppscotch:2025.3.1 released 3 days ago.

Closing prior to knowing this causes opening another issue to resolve the issue.

<!-- gh-comment-id:2799845001 --> @Pezhvak commented on GitHub (Apr 13, 2025): @liyasthomas I'm using the latest version: hoppscotch/hoppscotch:2025.3.1 released 3 days ago. Closing prior to knowing this causes opening another issue to resolve the issue.
Author
Owner

@Pezhvak commented on GitHub (Apr 13, 2025):

Thanks for reopening this, inspecting files inside the container these template files are missing. Adding them manually fixes the issue.

I can help out by creating an pr if that makes it fix faster.

<!-- gh-comment-id:2799847844 --> @Pezhvak commented on GitHub (Apr 13, 2025): Thanks for reopening this, inspecting files inside the container [these](https://github.com/hoppscotch/hoppscotch/tree/main/packages/hoppscotch-backend/src/mailer/templates) template files are missing. Adding them manually fixes the issue. I can help out by creating an pr if that makes it fix faster.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1896
No description provided.