-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Can't create an admin user in MongoDB #261
Comments
Have you modified that config at https://github.com/angular-app/angular-app/blob/master/server/config.js If so then make sure that you have provided a valid URL to MongoLab. Please be aware that MongoLab is not the same as hosting your own MongoDB. |
I changed apiKey and dbName as instructed. dbUrl is https://api.mongolab.com/api/1 (no changes). I assumed - probably, incorrectly - that apiKey will direct to my instance of MongoDB (similar to Amazon's S3, for example). You refer to "a valid URL to MongoLab". Not sure what it is (and can't find it in the instructions)... The hint window above my database says the following: None of them is https... and since the problem is in creating the very first user - I am not sure how I would use it. Again, apologize for these seemingly trivial questions; it's a little frustrated to spend so much effort on MongoDB that is quite marginal to the topic of the book itself... UPDATE: Once I created a user manually, I am able to connect from the shell (via "mongo" command). So, back to my original doubt - manual user has name/password/read-only flag. The user in the script has email/password/admin/first/last name. Is this discrepancy intentional? |
Does the application work if you leave the config file intact and use the provided MongoLab DB? |
By the way, the password that we are creating with initDB.js is specific to the Scrum app and nothing to do with MongoDB users, which are used to connect to the database. |
No - it gives me "invalid login or password" interesting... when I added trailing slash to url (that is, https://api.mongolab.com/api/1/ ) - it worked. weird, because the output on the screen is rest.post - https://api.mongolab.com/api/1//databases/angular/collections/users/ (with 2 slashes after 1). But now it works - and I can get to follow the Angular contents... which is what I bought the book for in the first place :) Thanks again, and I love the book! |
Great. Sorry it took so long. Glad you are up and running |
UPDATE: And just for testing, I put back URL without trailing slash, changed the user email (since it looks like it checks for duplicates - and got the same error as before. But slash back in - and created a second user!
Now I get it - I see collection called "users" in the database with JSON documents representing two Scrum users that I created... |
Thank you. adding the '/' at the end of 'https://api.mongolab.com/api/1' worked for me too. |
I am constantly getting this error "Error: Please provide a valid API key." I have tried all the solutions mentioned here but nothing seems to be working, may I please request some help here. |
Hey @anujmca ! Login to Mongolabs, and go to the following page: This is the page where you can check your API key and generate a new one. At the bottom of the page, click "Enable Data API access". I had a similar problem like you and this solved it for me. I also generated a new API key after enabling, this is probably not necessary. Hope this helps! |
@anujmca - I never got the error you got, and the solution that worked for me was to add trailing slash. Look - I don't mind you hijacking this thread two years later with completely irrelevant question, but if you were to create a separate thread for your question, you may have got more responses. |
Solution by "hubaloo" worked, it was "Enable Data API access" which did the trick. Thank you. |
Yes, "Enable Data API access" and it will work. Otherwise it throws "Error: Please provide a valid API key." |
I had this problem connecting on an Android device and found that it was the encoding of the parameters handy function ` URL urlToRequest = new URL(uri); |
I am following the readme instructions, and everything goes fine until I reach "Run our initialization script to initialize the database with a first admin user" step in configure server section. I am getting the following error when I run server/initDB.js:
...
Created new admin user...
{ [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }
undefined
This is my first experience with MongoDB, so I am probably missing something obvious; however...
When I create a user from Mongo console, it asks for id, password and whether it is a read-only account. Very different from email / admin / etc. that is passed in initDB script.
I created an account manually; however, logging in through SCRUM app gives me "wrong name/password" error.
The text was updated successfully, but these errors were encountered: