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

Issue - users not able to log in after updating to v3 #5230

Closed
BillyJohn3 opened this issue Dec 8, 2018 · 16 comments

Comments

@BillyJohn3
Copy link

commented Dec 8, 2018

I've just updated my Parse server by updating nodejs, node, npm and then using 'git pull' and 'npm install' to update.
Dashboard is running fine but at the top of the dashboard it says "v1.0.18" which I believe is not the newest.

Non of our 6K users can log in right now so I need this fixed asap. I tried logging on on a test IOS device and got the error back from the server (after a correct username and password were entered):

unauthorized (Code: 0, Version: 1.13.0) 2018-12-08 21:59:00.841563+0000 QuickFlics[3086:757234] ERRORR = Error Domain=Parse Code=0 "unauthorized" UserInfo={error=unauthorized, NSLocalizedDescription=unauthorized, temporary=0}

My package.json file:
{ "name": "parse-server-example", "version": "1.4.0", "description": "An example Parse API server using the parse-server module", "main": "index.js", "repository": { "type": "git", "url": "https://github.com/ParsePlatform/parse-server-example" }, "license": "MIT", "dependencies": { "express": "^4.16.4", "kerberos": "~0.0.x", "mailgun-js": "*", "npm": "^6.4.1", "nvm": "0.0.4", "parse": "~1.8.0", "parse-dashboard": "*", "parse-server": "*", "parse-server-mailgun": "*", "parse-server-simple-mailgun-adapter": "*", "stripe": "*" }, "scripts": { "start": "node index.js" }, "engines": { "node": ">=4.3" } }

Also I can't see an error logged in the 'logs' section saying what went wrong (like I'd expect to be able to see if the user had entered a wrong password.

I logged verbose and only things related I can see is the following:

'{"message":"Unable to ensure uniqueness for usernames: ","stack":"MongoError: exception: Index with name: username_1 already exists with different options\n at /root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:581:63\n at authenticateStragglers (/root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:504:16)\n at Connection.messageHandler (/root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:540:5)\n at emitMessageHandler (/root/parse-server-example/node_modules/mongodb-core/lib/connection/connection.js:310:10)\n at Socket. (/root/parse-server-example/node_modules/mongodb-core/lib/connection/connection.js:489:15)\n at Socket.emit (events.js:182:13)\n at Socket.EventEmitter.emit (domain.js:441:20)\n at addChunk (_stream_readable.js:287:12)\n at readableAddChunk (_stream_readable.js:268:11)\n at Socket.Readable.push (_stream_readable.js:223:10)","createdCollectionAutomatically":false,"numIndexesBefore":19,"errmsg":"exception: Index with name: username_1 already exists with different options","code":85,"ok":0,"name":"MongoError","level":"warn","timestamp":"2018-12-08T22:35:04.606Z"}
{"message":"Unable to ensure uniqueness for user email addresses: ","stack":"MongoError: exception: Index with name: email_1 already exists with different options\n at /root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:581:63\n at authenticateStragglers (/root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:504:16)\n at Connection.messageHandler (/root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:540:5)\n at emitMessageHandler (/root/parse-server-example/node_modules/mongodb-core/lib/connection/connection.js:310:10)\n at Socket. (/root/parse-server-example/node_modules/mongodb-core/lib/connection/connection.js:489:15)\n at Socket.emit (events.js:182:13)\n at Socket.EventEmitter.emit (domain.js:441:20)\n at addChunk (_stream_readable.js:287:12)\n at readableAddChunk (_stream_readable.js:268:11)\n at Socket.Readable.push (_stream_readable.js:223:10)","createdCollectionAutomatically":false,"numIndexesBefore":19,"errmsg":"exception: Index with name: email_1 already exists with different options","code":85,"ok":0,"name":"MongoError","level":"warn","timestamp":"2018-12-08T22:35:04.640Z"}'

Any help much appreciated.

@flovilmart

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

You should be able to fix it by dropping the existing indexes

@BillyJohn3

This comment has been minimized.

Copy link
Author

commented Dec 9, 2018

How can I do that?

@georgesjamous

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

Schema index Instructions are in the documentation https://docs.parseplatform.org/js/guide/#indexes
If this does not work, you could try clearing indexes directly from the database

@BillyJohn3

This comment has been minimized.

Copy link
Author

commented Dec 9, 2018

Okay, sorry, I found the system.indexes file and have looked through all. The only ones containing "email_1" are the following:

{
"v": 1,
"key": {
"_created_at": -1,
"username": 1
},
"name": "created_at-1_username_1",
"ns": "quickflics_main._User",
"background": true
}
{
"v": 1,
"key": {
"_id": 1,
"username": 1
},
"name": "_id_1_username_1",
"ns": "quickflics_main._User",
"background": true
}
{
"v": 1,
"unique": true,
"key": {
"username": 1
},
"name": "username_1",
"ns": "quickflics_main._User"
}
{
"v": 1,
"key": {
"username": 1,
"created_at": -1
},
"name": "username_1__created_at-1",
"ns": "quickflics_main._User",
"background": true
}

Only one of the is named "username_1" so why is the server saying there is more than one? Or do I need to delete the only one I can see?

Thanks!

@flovilmart

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

It says more than one as it is trying to create new indexes with the same name on startup.

@BillyJohn3

This comment has been minimized.

Copy link
Author

commented Dec 9, 2018

Can I delete all of those indexes in mongoDB without causing other problems?

@flovilmart

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

This should be fine.

@BillyJohn3

This comment has been minimized.

Copy link
Author

commented Dec 9, 2018

I can't refer to the _User table using Mongo Shell and so can't delete the indexes. I also can't delete the indexes from system.indexes as I'm being given an error. Is it impossible to delete them?
I can find the index using "db.system.indexes.findOne({"name": "username_1"}); but if I change that to:
db.system.indexes.deleteOne({"name": "username_1"}); then I get the error [thread1] TypeError: err.hasWriteErrors is not a function :
DBCollection.prototype.deleteOne@src/mongo/shell/crud_api.js:328:13

I know this isn't a Parse fault but if I can't delete the indexes I need to know a way around.
Thanks again

@flovilmart

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

You should use the dropIndex and not dropOne on indexes :) https://docs.mongodb.com/manual/reference/method/db.collection.dropIndex/

You cannot refer to the user tables as it has an _, but you can use db.getCollection(« _User »)

https://docs.mongodb.com/manual/reference/method/db.getCollection/

@BillyJohn3

This comment has been minimized.

Copy link
Author

commented Dec 9, 2018

Thank you! That worked a treat. I deleted the two indexes "email_1" and "username_1" and then made this change here as that was brought up as an error.

However I still can't log in. The log now only shows "starting Parse live query" but I still can't log in or sign up.. Any ideas?

@flovilmart

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

Not really, did you start the new version of the server? Can you provide the verbose logs?

@BillyJohn3

This comment has been minimized.

Copy link
Author

commented Dec 9, 2018

Yes I did. The verbose log inside: /parse-server-example/logs/parse-server.info.2018-12-09 is:
{"level":"info","message":"Parse LiveQuery Server starts running","timestamp":"2018-12-09T14:35:09.244Z"}
{"message":"Unable to ensure uniqueness for usernames: ","stack":"MongoError: Index with name: username_1 already exists with different options\n at /root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:581:63\n at authenticateStragglers (/root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:504:16)\n at Connection.messageHandler (/root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:540:5)\n at emitMessageHandler (/root/parse-server-example/node_modules/mongodb-core/lib/connection/connection.js:310:10)\n at Socket. (/root/parse-server-example/node_modules/mongodb-core/lib/connection/connection.js:489:15)\n at Socket.emit (events.js:182:13)\n at Socket.EventEmitter.emit (domain.js:441:20)\n at addChunk (_stream_readable.js:287:12)\n at readableAddChunk (_stream_readable.js:268:11)\n at Socket.Readable.push (_stream_readable.js:223:10)","ok":0,"errmsg":"Index with name: username_1 already exists with different options","code":85,"name":"MongoError","level":"warn","timestamp":"2018-12-09T14:35:10.307Z"}
{"message":"Unable to ensure uniqueness for user email addresses: ","stack":"MongoError: Index with name: email_1 already exists with different options\n at /root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:581:63\n at authenticateStragglers (/root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:504:16)\n at Connection.messageHandler (/root/parse-server-example/node_modules/mongodb-core/lib/connection/pool.js:540:5)\n at emitMessageHandler (/root/parse-server-example/node_modules/mongodb-core/lib/connection/connection.js:310:10)\n at Socket. (/root/parse-server-example/node_modules/mongodb-core/lib/connection/connection.js:489:15)\n at Socket.emit (events.js:182:13)\n at Socket.EventEmitter.emit (domain.js:441:20)\n at addChunk (_stream_readable.js:287:12)\n at readableAddChunk (_stream_readable.js:268:11)\n at Socket.Readable.push (_stream_readable.js:223:10)","ok":0,"errmsg":"Index with name: email_1 already exists with different options","code":85,"name":"MongoError","level":"warn","timestamp":"2018-12-09T14:35:10.320Z"}
{"level":"info","message":"Parse LiveQuery Server starts running","timestamp":"2018-12-09T14:59:07.945Z"}
{"level":"info","message":"Parse LiveQuery Server starts running","timestamp":"2018-12-09T15:00:53.405Z"}
{"level":"info","message":"Parse LiveQuery Server starts running","timestamp":"2018-12-09T15:06:31.138Z"}
{"level":"info","message":"Parse LiveQuery Server starts running","timestamp":"2018-12-09T15:07:46.868Z"}

Can I degrade my Parse server version - maybe that will sort it?

@flovilmart

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

This is the same issue, the indexes are still there, as stated in the logs, you should ensure the new indexes are properly created by the latest version.

@BillyJohn3

This comment has been minimized.

Copy link
Author

commented Dec 9, 2018

Sorry, no, the indexes bit is from before. Currently the only log being printed when I restart is the LiveQuerry one.

@flovilmart

This comment has been minimized.

Copy link
Contributor

commented Dec 9, 2018

So when you login, there is nothing logged at all? That doest not make any sense. Are other queries able to run? Can you provide the logs?

@stale

This comment has been minimized.

Copy link

commented Jan 23, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 23, 2019

@stale stale bot closed this Jan 31, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.