Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

"Internal Server Error" when new user registers - somehow related to mail

Open flantascience opened this issue 10 years ago • 19 comments

Your Rocket.Chat version: 0.21.0

Just deployed to entrepreneursanonymous.net

When a new user registers, it throws an "Internal Server Error" message. The email does get registered and stored, but the user doesn't advance to the next page. If they go back to the login screen, they are actually able to login. Though most people probably wouldn't try logging in after getting rejected at registration.

I checked the logs and found an error related to mail:

I20160323-05:57:36.894(0) Exception while invoking method 'registerUser' SenderError: Mail from command failed - 501 Syntax error at Object.Future.wait (/bundle/bundle/programs/server/node_modules/fibers/future.js:398:15) at smtpSend (packages/email/email.js:86:1) at Object.Email.send (packages/email/email.js:185:1) at AccountsServer.Accounts.sendVerificationEmail (password_server.js:781:9) at [object Object].Meteor.methods.registerUser (server/methods/registerUser.coffee:18:13) at [object Object].methodsMap.(anonymous function) (server/lib/debug.js:23:26) at maybeAuditArgumentChecks (livedata_server.js:1698:12) at livedata_server.js:708:19 at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1) at livedata_server.js:706:40 - - - - - at SMTPClient._actionMAIL (/bundle/bundle/programs/server/npm/email/node_modules/simplesmtp/lib/client.js:879:23) at SMTPClient._onData (/bundle/bundle/programs/server/npm/email/node_modules/simplesmtp/lib/client.js:329:29) at CleartextStream.emit (events.js:95:17) at CleartextStream.<anonymous> (_stream_readable.js:765:14) at CleartextStream.emit (events.js:92:17) at emitReadable_ (_stream_readable.js:427:10) at _stream_readable.js:420:7 at process._tickDomainCallback (node.js:502:13)

I am able to send test emails under the SMTP page of Admin. And I'm also able to send test emails using the Mailer page of Admin. I'm using mailgun. And have setup the mailer in MUPX using:

"MAIL_URL": "smtp://my smtp settings for mailgun"

flantascience avatar Mar 23 '16 06:03 flantascience

@rodrigok should we wrap the send email on a TRY to avoid server restart?

engelgabriel avatar Mar 23 '16 20:03 engelgabriel

Is this something others are encountering? Or is it just me?

flantascience avatar Mar 25 '16 03:03 flantascience

I think we've noticed a few others having this issue. As mentioned a fix for it is being considered. Hang tight :smile:

geekgonecrazy avatar Mar 25 '16 03:03 geekgonecrazy

Cool! This seems like a sweet app. Hoping it will be a cool tool for a peer support group for entrepreneurs. Also looking to use it with a bunch of home schooling students too.

flantascience avatar Mar 25 '16 03:03 flantascience

:+1: sounds like two awesome use cases! Thanks for sharing your use case. Always love to see what people are doing with it. If you ever want to tell us more feel free to hit us up on our demo server. :smile:

Back on subject: Seems like anything involving an external action like this, might be good to wrap in try catch to prevent it from blowing up.

geekgonecrazy avatar Mar 25 '16 03:03 geekgonecrazy

@flantascience This is happening on my server as well when users sign up. It seems to freeze and the server restarts. They can log in but do not get an email. The email SMTP is set up correctly from what I can tell.

mimiflynn avatar Mar 30 '16 17:03 mimiflynn

Wonder if this will be better w/ Meteor 1.3 Not sure if it's related issue at all

flantascience avatar Apr 01 '16 00:04 flantascience

@flantascience and @mimiflynn, have you guys changed the SMTP email templates under Admin > SMPT > Invitation? If yes, can you paste your HTMLs here please?

rodrigok avatar Apr 06 '16 21:04 rodrigok

Here's what I've got:

Subject: You have been invited to EntrepreneursAnonymous.net
Invitation HTML: <h2>You have been invited to <h1>EntrepreneursAnonymous.net</h1></h2>
Enrollment Email: BLANK

flantascience avatar Apr 10 '16 00:04 flantascience

@flantascience seems that your problem is the Enrollment Email empty, can you try with some HTML?

rodrigok avatar Apr 10 '16 13:04 rodrigok

@rodrigok should we test for this?

engelgabriel avatar Apr 10 '16 14:04 engelgabriel

@engelgabriel First of all, this is a fantastic webapp! Thanks devs!

I have the same issue. I get the "Internal server error" while trying to register new users and also cannot send verification emails. I get "Error sending confirmation email" while trying to "Resend confirmation email". I have tried all possible solutions. Our site is deployed on "Ubuntu 14.04 without docker" and integrated with CAS.

secretURL: 'JmGWZe5qz7RTYauXP' } } Exception while invoking method 'registerUser' SenderError: Mail from command failed - 555 5.5.2 Syntax error. q189sm8726313oia.7 - gsmtp at Object.Future.wait (/var/www/Rocket.Chat/programs/server/node_modules/fibers/future.js:398:15) at smtpSend (packages/email/email.js:86:1) at Object.Email.send (packages/email/email.js:185:1) at AccountsServer.Accounts.sendVerificationEmail (password_server.js:781:9) at [object Object].Meteor.methods.registerUser (server/methods/registerUser.coffee:20:13) at [object Object].methodsMap.(anonymous function) (server/lib/debug.js:23:26) at maybeAuditArgumentChecks (livedata_server.js:1698:12) at livedata_server.js:708:19 at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1) at livedata_server.js:706:40 - - - - - at SMTPClient._actionMAIL (/var/www/Rocket.Chat/programs/server/npm/email/node_modules/simplesmtp/lib/client.js:879:23) at SMTPClient._onData (/var/www/Rocket.Chat/programs/server/npm/email/node_modules/simplesmtp/lib/client.js:329:29) at CleartextStream.emit (events.js:95:17) at CleartextStream. (_stream_readable.js:765:14) at CleartextStream.emit (events.js:92:17) at emitReadable_ (_stream_readable.js:427:10) at _stream_readable.js:420:7 at process._tickDomainCallback (node.js:492:13)

screen shot 2016-04-11 at 4 05 24 pm

screen shot 2016-04-11 at 4 14 16 pm screen shot 2016-04-11 at 4 14 25 pm

genesplicer avatar Apr 11 '16 21:04 genesplicer

Have you done this? https://support.google.com/accounts/answer/6010255?hl=en

engelgabriel avatar Apr 11 '16 21:04 engelgabriel

Se allo: GMail starts to block less secure apps: how to enable access again http://www.ghacks.net/2014/07/21/gmail-starts-block-less-secure-apps-enable-access/

engelgabriel avatar Apr 11 '16 21:04 engelgabriel

@rodrigok rodrigok Would this just be adding [email] to designate it goes to someone's email address.... or would I be adding an actual message. It seems like "Enrollment" means a Welcome Message of sorts. But it's located in this 'Invitation' section.

I tried both using [email] and an actual message 'Congraulations' and still got an internal server error.

flantascience avatar Apr 11 '16 22:04 flantascience

@engelgabriel I actually allowed "less secure" access to the gmail account and following the conversation in the ticket, I have some message in the enrollment section. I still get the "Internal server error"

capture

genesplicer avatar Apr 11 '16 23:04 genesplicer

What is the relevance of the Gmail in this case? I believe I'm using mailgun...

On Mon, Apr 11, 2016 at 4:49 PM, genesplicer [email protected] wrote:

@engelgabriel https://github.com/engelgabriel I actually allowed "less secure" access to the gmail account and following the conversation in the ticket, I have some message in the enrollment section. I still get the "Internal server error"

[image: capture] https://cloud.githubusercontent.com/assets/18407318/14445841/f9153de8-0015-11e6-8f85-cc37b2df3c6d.PNG

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/RocketChat/Rocket.Chat/issues/2613#issuecomment-208624564

flantascience avatar Apr 13 '16 03:04 flantascience

@flantascience Could you share how you fix this issue? I have the same issue as yours.

9cat avatar Jun 07 '16 08:06 9cat

I never was able to resolve it. I ended up switching to Heroku one-click deploy and things seem to be working there.

flantascience avatar Nov 02 '16 00:11 flantascience