parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

Verify Running Parse Server

Open spiderguy84 opened this issue 10 years ago • 11 comments

According to Parse Migration guides, after I get the server up and going I need to verify that it is working, they say this:

VERIFICATION

Make sure saving an object and retrieving it via a query works:

curl -X POST
-H "X-Parse-Application-Id: YOUR_APP_ID"
-H "Content-Type: application/json"
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}'
http://localhost:1337/parse/classes/GameScore

curl -X GET
-H "X-Parse-Application-Id: YOUR_APP_ID"
-H "X-Parse-Master-Key: YOUR_APP_MASTER_KEY"
http://localhost:1337/parse/classes/GameScore

My only issue is that I'm not sure exactly where to run this from. Do I do it from the same terminal window after I start mongo, or do I run it from same terminal window after starting npm? Where I have tried running it before, I get this error:

-H "X-Parse-Application-Id": "fritchChurch"
2016-10-06T10:23:11.818-0500 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:3

-H "Content-Type": "application/json"
2016-10-06T10:23:11.819-0500 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:3

-d '{"HerCell":1337, "title":"Sean Plott", "address":false}'
2016-10-06T10:23:11.821-0500 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:3

spiderguy84 avatar Oct 06 '16 17:10 spiderguy84

I saw in your index.js that your app id was Fritch Church of Christ

Try in this way (one liner):

curl -X POST -H "X-Parse-Application-Id: YOUR_APP_ID" -H "Content-Type: application/json" -d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' http://localhost:1337/parse/classes/GameScore

mignev avatar Oct 06 '16 17:10 mignev

Ok, I tried that and didn't get any errors, but I also don't know if it was successful. It didn't add it to the mLab mongodb that is set up, but I'm not honestly sure if it was supposed to.

spiderguy84 avatar Oct 06 '16 18:10 spiderguy84

Take a look is there new record in GameScore class/collection :) via MongoChef

mignev avatar Oct 06 '16 18:10 mignev

I opened up the Mongo collection and nothing new

spiderguy84 avatar Oct 06 '16 18:10 spiderguy84

Try with the right X-Parse-Application-Id.

Btw if you run the curl with -I argument will return response headers you you'll can debug easier :)

mignev avatar Oct 06 '16 18:10 mignev

I tried making change to correct ID, and running curl -I but it still didn't work and no headers came up. Only thing I did notice is when I ran mondog, I got this:

2016-10-06T13:34:53.189-0500 E NETWORK [initandlisten] listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017 2016-10-06T13:34:53.189-0500 E NETWORK [initandlisten] addr already in use 2016-10-06T13:34:53.189-0500 E STORAGE [initandlisten] Failed to set up sockets during startup. 2016-10-06T13:34:53.189-0500 I CONTROL [initandlisten] dbexit: rc: 48

spiderguy84 avatar Oct 06 '16 18:10 spiderguy84

Yes you are trying to run another MongoDB with port 27017 :) You should stop the other mongo ;)

mignev avatar Oct 06 '16 18:10 mignev

I just don't know where the other MongoDB is being ran from. Just booted up computer, went into Terminal and ran mongod, didn't do another thing.

spiderguy84 avatar Oct 06 '16 18:10 spiderguy84

Ok, I found the process killed it, and mongod now shows:

[initandlisten] waiting for connections on port 27017 2016-10-06T13:45:06.821-0500 I NETWORK [initandlisten] connection accepted from 127.0.0.1:56401 #1 (1 connection now open)

I then run the curl, but get nothing, including no headers. I am running:

curl -X -I POST -H "X-Parse-Application-Id:APPID" -H "Content-Type: application/json" -d '{"HerCell":1337,"title":"Sean Plott","address":321}' http://localhost:1337/parse/classes/FritchDirectory

spiderguy84 avatar Oct 06 '16 18:10 spiderguy84

Your APPID is "Fritch Church of Christ", right? Try replacing APPID with "Fritch Church of Christ" in the command above.

chesterhawkins avatar Oct 06 '16 18:10 chesterhawkins

Ok, I had a typo in the App ID, so I fixed that, and then tried it again. Finally got some feedback:

[HostnameCanonicalizationWorker] Failed to obtain name info for: [ (10.0.1.8, "nodename nor servname provided, or not known"), (10.0.1.8, "nodename nor servname provided, or not known") ]

spiderguy84 avatar Oct 06 '16 19:10 spiderguy84