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

Validationerror :- real_users validation failed error while confirming user. #85

Open
riyazpanarwala opened this issue Jul 5, 2018 · 7 comments

Comments

@riyazpanarwala
Copy link

OS: Windows 7 x64
node version : 9.2.0

Got this error while confirming user. This happens when tring to store temporary users into real users.

{ ValidationError: real_users validation failed
at ValidationError.inspect (E:\wamp\www\node-email-verification-master\node-
email-verification-master\examples\express\node_modules\mongoose\lib\error\valid
ation.js:56:24)
at formatValue (util.js:438:38)
at inspect (util.js:328:10)
at format (util.js:195:12)
at Console.log (console.js:131:21)
at E:\wamp\www\node-email-verification-master\node-email-verification-master
\examples\express\node_modules\email-verification\index.js:419:19
at E:\wamp\www\node-email-verification-master\node-email-verification-master
\examples\express\node_modules\mongoose\lib\model.js:4422:16
at $__save.error (E:\wamp\www\node-email-verification-master\node-email-veri
fication-master\examples\express\node_modules\mongoose\lib\model.js:379:16)
at E:\wamp\www\node-email-verification-master\node-email-verification-master
\examples\express\node_modules\kareem\index.js:246:48
at next (E:\wamp\www\node-email-verification-master\node-email-verification-
master\examples\express\node_modules\kareem\index.js:167:27)
at Kareem.execPost (E:\wamp\www\node-email-verification-master\node-email-ve
rification-master\examples\express\node_modules\kareem\index.js:217:3)
at _handleWrapError (E:\wamp\www\node-email-verification-master\node-email-v
erification-master\examples\express\node_modules\kareem\index.js:245:21)
at E:\wamp\www\node-email-verification-master\node-email-verification-master
\examples\express\node_modules\kareem\index.js:272:14
at _next (E:\wamp\www\node-email-verification-master\node-email-verification
-master\examples\express\node_modules\kareem\index.js:94:14)
at process.nextTick (E:\wamp\www\node-email-verification-master\node-email-v
erification-master\examples\express\node_modules\kareem\index.js:452:38)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
errors: {},
_message: 'real_users validation failed',
name: 'ValidationError' }

@joshbenz1
Copy link
Contributor

What version of mongoose are you using? Also, got any code to look at?

@riyazpanarwala
Copy link
Author

"mongoose": "^5.2.0",
"nodemailer": "^4.6.7",

@riyazpanarwala
Copy link
Author

i am using same code as per examples in this module.

@joshbenz1
Copy link
Contributor

That's what I was guessing. The project dependency is mongoose 3.8 . So a lot has changed between 3.8 and 5.2 lol. They need to update to 5.2 but it will probably take some work to do so. Otherwise, you gotta downgrade to 3.8. there is another issue I saw, issue # 83, whose problem is also caused by this.

@riyazpanarwala
Copy link
Author

It will be great if you upgrade the version because i can use mongoose for other things too in my project,

@riyazpanarwala
Copy link
Author

I have updated package.json of this module to

"mongoose": "^5.2.2",
"nodemailer": "^4.6.7",

And it works with mongo 4.x.

@riyazpanarwala
Copy link
Author

However i need to add this line { validateBeforeSave: false }, when confirming temp user to real user.

user.save({ validateBeforeSave: false }, function(err, savedUser) {}

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

2 participants