RocketChat / RocketChat/Rocket.Chat

Exeption: Cannot read property '_syncSendMail' when no mail server is defined

Open
#25,706 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

After upgrading to rocket chat 4.7.0 we are getting these errors in our application that is integrated using the rocket chat API so this is a regression.

This issue seems to be related to this:
https://github.com/meteor/meteor/issues/11709

Steps to reproduce:
  1. Make sure there is on mail server defined in the configuration.
  2. Update the email address of a user.
Expected behavior:

No attempt to send an email should be made and no error message should be displayed.

Actual behavior:

The following error is reported:

Exception in defer callback: TypeError: Cannot read property '_syncSendMail' of null
    at smtpSend (packages/email/email.js:154:13)
    at Object.Email.send (packages/email/email.js:233:5)
    at app/mailer/server/api.ts:176:27
    at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
    at packages/meteor.js:555:25
    at runWithEnvironment (packages/meteor.js:1320:24)
Server Setup Information:
  • Version of Rocket.Chat Server: 4.7.0
  • Operating System: Docker
  • Deployment Method: rocketchat/rocket.chat:4.7.0
  • Number of Running Instances: 1
  • DB Replicaset Oplog: NA
  • NodeJS Version: NA
  • MongoDB Version: 5
Client Setup Information
  • Desktop App or Browser Version: Browser Chrome 101
  • Operating System: Linux
Relevant logs:

Exception in defer callback: TypeError: Cannot read property '_syncSendMail' of null
at smtpSend (packages/email/email.js:154:13)
at Object.Email.send (packages/email/email.js:233:5)
at app/mailer/server/api.ts:176:27
at Meteor.EnvironmentVariable.EVp.withValue (packages/meteor.js:1257:12)
at packages/meteor.js:555:25
at runWithEnvironment (packages/meteor.js:1320:24)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in app/mailer/server/api.ts at the Email.send call around line 176, then inspect packages/email/email.js where smtpSend fails. Reproduce with no mail server configured and a user email update; done means the update makes no email attempt and reports no error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.