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

{"code":1,"message":"Internal server error."}

Open WahdanZ opened this issue 10 years ago • 10 comments

i get this when i try curl post or get {"code":1,"message":"Internal server error."} ex : for get curl -X GET
-H "X-Parse-Application-Id:XXXXXXXXXXXXXXXXXXXXX"
-H "X-Parse-Master-Key: XXXXXXXXXXXX"
http://XXXXXXX.azurewebsites.net/parse/classes/user

ex for post curl -X POST
-H "X-Parse-Application-Id: XXXXXXXXXXXXXXXX"
-H "Content-Type: application/json"
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}'
http://XXXXXXX.azurewebsites.net/parse/classes/GameScore *when it try post it notice that the "GameScore" class create but no data on it * and when it try on android sdk i get this log V/com.parse.ParseRequest: Request failed. Waiting 5020 milliseconds before attempt #3

WahdanZ avatar Feb 02 '16 13:02 WahdanZ

i create new site and it work

WahdanZ avatar Feb 03 '16 04:02 WahdanZ

I get the same thing when going to classes/_User and attempting to POST a new user:

Body : { "code": 1, "message": "Internal server error." }

When I look in the parse-server logs, I am getting:

Uncaught internal server error. bad obj: undefined undefined

ghost avatar Feb 03 '16 05:02 ghost

@WahdanZ in node_modules/parse/lib/node/CoreManager.js make sure SERVER_URL will be pointing to https://api.parse.com/1 by default You need to point it to your server. That fixed the issue for me

ravikanchikare avatar Feb 03 '16 13:02 ravikanchikare

Also, on my end, problem was with express version. I had 3.x with the project originally ;-)

tiraeth avatar Feb 03 '16 14:02 tiraeth

@tiraeth could you, please, provide some details? I had to update Parse SDK to use Parse Server, and now I get the same error.

belakva avatar Feb 04 '16 10:02 belakva

If you use express 3.x in the project, you need to create app for Parse Server using 4.x version that is available under the module's node_modules folder.

Instead of:

var express = require('express');

Use:

var express = require('parse-server/node_modules/express');

tiraeth avatar Feb 04 '16 11:02 tiraeth

@tiraeth thanks, solved!

belakva avatar Feb 04 '16 11:02 belakva

var userLayer = Parse.Object.extend("Types"); var userQuery = new Parse.Query(userLayer); userQuery.find({ success: function(objects){ console.log(objects); }, error: function(err){ console.log(err) } })

when I try to do the same thing using JS SDK it gives me the error.

How to solve this ?

mahabubakram avatar Feb 04 '16 12:02 mahabubakram

@mahabubakram check server logs, to get more details of why the error takes place. if running Heroku, heroku logs --app <name> (e.g. safe-sea-666-999)

belakva avatar Feb 04 '16 12:02 belakva

EDIT:.. found my stoopid issue, in cut and paste of the request the quotes changed from " to “ in the where clause..

curl -X GET \
  -H "X-Parse-Application-Id: XXXXXXXXXXXXXXXXXX" \
  -H "X-Parse-REST-API-Key: XXXXXXXXXXXXXXXXXX" \
  -H "X-Parse-Master-Key: XXXXXXXXXXXXXXXXXX" \
  -G \
  --data-urlencode 'where={"GamelID":"afcd60f2-f9b2-4c5f-9148-1de46713552b"}' \
  https://xxxxxx.herokuapp.com/parse/classes/UserTag


I just ran into this error when trying to do a CURL GET request to return an object..

CURL request

curl -X GET \
  -H "X-Parse-Application-Id: XXXXXXXXXXXXXXXXXX" \
  -H "X-Parse-REST-API-Key: XXXXXXXXXXXXXXXXXX" \
  -H "X-Parse-Master-Key: XXXXXXXXXXXXXXXXXX" \
  -G \
  --data-urlencode 'where={“gameID”:”afcd60f2-f9b2-4c5f-9148-1de46713552b"}' \
  https://xxxxxx.herokuapp.com/parse/classes/UserTag

In Heroku I'm seeing this in the logs..

2016-02-09T19:23:29.626360+00:00 heroku[router]: at=info method=GET path="/parse/classes/UserTag?where=%7B%E2%80%9CgameD%E2%80%9D%3A%E2%80%9Dafcd60f2-f9b2-4c5f-9148-1de46713552b%22%7D" host=xxxx.herokuapp.com request_id=08495dd3-9a48-4518-bb0c-73a3d910d888 fwd="12.215.39.106" dyno=web.1 connect=0ms service=10ms status=500 bytes=358
2016-02-09T19:23:29.581339+00:00 app[web.1]: Uncaught internal server error. [SyntaxError: Unexpected token “] SyntaxError: Unexpected token “
2016-02-09T19:23:29.581343+00:00 app[web.1]:     at Object.parse (native)
2016-02-09T19:23:29.581344+00:00 app[web.1]:     at handleFind (/app/node_modules/parse-server/classes.js:38:23)
2016-02-09T19:23:29.581345+00:00 app[web.1]:     at /app/node_modules/parse-server/PromiseRouter.js:97:7
2016-02-09T19:23:29.581346+00:00 app[web.1]:     at Layer.handle [as handle_request] (/app/node_modules/parse-server/node_modules/express/lib/router/layer.js:95:5)
2016-02-09T19:23:29.581347+00:00 app[web.1]:     at next (/app/node_modules/parse-server/node_modules/express/lib/router/route.js:131:13)
2016-02-09T19:23:29.581348+00:00 app[web.1]:     at Route.dispatch (/app/node_modules/parse-server/node_modules/express/lib/router/route.js:112:3)
2016-02-09T19:23:29.581349+00:00 app[web.1]:     at Layer.handle [as handle_request] (/app/node_modules/parse-server/node_modules/express/lib/router/layer.js:95:5)
2016-02-09T19:23:29.581351+00:00 app[web.1]:     at param (/app/node_modules/parse-server/node_modules/express/lib/router/index.js:349:14)
2016-02-09T19:23:29.581350+00:00 app[web.1]:     at /app/node_modules/parse-server/node_modules/express/lib/router/index.js:277:22
2016-02-09T19:23:29.581351+00:00 app[web.1]:     at param (/app/node_modules/parse-server/node_modules/express/lib/router/index.js:365:14)
gatewaysmacpro:parse-server-example gateway$ 

gateway avatar Feb 09 '16 19:02 gateway