-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Migrating to mLab + Google App Engine #3247
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
Comments
@HoraceBury can you post your server.js code |
I'm actually trying to host the example: https://github.com/ParsePlatform/parse-server-example But the index.js from that is, of course, very similar to the server.js, so here it is (slightly obfuscated):
|
@HoraceBury in mlab.com did you create a user for your database? Not the mlab login, but a user for that specific database you created in mlab? |
Yes, in the connection string where it says "mongodb://username:password" those are actually my DB's credentials. When connecting from my local machine with the mongo shell that connStr is fine. Which is why I think I'm missing something in the overall process. |
if (!databaseUri) {
console.log('DATABASE_URI not specified, falling back to localhost.');
} // Try and log the databaseURI here with the else statement |
Yep, absolutely no worry about the connStr reaching the ParseServer constructor. Am I correct in thinking that the connection string is the only thing the ParseServer needs to be able to connect to the mLab database? |
I have even tried to very straightforward and simple directions here: https://github.com/ParsePlatform/parse-server/wiki/Quick-Start This does not work either. Is there a security permission which needs to be set or provided? |
To be honest I'm stumped, I never encountered this before. Will update if I figure out a possible cause. |
How do I specify nodeserver.js on the command line? The Quick Start doesn't mention that but does guide on how to run the server from a single CLI command. |
@HoraceBury thats how I run my local server. i just navigate to the folder where my server.js file is and type |
When you do that are you running it against a DB on mLab? |
From the error log: {"error":{"code":200,"message":"bad or missing username"},"level":"error","message":"Error generating response. ParseError { code: 200, message: 'bad or missing username' }","timestamp":"2016-12-16T20:56:06.156Z"} I'm not sure which username that is referring to. It can't be the MongoDB database username as that is included in the connection string. |
@HoraceBury can you try two things. |
My database user is not read-only. I am only using the databaseUri. Same result - this is what I've been doing since the start. |
When I configure server.js with the credentials and run it with 'node server.js' the response in postman includes this in the header: X-Powered-By →Express The body is: I'm running this under: /nodejs-docs-samples/appengine/parse-server The full server.js (lightly obfuscated) is this: /**
'use strict'; // [START app] nconf.argv().env().file({ file: 'config.json' }); const app = express(); const parseServer = new ParseServer({ // Mount the Parse API server middleware to /parse app.get('/', (req, res) => { const PORT = process.env.PORT || 8080; |
My local firewall is off and as mentioned connecting to mLab db via the Mongo CLI works fine. |
Hitting http://localhost:8080/parse in a browser gets me: The above response in postman is achieved using the X-Parse-Application-Id and X-Parse-Master-Key headers with the values from the server.js above. |
Does your username or password for mLab contains special characters? Like :, @,; etc... |
Nope, it is simply: |
I am even trying to go through this tutorial to get a new local instance of Parse setup, pointing at a new, empty DB on mLab: https://www.raywenderlich.com/128313/parse-server-tutorial I'm running into the authentication problem, here, because (with a new Parse and new DB) I don't have an application ID or master key. |
You can use any random string for applicationId and masterKey, keep your masterKey private, never share it |
But does the mLab DB care about that or is it just for use between the client and Parse? |
I have managed to get Parse on App Engine and mLab working, and I thought I maybe able to help but nothing stands out. I remember serverURL causing me some issues. Is it set to https://localhost:1337/parse? Try http rather than https. |
@Muesly good call, @HoraceBury I see you are using environment variables, can you confirm that your databaseURI: databaseUri && process.env.SERVER_URL are correctly formatted? Both in server and client. Your server URL should have ... |
@muesely Yes, the serverURL is set to exactly that. |
Try http? |
@otymartin I can confirm that the config.json and server.js are the same and in correct format. When I connect to the database from the CLI I get this message:
I am using the latest version of mongo on my local box. The mongo shell lets me execute commands against the mLab DB. Could there be something I am missing, like needing to downgrade to a previous version of the shell? Seems odd that the latest version of Mongo Shell and mLab are mismatched. |
Both config.json and server.js are set up for http. |
@Muesly @otymartin Would one of you be prepared to Skype with me on this, please? I know, it's a big ask, but it would be hugely helpful. (Sorry to ask!) |
Sure, happy to help if I can :) |
Yea go with @Muesly if he can't i'll give it a go. But if you find a problem & solution please document it here for future reference |
Thank you guys, I really appreciate it. I'm incommunicado for the next 24hrs at least as I'm travelling but if you're about Friday my Skype is my username on here. |
Uh oh!
There was an error while loading. Please reload this page.
I have followed the instructions at https://parse.com/migration#server but I cannot get my local Parse instance to connect to my mLab database. I'm using the mongodb connection string with appropriate username and password. I can also get my local dashboard to talk to my local mongo instance via the local Parse server, but not the mLab.
Is there a step missing or some security element I might be missing?
(Sorry for the vagueness!)
The text was updated successfully, but these errors were encountered: