nest-modules / mailer

📨 A mailer module for Nest framework (node.js)
https://nest-modules.github.io/mailer/
MIT License
829 stars 173 forks source link

Message "ERROR [MailerService] Transporter is ready" when mail connection is successful #1131

Open victorbenavente opened 4 months ago

victorbenavente commented 4 months ago

Describe the bug When Nest app initialize, the module MailerModule start ok but instead of logging "[Nest] 12077 - 03/05/2024, 9:30:38 LOG [MailerService] Transporter is ready" It is logged as ERROR

To Reproduce

  1. install "@nestjs-modules/mailer": "^1.11.2"
  2. Config MailerModule
  3. run npm start

Expected behavior Should logging "[Nest] 12077 - 03/05/2024, 9:30:38 LOG [MailerService] Transporter is ready"

Screenshots If applicable, add screenshots to help explain your problem. Captura de pantalla 2024-03-05 a la(s) 09 59 58

Desktop (please complete the following information):

Additional context Other users already reported it https://stackoverflow.com/questions/78106894/error-mailerservice-transporter-is-ready-nest-js-nestjs-modules-mailer

TheSizkarn commented 4 months ago

I have exactly this too.

dotoleeoak commented 4 months ago

https://github.com/nest-modules/mailer/commit/d6480e3f2daabc95d34881bbdd8ffb42e08ed73b It seems the issue is fixed by this commit, but it has not released yet. Maybe we just have to wait for the next release.

jaequery commented 4 months ago

This is preventing my CI/CD to pass. When will this be released?

zguiyang commented 4 months ago

I have exactly this too.

jarcoder commented 4 months ago

I have this too. Trying to connect to the Gmail

matissePe commented 4 months ago

Hello, when will the new version be released ?

jaequery commented 4 months ago

FYI, i'm on the latest (v1.11.2) and i get the same error. which is weird because it looks like the fix was released to v1.11.2. not sure what's going on.

matissePe commented 4 months ago

You are right, that's weird

sieeniu commented 4 months ago

I have the same issue... I've seen you fixed it, but when it would be released?

tranhuywin commented 4 months ago

I am experiencing the same issue and I believe it should be resolved urgently

bodva commented 4 months ago

@jaequery it was not included in the release 1.11.2 You can check the diff here: https://github.com/nest-modules/mailer/compare/v1.11.0...v1.11.2 We all waiting for the release with the fix.

maidasii commented 4 months ago

I also encountered this issue and subsequently adjusted the version of @nestjs-modules/mailer in the package.json to 1.10.3, explicitly omitting the caret (^) prefix. However, it seems that the problem began to manifest from this version onward. Fortunately, the connection is successful, albeit the error message generated is quite perplexing.

GFoniX commented 4 months ago

Fixed in this PR https://github.com/nest-modules/mailer/pull/1133.

bodva commented 4 months ago

@GFoniX it is not related to the sendgrid error, the fix for this issue, merged before. We all waiting for the release of that fix.

jaequery commented 4 months ago

what is the blocker for this release?

xxwangkaimin commented 4 months ago

image My project also encountered this issue after it was released

joaodematejr commented 4 months ago

same problem :(

AbdulRahman-Sharief commented 4 months ago

email I have the same problem...

GFoniX commented 4 months ago

@AbdulRahman-Sharief @joaodematejr @xxwangkaimin It's just an error of the type of log. It's currently working. The PR is currently in review

Mjeevanantham commented 4 months ago

Debugger listening on ws://127.0.0.1:51567/b0316a6c-674f-4ca8-b364-b2d65aff7cdd For help, see: https://nodejs.org/en/docs/inspector Debugger attached. Debugger listening on ws://127.0.0.1:51572/2973334e-c38f-47e1-87a9-a207c324e876 For help, see: https://nodejs.org/en/docs/inspector Debugger attached. [Nest] 11912 - 21/03/2024, 12:06:02 pm LOG [NestFactory] Starting Nest application... [2024-03-21 06:36:02] DEBUG Creating transport: nodemailer (6.9.12; +https://nodemailer.com/; SMTP/6.9.12[client:6.9.12]) [Nest] 11912 - 21/03/2024, 12:06:02 pm LOG [InstanceLoader] MailerModule dependencies initialized +26ms [Nest] 11912 - 21/03/2024, 12:06:02 pm LOG [InstanceLoader] MailerCoreModule dependencies initialized +1ms [Nest] 11912 - 21/03/2024, 12:06:02 pm LOG [InstanceLoader] AppModule dependencies initialized +1ms [Nest] 11912 - 21/03/2024, 12:06:02 pm LOG [RoutesResolver] AppController {/}: +11ms [Nest] 11912 - 21/03/2024, 12:06:02 pm LOG [RouterExplorer] Mapped {/, GET} route +7ms [Nest] 11912 - 21/03/2024, 12:06:02 pm LOG [NestApplication] Nest application successfully started +6ms [2024-03-21 06:36:02] DEBUG [ly7gcXw5biE] Resolved smtp.gmail.com as 142.251.10.109 [cache miss] [2024-03-21 06:36:02] INFO [ly7gcXw5biE] Secure connection established to 142.251.10.109:465 [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 220 smtp.gmail.com ESMTP q18-20020aa79832000000b006e6c04efd9dsm12778050pfl.206 - gsmtp [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] C: EHLO [127.0.0.1] [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 250-smtp.gmail.com at your service, [**.151.72] [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 250-SIZE 35882577 [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 250-8BITMIME [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 250-ENHANCEDSTATUSCODES [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 250-PIPELINING [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 250-CHUNKING [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 250 SMTPUTF8 [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] SMTP handshake finished [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] C: AUTH PLAIN = [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 235 2.7.0 Accepted [2024-03-21 06:36:03] INFO [ly7gcXw5biE] User "*****@gmail.com" authenticated [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] C: QUIT [Nest] 11912 - 21/03/2024, 12:06:03 pm ERROR [MailerService] Transporter is ready [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] S: 221 2.0.0 closing connection q18-20020aa79832000000b006e6c04efd9dsm12778050pfl.206 - gsmtp [2024-03-21 06:36:03] DEBUG [ly7gcXw5biE] Closing connection to the server using "end" [2024-03-21 06:36:03] INFO [ly7gcXw5biE] Connection closed

same issue for me too But it is not an error, it is a information

Mjeevanantham commented 4 months ago

Path: lib/mailer.service.ts

private verifyTransporter(transporter: Transporter, name?: string): void { const transporterName = name ? '${name}' : ''; transporter.verify() .then(() => this.mailerLogger.error(Transporter${transporterName} is ready))

image

Output: image

maxbronnikov10 commented 4 months ago

+ for issue. wait for hotfix

jaequery commented 4 months ago

although this seems like a minor "logging information" issue, this is actually breaking the the pipelines for many CI/CD deployment practices

AdiMarianMutu commented 3 months ago

I'm having the same issue and this is breaking our CI/CD Pipeline as well.

v1.11.2

YaroslavPuntus commented 3 months ago

Do we have information about when this bug will be fixed?

ABIKEM01 commented 3 months ago

Please I am having this same issue and its breaking my deployment.

AmruthPillai commented 3 months ago

Right now, the only option is to stick to v1.10.3 unless there's some changes in v1.11.x that you absolutely need (unlikely).

saumil-palm commented 3 months ago

hello i have v1.10.3 it's still show me the error Screenshot 2024-03-27 at 11 39 39 AM

AmruthPillai commented 3 months ago

@saumil-palm If you were on v1.11.x earlier and just changed the package.json to reflect v1.10.3, chances are that npm/pnpm/yarn is just using the latest cached version.

You need to pin the version to a specific number, so in package.json, remove the "^" in front of the version. Also, it helps to remove all node modules and just re-pull all dependencies again to ensure the latest version hasn't been cached.

saumil-palm commented 3 months ago

@AmruthPillai thank you for suggestions. @AmruthPillai i had updated to version ^1.3.22 and still got the error so I removed the code that using mailer.

GFoniX commented 3 months ago

I apologize once again, the issue stems from the fact that I added a "transporters" verification system. In the code, I used console.error instead of console.log for the validation. So, if you see "Transporter is ready", it will still work, but it will be displayed in red instead of green. The fix is currently being validated and will likely be published soon https://github.com/nest-modules/mailer/pull/1133.

For those whose CI/CD is affected by this, I invite you, as explained by @AmruthPillai, to downgrade to version 1.10.3. To do this, simply execute this command:

npm install @nestjs-modules/mailer@1.10.3 -s

Once again, sorry for any inconvenience caused. The fix should be validated soon.

jaequery commented 3 months ago

@GFoniX It's all good and fine, we all make mistakes and we appreciate your efforts.

rhernandez-itemsoft commented 3 months ago

It is not exactly an error. But they must correct the code. image

vincentayorinde commented 3 months ago

my version: "@nestjs-modules/mailer": "^1.11.2",

I fixed it this way Path: node_modules/@nestjs-modules/mailer/dist/mailer.service.js

I changed then(() => this.mailerLogger.error(Transporter${transporterName} is ready)) to then(() => this.mailerLogger.log(Transporter${transporterName} is ready))

AdiMarianMutu commented 3 months ago

my version: "@nestjs-modules/mailer": "^1.11.2",

I fixed it this way Path: node_modules/@nestjs-modules/mailer/dist/mailer.service.js

I changed then(() => this.mailerLogger.error(Transporter${transporterName} is ready)) to then(() => this.mailerLogger.log(Transporter${transporterName} is ready))

It is better to downgrade or to wait for a fix as monkey patching is never a good solution.

Nurudeeen commented 3 months ago

I had the same issue, fixed it by removing the "^" symbol from the version number in my package.json file and re-installing the version of the mailer package through "yarn install" (i am using yarn)

Screenshot 2024-04-02 at 7 41 57 AM Screenshot 2024-04-02 at 7 42 36 AM
bodva commented 3 months ago

does anyone know why the fix can be released?

Maetes commented 3 months ago

I would appreciate a new release too. @juandav can you say something when you will be releasing it?

anthonyyoussef01 commented 2 months ago

I have the same issue

my version: "@nestjs-modules/mailer": "^1.11.2",

I fixed it this way Path: node_modules/@nestjs-modules/mailer/dist/mailer.service.js

I changed then(() => this.mailerLogger.error(Transporter${transporterName} is ready)) to then(() => this.mailerLogger.log(Transporter${transporterName} is ready))

Why can't this be part of a pr and release? Seems trivial, though I haven't spent much time looking into this

jaequery commented 2 months ago

the fix is a one-liner. why would it take so long for approval?

gterras commented 2 months ago

This package is not suitable (anymore ?) for production, it has been continuously broken in a way or another for the last two years we've been using it.

No hard feelings for the maintainers who do as much as they can, and thanks for their hard work, but now it's pretty clear everyone using this package for serious matter should look for an alternative.

matissePe commented 2 months ago

Is there a process to allow new maintainers ?

levialkalidamat commented 2 months ago

please has the problem been resolved?

anthonyyoussef01 commented 2 months ago

I didn't pull the latest changes, but I believe it has. I was following a related PR that I believe got merged

levialkalidamat commented 2 months ago

I didn't pull the latest changes, but I believe it has. I was following a related PR that I believe got merged

I just tested sending email just now and I still get the same error. how to fix this error thanks from PR

Ben-Avrahami commented 2 months ago

i get the same error on the latest release for now (v 2.0.0)

bodva commented 2 months ago

the same here

gterras commented 2 months ago

This seems fixed in 2.0.2, thanks!