Skip to content

Cloud Job unexpected error kills server #3270

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

Closed
ascholz81 opened this issue Dec 21, 2016 · 4 comments
Closed

Cloud Job unexpected error kills server #3270

ascholz81 opened this issue Dec 21, 2016 · 4 comments

Comments

@ascholz81
Copy link

While testing and updating some functionality in a Cloud JOB for our migration I mistyped and created an error:
TypeError: Cannot read property 'createToken' of undefined

Very simple. I need to fix my typo.

The REAL issue is that the parse-server's node process DIED.

I moved the same code to a Cloud Function and simply received a 500 internal server error. (Expected for the typo and reasonable. The server lives and continues serving requests.) I would expect the same behavior for a Job.

Steps to reproduce

Please include a detailed list of steps that reproduce the issue. Include curl commands when applicable.

Place this code in your main.js cloud code file.

Parse.Cloud.job("testBadJob", function(request, response){
    var myObj = undefined;
    //Attempt to access undefined value
    var abc = myObj.shouldHaveValue;
    response.success();
});

Parse.Cloud.define("testBadFunction", function(request, response){
    var myObj = undefined;
    //Attempt to access undefined value
    var abc = myObj.shouldHaveValue;
    response.success();
});

Expected Results

The Job should fail and the server should not exit. A 500 or any other error response would be sufficient.

The Cloud function should fail and not kill the server.

Actual Outcome

The Job fails and kills the server process.

The Cloud function fails and does NOT kill the server.

Environment Setup

  • Server

    • parse-server version: 2.3.1
    • Operating System: AWS Linux and Win 10
    • Hardware: standard
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Both
      AWS - 64bit Amazon Linux 2016.09 v3.2.0 running Node.js
      Localhost - Windows 10; node 6.9.1;
  • Database

    • MongoDB version: 3.2.11
    • Storage engine: MMAPv1
    • Hardware: not sandbox
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab

Logs/Trace

/var/app/current/node_modules/parse-server/lib/ParseServer.js:437
throw err;
^

TypeError: Cannot read property 'shouldHaveValue' of undefined
at /var/app/current/cloud/main.js:1198:20
at /var/app/current/node_modules/parse-server/lib/Routers/FunctionsRouter.js:106:11
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)

@emkman
Copy link

emkman commented Jan 24, 2017

@ascholz81 In case this is still an issue for you, Cloud Jobs aren't supported in parse-server. See https://github.com/ParsePlatform/parse-server/wiki/Compatibility-with-Hosted-Parse#jobs

@ascholz81
Copy link
Author

I understand Jobs themselves aren't scheduled, however they can still be ran and used on demand.

The main issue here is that whether it was a Job or Cloud Function that the Parse Server did not return from that call with any response or error.

@dplewis
Copy link
Member

dplewis commented Mar 23, 2018

Closing as addressed #3431

Please update to the latest version of Parse Server and open an issue if the issue still persists.

@dplewis dplewis closed this as completed Mar 23, 2018
@ascholz81
Copy link
Author

Fantastic!!! Thanks so much. Had a busy start to my year and didn't realize the previous comment in January. Will check it out next week and implement new version.

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

3 participants