Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
victorbenavente opened this issue Mar 5, 2024 · 49 comments

Comments

@victorbenavente
Copy link

victorbenavente commented Mar 5, 2024

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):

  • OS: macOS Sonoma 14

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

@TheSizkarn
Copy link

I have exactly this too.

@dotoleeoak
Copy link

d6480e3
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
Copy link

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

@zguiyang
Copy link

I have exactly this too.

@jarcoder
Copy link

I have this too. Trying to connect to the Gmail

@matissePe
Copy link

Hello, when will the new version be released ?

@jaequery
Copy link

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
Copy link

You are right, that's weird

@sieeniu
Copy link

sieeniu commented Mar 12, 2024

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

@tranhuywin
Copy link

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

@bodva
Copy link

bodva commented Mar 13, 2024

@jaequery it was not included in the release 1.11.2
You can check the diff here:
v1.11.0...v1.11.2
We all waiting for the release with the fix.

@maidasii
Copy link

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
Copy link

GFoniX commented Mar 19, 2024

Fixed in this PR #1133.

@bodva
Copy link

bodva commented Mar 19, 2024

@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
Copy link

what is the blocker for this release?

@xxwangkaimin
Copy link

image
My project also encountered this issue after it was released

@joaodematejr
Copy link

same problem :(

@AbdulRahman-Sharief
Copy link

email
I have the same problem...

@GFoniX
Copy link

GFoniX commented Mar 20, 2024

@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
Copy link

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
Copy link

Mjeevanantham commented Mar 21, 2024

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))

  • ❌ .then(() => this.mailerLogger.error(Transporter${transporterName} is ready))
    change it to
  • ✅.then(() => this.mailerLogger.log(Transporter${transporterName} is ready))

image

Output:
image

@maxbronnikov10
Copy link

maxbronnikov10 commented Mar 22, 2024

+ for issue. wait for hotfix

@jaequery
Copy link

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

@AdiMarianMutu
Copy link

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

v1.11.2

@YaroslavPuntus
Copy link

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

@ABIKEM01
Copy link

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

@AmruthPillai
Copy link

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
Copy link

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

@AmruthPillai
Copy link

@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
Copy link

saumil-palm commented Mar 27, 2024

@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
Copy link

GFoniX commented Mar 27, 2024

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 #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/[email protected] -s

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

@jaequery
Copy link

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

@rhernandez-itemsoft
Copy link

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

@vincentayorinde
Copy link

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
Copy link

AdiMarianMutu commented Mar 30, 2024

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
Copy link

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
Copy link

bodva commented Apr 8, 2024

does anyone know why the fix can be released?

@Maetes
Copy link

Maetes commented Apr 22, 2024

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

@anthonyyoussef01
Copy link

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
Copy link

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

@gterras
Copy link

gterras commented Apr 25, 2024

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
Copy link

Is there a process to allow new maintainers ?

@levialkalidamat
Copy link

please has the problem been resolved?

@anthonyyoussef01
Copy link

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

@levialkalidamat
Copy link

levialkalidamat commented Apr 29, 2024

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
Copy link

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

@bodva
Copy link

bodva commented Apr 30, 2024

the same here

@gterras
Copy link

gterras commented May 1, 2024

This seems fixed in 2.0.2, thanks!

@HT-35
Copy link

HT-35 commented Aug 24, 2024

24/8/2024

I removed @nestjs-modules/[email protected] and then installed @nestjs-modules/[email protected], which resolved the error. It appears that the issue was fixed in version 2.0.2 of @nestjs-modules/mailer.

npm install --force @nestjs-modules/[email protected]

MailerModule.forRootAsync({
  useFactory: (configService: ConfigService) => ({
    transport: {
      service: 'gmail',
      host: 'smtp.gmail.com',
      port: 465,
      secure: true, // sử dụng SSL
      auth: {
        user: configService.get<string>('MAILDEV_USER'),    //  your email 
        pass: configService.get<string>('MAILDEV_PASS'),   // App password (if using 2-step authentication)
      },
    },
    defaults: {
      from: '"No Reply" <no-reply@localhost>',
    },
  }),
  inject: [ConfigService],
}),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests