-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
handleUpdateToRevocableSession cause HTTP 500 error #2720
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
Thanks for reporting it, can you run with VERBOSE=1 so we can see what type of request is yielding that error? the auth.user should not be undefined as the case should be handled here: https://github.com/ParsePlatform/parse-server/blob/master/src/Auth.js#L89 |
Sure, I just run Parse server on my local host and I get the same issue with VERBOSE, see the log bellow. To recreate the issue I run my app with Anonymous connected to api.parse.com with commenting out the call for [PFUser enableRevocableSessionInBackground]; The I modified the app to point to my local Parse server and uncommenting the call - [PFUser enableRevocableSessionInBackground]; And I get the same error as we see with AWS. { |
Interestingly, the sessionToken is not set but yet, it goes through with it. That's odd... What's the response status from api.parse.com when calling that endpoint without a sessionToken? |
How can I see the response status from api.parse.com when calling that endpoint without a sessionToken? |
jUst run the same agains api.parse.com with https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/wiki/Network-Debug-Tool that will trace all requests/responses on your client |
Alright found it: {"code":101,"error":"invalid session"} |
working on a fix |
That is great. Does this error has any side effect on the client app? |
it should not, as it's the same as what api.parse.com would return |
As with the current version without the fix, that should not have any side effects. I'll try to get something released soon on npm |
@flovilmart thank you again. Do you have time estimate when your change will be released as part of 2.2.20? I tried the follow experiment without your fix as follows
|
Yes this is expected, the error will occur any time the call to that endpoint is made and the sessionToken is not set (anonymous user not saved, or no user at all). It's definitely gonna be part of 2.2.20, and I'm trying to setup a way so the master is easily usable thought the package.json without the npm link/submodules dance. |
Thank you for the clarification. |
Issue Description
I am using Parse server 2.2.19, and Parse client SDK 1.14.2 on iOS app.
Parse server is hosted on AWS using Elastic Beanstalk, where I have NGINX as load balancer, and Parse server running on EC2. The mongoDB is hosted in mLab.
I had an iOS app that connected to api.parse.com that did not used revokable session.
We released a new version of the app that is now connected to Parse Served, and we call from the app the following code -
[Parse initializeWithConfiguration:[ParseClientConfiguration configurationWithBlock:^(id configuration) {
configuration.applicationId = @"XXXXXX";
configuration.clientKey = @"YYYY";
}]];
[PFUser enableRevocableSessionInBackground];
Now I get every few minutes the following warning from AWS with the following-
Message: Environment health has transitioned from Ok to Warning. 100.0 % of the requests are failing with HTTP 5xx.
Steps to reproduce
Call [PFUser enableRevocableSessionInBackground].
Expected Results
Calling enableRevocableSessionInBackground should not generate any 500 errors.
Actual Outcome
Calling enableRevocableSessionInBackground should generate any 500 errors.
Environment Setup
Logs/Trace
/var/log/nginx/access.log
172.31.57.70 - - [17/Sep/2016:13:30:54 +0000] "PUT /server/classes/_Installation/cVDvKNxn7j HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "107.77.223.68"
172.31.57.70 - - [17/Sep/2016:13:32:25 +0000] "PUT /server/classes/_Installation/O0gdCix8pw HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/808.0.2 Darwin/16.0.0" "108.7.56.162"
172.31.18.53 - - [17/Sep/2016:13:32:28 +0000] "PUT /server/classes/_Installation/pegHJd1ULm HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/808.0.2 Darwin/16.0.0" "64.30.72.169"
172.31.18.53 - - [17/Sep/2016:13:32:39 +0000] "PUT /server/classes/_Installation/h58cNPGdqL HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/808.0.2 Darwin/16.0.0" "107.77.226.213"
172.31.57.70 - - [17/Sep/2016:13:32:40 +0000] "PUT /server/classes/_Installation/WtscPBtEM2 HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "75.68.90.83"
172.31.18.53 - - [17/Sep/2016:13:32:42 +0000] "PUT /server/classes/_Installation/5vs215XGgF HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "174.192.24.110"
172.31.57.70 - - [17/Sep/2016:13:33:07 +0000] "PUT /server/classes/_Installation/j2fvZhFU5K HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/808.0.2 Darwin/16.0.0" "74.104.123.65"
172.31.57.70 - - [17/Sep/2016:13:33:21 +0000] "POST /server/classes/SessionViewing HTTP/1.1" 201 64 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "71.232.78.165"
172.31.57.70 - - [17/Sep/2016:13:33:21 +0000] "PUT /server/classes/_Installation/pktZIdC2Jv HTTP/1.1" 200 86 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "71.232.78.165"
172.31.57.70 - - [17/Sep/2016:13:33:22 +0000] "PUT /server/classes/_Installation/pktZIdC2Jv HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "71.232.78.165"
172.31.18.53 - - [17/Sep/2016:13:33:53 +0000] "PUT /server/classes/_Installation/IEn1vQQg3e HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/808.0.2 Darwin/16.0.0" "174.192.29.227"
172.31.57.70 - - [17/Sep/2016:13:34:10 +0000] "POST /server/upgradeToRevocableSession HTTP/1.1" 500 45 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "66.87.124.62"
172.31.57.70 - - [17/Sep/2016:13:34:10 +0000] "GET /server/config HTTP/1.1" 200 2821 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "66.87.124.62"
172.31.57.70 - - [17/Sep/2016:13:34:12 +0000] "PUT /server/classes/_Installation/yUNydcAcTu HTTP/1.1" 200 71 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "66.87.124.62"
172.31.18.53 - - [17/Sep/2016:13:34:43 +0000] "POST /server/events/AppOpened HTTP/1.1" 200 2 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "108.26.217.154"
172.31.18.53 - - [17/Sep/2016:13:34:43 +0000] "GET /server/config HTTP/1.1" 200 2821 "-" "MyAppName/510 CFNetwork/758.5.3 Darwin/15.6.0" "108.26.217.154"
/var/log/nodejs/nodejs.log
�[31merror�[39m: Error handling request: [TypeError: Cannot read property 'id' of undefined]
�[31merror�[39m: Uncaught internal server error. [TypeError: Cannot read property 'id' of undefined] TypeError: Cannot read property 'id' of undefined
at SessionsRouter.handleUpdateToRevocableSession (/var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:109:25)
at /var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:154:23
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:259:9
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:295:9
at Layer.handle as handle_request
at next (/var/app/current/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/app/current/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /var/app/current/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/app/current/node_modules/express/lib/router/index.js:330:12)
TypeError: Cannot read property 'id' of undefined
at SessionsRouter.handleUpdateToRevocableSession (/var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:109:25)
at /var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:154:23
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:259:9
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:295:9
at Layer.handle as handle_request
at next (/var/app/current/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/app/current/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /var/app/current/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/app/current/node_modules/express/lib/router/index.js:330:12)
�[31merror�[39m: Error handling request: [TypeError: Cannot read property 'id' of undefined]
�[31merror�[39m: Uncaught internal server error. [TypeError: Cannot read property 'id' of undefined] TypeError: Cannot read property 'id' of undefined
at SessionsRouter.handleUpdateToRevocableSession (/var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:109:25)
at /var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:154:23
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:259:9
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:295:9
at Layer.handle as handle_request
at next (/var/app/current/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/app/current/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /var/app/current/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/app/current/node_modules/express/lib/router/index.js:330:12)
TypeError: Cannot read property 'id' of undefined
at SessionsRouter.handleUpdateToRevocableSession (/var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:109:25)
at /var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:154:23
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:259:9
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:295:9
at Layer.handle as handle_request
at next (/var/app/current/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/app/current/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /var/app/current/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/app/current/node_modules/express/lib/router/index.js:330:12)
�[31merror�[39m: Error handling request: [TypeError: Cannot read property 'id' of undefined]
�[31merror�[39m: Uncaught internal server error. [TypeError: Cannot read property 'id' of undefined] TypeError: Cannot read property 'id' of undefined
at SessionsRouter.handleUpdateToRevocableSession (/var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:109:25)
at /var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:154:23
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:259:9
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:295:9
at Layer.handle as handle_request
at next (/var/app/current/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/app/current/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /var/app/current/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/app/current/node_modules/express/lib/router/index.js:330:12)
TypeError: Cannot read property 'id' of undefined
at SessionsRouter.handleUpdateToRevocableSession (/var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:109:25)
at /var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:154:23
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:259:9
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:295:9
at Layer.handle as handle_request
at next (/var/app/current/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/app/current/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /var/app/current/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/app/current/node_modules/express/lib/router/index.js:330:12)
�[31merror�[39m: Error handling request: [TypeError: Cannot read property 'id' of undefined]
�[31merror�[39m: Uncaught internal server error. [TypeError: Cannot read property 'id' of undefined] TypeError: Cannot read property 'id' of undefined
at SessionsRouter.handleUpdateToRevocableSession (/var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:109:25)
at /var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:154:23
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:259:9
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:295:9
at Layer.handle as handle_request
at next (/var/app/current/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/app/current/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /var/app/current/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/app/current/node_modules/express/lib/router/index.js:330:12)
TypeError: Cannot read property 'id' of undefined
at SessionsRouter.handleUpdateToRevocableSession (/var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:109:25)
at /var/app/current/node_modules/parse-server/lib/Routers/SessionsRouter.js:154:23
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:259:9
at /var/app/current/node_modules/parse-server/lib/PromiseRouter.js:295:9
at Layer.handle as handle_request
at next (/var/app/current/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/var/app/current/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /var/app/current/node_modules/express/lib/router/index.js:277:22
at Function.process_params (/var/app/current/node_modules/express/lib/router/index.js:330:12)
The text was updated successfully, but these errors were encountered: