Skip to content
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

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

Closed
WahdanZ opened this issue Feb 2, 2016 · 10 comments
Closed

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

WahdanZ opened this issue Feb 2, 2016 · 10 comments

Comments

@WahdanZ
Copy link

WahdanZ commented Feb 2, 2016

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
Copy link
Author

WahdanZ commented Feb 3, 2016

i create new site and it work

@ghost
Copy link

ghost commented Feb 3, 2016

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

@krhebbar
Copy link

krhebbar commented Feb 3, 2016

@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

@tiraeth
Copy link

tiraeth commented Feb 3, 2016

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

@belakva
Copy link

belakva commented Feb 4, 2016

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

@tiraeth
Copy link

tiraeth commented Feb 4, 2016

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');

@belakva
Copy link

belakva commented Feb 4, 2016

@tiraeth thanks, solved!

@mahabubakram
Copy link

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 ?

@belakva
Copy link

belakva commented Feb 4, 2016

@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)

@WahdanZ WahdanZ closed this as completed Feb 7, 2016
@gateway
Copy link

gateway commented Feb 9, 2016

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$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants