-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Error setting TTL index on collection : sessions #85
Comments
Hmmm, this error still appears for me? Just scaffolded out the app, set the DB to my MongoHQ one Edit: Oh super weird, for me the fix was actually removing the commit. I might just have a wonky setup somewhere in this or something. |
@chrisdhanaraj Could you try adding
to the mongoStore configuration? There are reports of that fixing this issue as well. |
Yeah, that's actually the first thing I tried - still the same error. Removing the callback was what fixed it for me |
This error is still appearing for me. I tried with the callback and without it. I've also tried adding |
I'm seeing it pop up also, in dev mode, while running |
First off, great work on the generator :) I'm getting this when I run tests. All the tests pass, but I get this error at the start of the test run. I'm running this on a Macbook with a SSD disk, so maybe the tests run faster than the database connection (just guessing). Tried adding the auto_reconnect parameter to no avail. |
I did some tests, I seem to have solved the issue by starting the server once the session store was ready. I modified the last lines of server.js to look like this
And I also commented the session store code out of express.js. I don't know whether this is the optimal solution but it did the trick for me, I managed to run tests on mongodb without getting the TTL error. @davisford Update: While this will fix the testing issues, I noticed that this will cause authentication issues in the client (random 401 replies from the server) causing the application not to work properly. Sorry about that. |
Also, turns out my real issue was specific to testing. Talk about deja vu, I found my own thread http://stackoverflow.com/questions/22582648/node-js-mocha-unit-testing-error-re-mongoose-mocks-with-mockgoose-error-setti |
This is still happening for me. I could not figure out how to fix. |
Please post if you experience this error. Also, try adding this callback to your express session and see if that solves the issue.
This possible solution was mentioned here: jdesboeufs/connect-mongo#58 (comment)
The text was updated successfully, but these errors were encountered: