Rocket.chat: Email not verified by clicking verification link

Created on 15 Mar 2018  ยท  38Comments  ยท  Source: RocketChat/Rocket.Chat

Description:

After clicking the verification link the user is redirected to the login page. When the user tries to login it gets a message saying the user is not found or the password is incorrect. When checking as admin, the user is still unverified.

Server Setup Information:

  • Server Setup Information:
  • Version of Rocket.Chat Server: 0.62.2
  • Operating System: Ubuntu 16.04 LTS
  • Deployment Method(snap/docker/tar/etc): Manual install
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • Node Version: 8.9.4

Steps to Reproduce:

  1. Configure SMTP (test it)
  2. Enable verification under Email -> verification
  3. Enable verification under Accounts -> Email verification
  4. Create a user.
  5. Click the verification link in the email.

Expected behavior:

Email should be verified

Actual behavior:

Email isn't verified

Relevant logs:

[34mI20180315-11:14:42.564(0) Meteor โž” publish null -> userId: null , arguments: {} I20180315-11:14:42.570(0) Exception while invoking method 'verifyEmail' MongoError: The positional operator did not find the match needed from the query. Unexpanded update: emails.$.verified at Function.MongoError.create (/home/otm-admin/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11) at toError (/home/otm-admin/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:139:22) at /home/otm-admin/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1059:67 at /home/otm-admin/Rocket.Chat/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:18 at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickDomainCallback (internal/process/next_tick.js:218:9) I20180315-11:14:42.570(0) Meteor โž” publish roles -> userId: null , arguments: {} I20180315-11:14:42.571(0) Meteor โž” publish stream-importers -> userId: null , arguments: { '0': 'progress', '1': { useCollection: false, args: [] } } I20180315-11:14:42.572(0) Meteor โž” publish meteor_autoupdate_clientVersions -> userId: null , arguments: {} I20180315-11:14:42.575(0) Meteor โž” publish stream-notify-all -> userId: null , arguments: { '0': 'updateCustomSound', '1': { useCollection: false, args: [] } } I20180315-11:14:42.576(0) Meteor โž” publish stream-notify-all -> userId: null , arguments: { '0': 'deleteCustomSound', '1': { useCollection: false, args: [] } } I20180315-11:14:42.577(0) Meteor โž” publish activeUsers -> userId: null , arguments: {} I20180315-11:14:42.578(0) Meteor โž” publish userData -> userId: null , arguments: {} I20180315-11:14:42.579(0) Meteor โž” publish stream-notify-all -> userId: null , arguments: { '0': 'public-settings-changed', '1': { useCollection: false, args: [] } } I20180315-11:14:42.587(0) Meteor โž” method autoTranslate.getSupportedLanguages -> userId: null , arguments: { '0': 'en' } I20180315-11:14:42.590(0) Meteor โž” method listCustomSounds -> userId: null , arguments: {} I20180315-11:14:42.591(0) Meteor โž” method listEmojiCustom -> userId: null , arguments: {} I20180315-11:14:42.594(0) Meteor โž” method apps/is-enabled -> userId: null , arguments: {} I20180315-11:14:42.595(0) Meteor โž” method permissions/get -> userId: null , arguments: {} I20180315-11:14:42.597(0) Meteor โž” method public-settings/get -> userId: null , arguments: {} I20180315-11:14:42.622(0) Meteor โž” method UserPresence:online -> userId: null , arguments: { '0': null } I20180315-11:14:42.624(0) Meteor โž” method loadLocale -> userId: null , arguments: { '0': 'nl' } I20180315-11:14:42.852(0) Meteor โž” method permissions/get -> userId: null , arguments: { '0': 2018-03-15T11:14:42.650Z } I20180315-11:14:42.973(0) Meteor โž” method public-settings/get -> userId: null , arguments: { '0': 2018-03-15T11:14:42.818Z }

accounts email bug

Most helpful comment

Still happening in v0.64.1. The symptoms are like #10548: you get error 500 when clicking verify link, emails remains unverified, but the error message is the same.

All 38 comments

Workaround for now is to fill in the password forgotten form.

I just installed Rocket.chat via Docker and got the same issue.

Rocket.Chat Version: 0.62.2
NodeJS Version: 8.9.3 - x64
Platform: linux
Process Port: 3001
ReplicaSet OpLog: Disabled
Commit Hash: 07f0e3f77c
Commit Branch: HEAD     

I'm seeing this, too, after upgrading to 0.62.2 from 0.61.4 - note, on mongo pinned to 3.4 because a previous upgrade of all my Docker containers (using docker-compose) that moved mongo beyond 3.4 failed...

Me to.
Rct: 0.62.2
Node: v8.9.3
MongoDB: 3.6

Yep, seeing this too.

me too
rocket chat version: 0.62.2

me too
Rocket 0.62.2
Node 8.9.3
MongoDB 2.6.12
CentOS 7

Hi @robindijkhof, thanks let us know of the problem.

Anybody still seeing this problem on version 0.63? If so, please share any more relevant logs you may have.

I have the same issue please let me know what logs you would like to see.

I have the same issue on v.0.63.1
SMTP is configured and tests email is sent as expected.
But I got an error Error trying to send email: Mail command failed by clicking "Resend verification email" in "My Account" tab.
There is no warning in "View Logs".

Thank you,

My error logs in send mail are sparse, there is no error.

Cheers,

Gerald

On 04/12/2018 03:47 PM, Vyacheslav Daradur wrote:
>

I have the same issue on v.0.63.1
SMTP is configured and tests email is sent as expected.
But I got an error |Error trying to send email: Mail command failed|
by clicking "Resend verification email" in "My Account" tab.
There is no warning in "View Logs".

โ€”
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/RocketChat/Rocket.Chat/issues/10149#issuecomment-380696611,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AGBC14UkSo1n5KJj60a6_SrWmJss_ufkks5tnvh1gaJpZM4Sr-PD.

@Hudell Same issue here on 63.1

If there's further logs you need than what's in the rocket chat main log, let me know and I will get them.

(I just installed. so you'll have to tell me what logs they are because I really dont know my way around this system yet)

Anybody had this problem with any version prior to 0.62.2?

And do all of you have the setting "Manually Approve New Users" set to true, or it happens with that setting set to false too?

Email verification works neither with "Manually Approve New Users" nor without that setting. I always get:

Exception while invoking method 'verifyEmail' MongoError: The positional operator did not find the match needed from the query. Unexpanded update: emails.$.verified
    at Function.MongoError.create (/opt/rocketchat-0.64.0-rc1/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11)
    at toError (/opt/rocketchat-0.64.0-rc1/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:139:22)
    at /opt/rocketchat-0.64.0-rc1/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1059:67
    at /opt/rocketchat-0.64.0-rc1/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

Exception while invoking method 'verifyEmail' MongoError: The positional operator did not find the match needed from the query. Unexpanded update: emails.$.verified
    at Function.MongoError.create (/opt/rocketchat-0.64.0-rc1/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11)
    at toError (/opt/rocketchat-0.64.0-rc1/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:139:22)
    at /opt/rocketchat-0.64.0-rc1/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1059:67
    at /opt/rocketchat-0.64.0-rc1/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickDomainCallback (internal/process/next_tick.js:218:9)

On our server new users have been able to verify their emails without issues, but previously we had this issue. Unfortunately I don't know what changed, I just remember being surprised that new users could sign in without me interfering.
Version 0.63.0
Mongo 3.4

Bug still present in 0.64.0-rc3.

@Hudell

Have this problem on 0.62.1
"Manually Approve New Users" set to false

Hi, my issue has been resolved after the chat had been updated via Snap to v.0.63.3
"Resend verification email" button in "My Account" tab works well now.
Thanks!

Sending the verification mail is not the problem for me. Clicking on the link send by it is.

Same here. I get an error when I click on the link in the email.

Still happening in v0.64.1. The symptoms are like #10548: you get error 500 when clicking verify link, emails remains unverified, but the error message is the same.

Same here on a fresh install (docker) Version 0.65.1

rocket_1  | Exception while invoking method 'verifyEmail' MongoError: The positional operator did not find the match needed from the query.
rocket_1  |     at Function.MongoError.create (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11)
rocket_1  |     at toError (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:139:22)
rocket_1  |     at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1059:67
rocket_1  |     at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:18
rocket_1  |     at _combinedTickCallback (internal/process/next_tick.js:131:7)
rocket_1  |     at process._tickDomainCallback (internal/process/next_tick.js:218:9)

Maybe there is something wrong with the link in the mail itself. My mailserver is also complaining, that there is no From-Header set in the mail (other notification mails from rocketchat work correctly (see Header X-Amavis-Alert.

Anonymised RAW-Email sent by rocketchat instance:

Return-Path: <>
Delivered-To: [email protected]
Received: from somesome.myserver.com
        by somesome.myserver.com (Dovecot) with LMTP id xxxsdfwhoh23hca
        for <[email protected]>; Wed, 13 Jun 2018 20:07:34 +0200
X-Quarantine-ID: <46gserhsvjl7895>
Authentication-Results: somesome.myserver.com; dkim=permerror (bad message/signature format)
X-Amavis-Alert: BAD HEADER SECTION, Missing required header field: "From"
Content-Type: multipart/alternative;
boundary="--_NmP-ed7fe0d1de64cadd-Part_1"
To: [email protected]
Subject: How to verify email address on Rocket.Chat
Message-ID: <93102c9c-xxxx-xxx-0bb2-asfjwhjkhgh2g2hfph2>
Date: Wed, 13 Jun 2018 18:07:34 +0000
MIME-Version: 1.0

----_NmP-ed7fe0d1de64cadd-Part_1
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hello,

To verify your account email, simply click the link below.

https://rocket.myserver.com/#/verify-email/xxxxxxxsnxAASojqiHiUX=
BznUZZxxxxxx

Thanks.

----_NmP-ed7fe0d1de64cadd-Part_1
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

Hello,

To verify your account email, simply click the link below.

https://rocket.myserver.com/login/#/verify-email/xxxxxxxsnxAASoj=
qiHiUXBznUZZxxxxxx

Thanks.

----_NmP-ed7fe0d1de64cadd-Part_1--

Maybe this helps.

I think I found the problem: It's the = sign in the verification link.
Some mail-clients use this sign as a line-break.

They transform the link which should be
https://rocket.myserver.com/login/#/verify-email/xxxxxxxsnxAASoj=qiHiUXBznUZZxxxxxx

into the following link:

https://rocket.myserver.com/login/#/verify-email/xxxxxxxsnxAASojqiHiUXBznUZZxxxxxx

which breaks it.

I'm using the default templates for the verification mail. Tried it in Rainloop and Thunderbird. Both do strange things to the verification-link.

Hey @tarator, Glad you figured that out! It doesn't seem to be the same bug that the others are having, but I'll look into it.

Have same problem here. Email is delivered ok, but after click on link RocketChat shows Errror 500 and email is not verified.

Rocketchat version: 0.66.0 (docker image rocketchat/rocket.chat:latest)

rocketchat_1  | Exception while invoking method 'verifyEmail' MongoError: The positional operator did not find the match needed from the query.
rocketchat_1  |     at Function.MongoError.create (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/error.js:31:11)
rocketchat_1  |     at toError (/app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/utils.js:139:22)
rocketchat_1  |     at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb/lib/collection.js:1059:67
rocketchat_1  |     at /app/bundle/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/pool.js:469:18
rocketchat_1  |     at _combinedTickCallback (internal/process/next_tick.js:131:7)
rocketchat_1  |     at process._tickDomainCallback (internal/process/next_tick.js:218:9)

What's the most useful thing end-users can do to help fix this? It's a show-stopper for a potential deployment for me.

If you click on the same link multiple times, do you get the same error again?

I just tried it again with the latest version 0.66.1. E-Mail verification now works on my instance of Rocketchat.
Can anybody else confirm this?

This is the mail-template I'm using:

Dear [name],

Please <a href="[Verification_Url]">click here</a> to verify your email for [Site_URL]

Greetings.

YES! It works also in my instance. I just upgraded it to 0.66.2

I'm curious what fixed that bug...

Upgraded too to 0.66.2 and its working (but had to use :latest from docker hub, because 0.66.1 nor 0.66.2 is not there yet..)

Upgraded from 0.66.0 > 0.66.3. Email verification is now working as expected.

Looks like it was fixed by #11335.
Did all of you had OpLog disabled?

I do have OpLog disabled currently

Confirmed, email verification now works as expected in 0.66.3.
I have OpLog disabled.

I'll close this issue then, as #11335 fixed the issue. If anybody still runs into it, just leave a comment and I'll reopen it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bazarnew picture bazarnew  ยท  87Comments

RiusmaX picture RiusmaX  ยท  81Comments

gwillen picture gwillen  ยท  77Comments

mikrobyte picture mikrobyte  ยท  62Comments

pnewell picture pnewell  ยท  243Comments