Closed DanielJRaine closed 8 years ago
If you set it up correctly, you should have a config variable in Heroku that has something to do with mongo. If so, what if that variable key?
If you don't know what I'm referring to, then you should revisit the deployment steps in issue #222
Yes, you'll need to make sure whatever heroku sets for your environment variable (the name of the variable) matches whatever the mongo config variable is in your code.
I have both my MONGODB_URI: mongodb://danieljley:SYBRgr33n@ds023425.mlab.com:23425/heroku_f7bkwspp
as well as a PROD_MONGODB: mongodb://danieljley:SYBRgr33n@ds023425.mlab.com:23425/heroku_f7bkwspp
config variables set up (depending on which guide you follow, it has you generate one or both of these config variables).
This repo does not have an issue #222. Which issue are you referring to?
The config variable in the express-api-template that was provided uses MONGOLAB_URI, but that does not match with what Heroku gave me when following its guides for mLab, so I commented out the MONGOLAB_URI and instead used the above MONGODB_URI whenever process.env is invoked to find my db URI.
Should I be using the config variable given to us in the template or the one that is generated by Heroku/mLab? (it's just a name, so it shouldn't matter as long as my Heroku config variables match with the code itself, but this was not covered in any deployment guide given to us or in the express-api-template, so I don't want to make too many assumptions)
I have followed the mLab documentation as far as using a Node Driver, but I am getting really confused at this part, because I don't know if the Node Driver (used to connect to my MongoDB instance) is something I need to add as a .js file into my code, or if it's something I just need to execute in a Node shell in Heroku, or something else. The Heroku Documentation only really goes over the Ruby example for setting up a driver to hook up to your Mongo database and it only provides not-very-useful references for using any other language (i.e., Node).
I keep getting these errors when I try to use the shell scripts provided at mLab's website (https://mlab.com/databases/bucket-list-api#users) :
To connect using the mongo shell:
mongo ds025742.mlab.com:25742/bucket-list-api -u <dbuser> -p <dbpassword>
To connect using a driver via the standard MongoDB URI (what's this?):
mongodb://<dbuser>:<dbpassword>@ds025742.mlab.com:25742/bucket-list-api
~ $ mongodb://danieljley:SYBRgr33n@ds025742.mlab.com:25742/bucket-list-api
bash: mongodb://danieljley:SYBRgr33n@ds025742.mlab.com:25742/bucket-list-api: No such file or directory
~ $ mongo ds025742.mlab.com:25742/bucket-list-api -u <dbuser> -p <dbpassword>
bash: syntax error near unexpected token `newline'
~ $ mongo
MongoDB shell version: 2.6.10
connecting to: test
>
bye
~ $ mongo ds025742.mlab.com:25742/bucket-list-api -u <dbuser> -p <dbpassword>
bash: syntax error near unexpected token `newline'
~ $ mongo ds025742.mlab.com:25742/bucket-list-api -u danieljley -p SYBRgr33n
MongoDB shell version: 2.6.10
connecting to: ds025742.mlab.com:25742/bucket-list-api
2016-10-18T09:09:41.524-0400 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1287
exception: login failed
This is way more than you should have to do. Please stop going further into the hole. You should be able to work with the linked resources. If it isn't possible, we should work on it together so we can record what we can improve in the future.
May I come find you to work through this?
That was a really dry way of saying "Let's work on this together: one of us may have goofed and I'm not sure who". So yeah, come by. I'll be in the classroom in a moment.
I would be more than happy to help write up a guide on this after the project is over if it means saving someone from this level of frustration in the future.
I believe we resolved this. @DanielJRaine feel free to add any notes here or at https://github.com/ga-wdi-boston/capstone-project/issues/222. Thanks!
I tried setting up MongoLab, but I don't know if I'm missing something because it keeps failing to connect to Mongo on the backend.
I tried going through all of the closed issues that have similar error messages, but no solution I found there seems to work.
Here are my Heroku Logs: