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

Setting data to undefined using postgres causes parse server to crash #5065

Closed
ben-eb opened this issue Sep 19, 2018 · 9 comments
Closed

Setting data to undefined using postgres causes parse server to crash #5065

ben-eb opened this issue Sep 19, 2018 · 9 comments

Comments

@ben-eb
Copy link
Contributor

ben-eb commented Sep 19, 2018

Issue Description

When updating an existing record, sending the value undefined will cause parse-server to crash, but when the value is null, it's OK.

I traced the problem down to these locations:

I would expect the simple fix would be to do this instead:

if (fieldValue === null || fieldValue === undefined) {
  // ...
}

Steps to reproduce

  1. Create a record with a value set.
  2. Save this record again with your value as undefined.

Expected Results

Parse should not throw an exception on undefined values.

Actual Outcome

Parse is throwing an exception when saving undefined values.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.7.2 (although this exists in v3 also)
    • Operating System: Ubuntu (running via VM)
    • Hardware: 2017 MacBook Pro
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): VirtualBox environment.
  • Database

    • Version: 9.6.8
    • Storage engine: Postgres
    • Hardware: 2017 MacBook Pro
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): VirtualBox environment.

Logs/Trace

App 8128 stderr: TypeError: Cannot read property '__op' of undefined
App 8128 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1104:29)
App 8128 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 8128 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 8128 stderr:     at <anonymous>
App 8128 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)

Is there any support still for the v2 releases? We're still relying on these for production instances - backporting a fix would be most welcomed.

@flovilmart
Copy link
Contributor

Thanks for reporting the issue.

We encourage you to migrate to version 3.0. In the meantime, I’m not sure how you are sending undefined. To remove a value use the {_op: Delete} instead.

@flovilmart
Copy link
Contributor

Can you provide a request example with the undefined in it?

@ben-eb
Copy link
Contributor Author

ben-eb commented Sep 19, 2018

@flovilmart The unusual thing is that I'm not saving the undefined with my object; the code looks something like this:

const Question = Parse.Object.extend('Question')

const save = (request, response) => {
  return Promise.resolve(request.params.id)
    .then(id => id ? new Parse.Query(Question).get(id) : new Question())
    .then(question => {
      question.set(request.params);
      return question.save();
    })
    .then(question => response.success(question))
}

I checked which parameters that Parse was trying to save and it seems like it was trying to merge the existing object (which had an undefined value) with the new properties that I defined (all of these have truthy values).

@flovilmart
Copy link
Contributor

Can you provide the logs when running with VERBOSE=1?

@ben-eb
Copy link
Contributor Author

ben-eb commented Sep 20, 2018

@flovilmart I think I found my issue, the property was being set in a before save hook; I added an extra guard to that to ensure that the transform only applies when the property is a string type. That resolves my issue, so I don't think Parse is trying to save undefined properties, it was user error in this case. 😃

Still I think it would be good to handle undefined in the same way as null to avoid this kind of problem in the future - saving a property as undefined using mongodb works fine.

@flovilmart
Copy link
Contributor

But undefined should not reach mongodb, the ‘undefined’ type is not supported by Parse server. Only the delete operator is. Can you write the test that shows the error pleaee? Because I still cannot understand why undefined reached the server while all payloads are serialized via JSON which strips undefined.

Also, please provide the logs when running with VERBOSE.

@ben-eb
Copy link
Contributor Author

ben-eb commented Sep 20, 2018

@flovilmart Sure thing, it's easily reproducible with this handler:

Parse.Cloud.beforeSave('Question', (request, response) => {
  request.object.set('crash', undefined);

  return response.success(request.object)
});

Output:

App 7254 stdout: verbose: REQUEST for [PUT] /parse/classes/Question/3gF0DAgzLk: {
App 7254 stdout:   "title": "Hello!"
App 7254 stdout: } method=PUT, url=/parse/classes/Question/3gF0DAgzLk, connection=close, user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36, accept=*/*, accept-language=en-GB,en-US;q=0.9,en;q=0.8, origin=http://192.168.209.2, content-length=220, accept-encoding=gzip, deflate, host=192.168.209.2, content-type=text/plain, referer=http://192.168.209.2/dashboard/apps/app/browser/Question, x-forwarded-for=192.168.209.1, !~passenger-client-address=192.168.209.1, title=Hello!
App 7254 stdout: info: beforeSave triggered for Question for user undefined:
App 7254 stdout:   Input: {"createdAt":"2018-09-20T11:47:36.635Z","updatedAt":"2018-09-20T11:47:36.635Z","title":"Hello!","objectId":"3gF0DAgzLk"}
App 7254 stdout:   Result: {"object":{"title":"Hello!"}} className=Question, triggerType=beforeSave, user=undefined
App 7254 stderr: error: Error generating response. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: error: Uncaught internal server error. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7) TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stdout: verbose: REQUEST for [PUT] /parse/classes/Question/3gF0DAgzLk: {
App 7254 stdout:   "title": "Hello!"
App 7254 stdout: } method=PUT, url=/parse/classes/Question/3gF0DAgzLk, connection=close, user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36, accept=*/*, accept-language=en-GB,en-US;q=0.9,en;q=0.8, origin=http://192.168.209.2, content-length=220, accept-encoding=gzip, deflate, host=192.168.209.2, content-type=text/plain, referer=http://192.168.209.2/dashboard/apps/app/browser/Question, x-forwarded-for=192.168.209.1, !~passenger-client-address=192.168.209.1, title=Hello!
App 7254 stdout: info: beforeSave triggered for Question for user undefined:
App 7254 stdout:   Input: {"createdAt":"2018-09-20T11:47:36.635Z","updatedAt":"2018-09-20T11:47:36.635Z","title":"Hello!","objectId":"3gF0DAgzLk"}
App 7254 stdout:   Result: {"object":{"title":"Hello!"}} className=Question, triggerType=beforeSave, user=undefined
App 7254 stderr: error: Error generating response. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: error: Uncaught internal server error. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7) TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stdout: verbose: REQUEST for [PUT] /parse/classes/Question/3gF0DAgzLk: {
App 7254 stdout:   "title": "Hello!"
App 7254 stdout: } method=PUT, url=/parse/classes/Question/3gF0DAgzLk, connection=close, user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36, accept=*/*, accept-language=en-GB,en-US;q=0.9,en;q=0.8, origin=http://192.168.209.2, content-length=220, accept-encoding=gzip, deflate, host=192.168.209.2, content-type=text/plain, referer=http://192.168.209.2/dashboard/apps/app/browser/Question, x-forwarded-for=192.168.209.1, !~passenger-client-address=192.168.209.1, title=Hello!
App 7254 stdout: info: beforeSave triggered for Question for user undefined:
App 7254 stdout:   Input: {"createdAt":"2018-09-20T11:47:36.635Z","updatedAt":"2018-09-20T11:47:36.635Z","title":"Hello!","objectId":"3gF0DAgzLk"}
App 7254 stdout:   Result: {"object":{"title":"Hello!"}} className=Question, triggerType=beforeSave, user=undefined
App 7254 stderr: error: Error generating response. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: error: Uncaught internal server error. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7) TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stdout: verbose: REQUEST for [PUT] /parse/classes/Question/3gF0DAgzLk: {
App 7254 stdout:   "title": "Hello!"
App 7254 stdout: } method=PUT, url=/parse/classes/Question/3gF0DAgzLk, connection=close, user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36, accept=*/*, accept-language=en-GB,en-US;q=0.9,en;q=0.8, origin=http://192.168.209.2, content-length=220, accept-encoding=gzip, deflate, host=192.168.209.2, content-type=text/plain, referer=http://192.168.209.2/dashboard/apps/app/browser/Question, x-forwarded-for=192.168.209.1, !~passenger-client-address=192.168.209.1, title=Hello!
App 7254 stdout: info: beforeSave triggered for Question for user undefined:
App 7254 stdout:   Input: {"createdAt":"2018-09-20T11:47:36.635Z","updatedAt":"2018-09-20T11:47:36.635Z","title":"Hello!","objectId":"3gF0DAgzLk"}
App 7254 stdout:   Result: {"object":{"title":"Hello!"}} className=Question, triggerType=beforeSave, user=undefined
App 7254 stderr: error: Error generating response. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: error: Uncaught internal server error. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7) TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stdout: verbose: REQUEST for [PUT] /parse/classes/Question/3gF0DAgzLk: {
App 7254 stdout:   "title": "Hello!"
App 7254 stdout: } method=PUT, url=/parse/classes/Question/3gF0DAgzLk, connection=close, user-agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36, accept=*/*, accept-language=en-GB,en-US;q=0.9,en;q=0.8, origin=http://192.168.209.2, content-length=220, accept-encoding=gzip, deflate, host=192.168.209.2, content-type=text/plain, referer=http://192.168.209.2/dashboard/apps/app/browser/Question, x-forwarded-for=192.168.209.1, !~passenger-client-address=192.168.209.1, title=Hello!
App 7254 stdout: info: beforeSave triggered for Question for user undefined:
App 7254 stdout:   Input: {"createdAt":"2018-09-20T11:47:36.635Z","updatedAt":"2018-09-20T11:47:36.635Z","title":"Hello!","objectId":"3gF0DAgzLk"}
App 7254 stdout:   Result: {"object":{"title":"Hello!"}} className=Question, triggerType=beforeSave, user=undefined
App 7254 stderr: error: Error generating response. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: error: Uncaught internal server error. TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7) TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)
App 7254 stderr: TypeError: Cannot read property '__op' of undefined
App 7254 stderr:     at PostgresStorageAdapter.updateObjectsByQuery (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1102:29)
App 7254 stderr:     at PostgresStorageAdapter.findOneAndUpdate (/var/www/app/current/node_modules/parse-server/lib/Adapters/Storage/Postgres/PostgresStorageAdapter.js:1045:17)
App 7254 stderr:     at schemaController.getOneSchema.catch.then.schema (/var/www/app/current/node_modules/parse-server/lib/Controllers/DatabaseController.js:442:33)
App 7254 stderr:     at <anonymous>
App 7254 stderr:     at process._tickDomainCallback (internal/process/next_tick.js:228:7)

@flovilmart
Copy link
Contributor

Are you willing to open a PR with the fix? This seems straightforward now. Undefined values should be skipped

Sent with GitHawk

@ben-eb
Copy link
Contributor Author

ben-eb commented Sep 20, 2018

@flovilmart Yes, see #5069.

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

2 participants