Skip to content

handleUpdateToRevocableSession cause HTTP 500 error #2720

Closed
@mmarshak

Description

@mmarshak

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";

configuration.server = @"ZZZZ ";

configuration.localDatastoreEnabled = YES ;

}]];

[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

  • Server
    • parse-server version (Be specific! Don't say 'latest'.) : 2.2.19
    • Operating System: ubuntu
    • Hardware: NGINX , EC2
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): AWS
  • Database
    • MongoDB version: 3.0.x
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions