-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Bad value in untransformObject undefined #1316
Comments
Did you use the exported json data from parse.com to import in MongoDB? |
No. I used the parse migration feature. I just provided the JSON above so you could see the structure of the collection. |
I'm not sure what's going on here, the JSON your provided has numbers on the lastMessageTimetoken. |
When exporting the JSON from Parse it formats it to be just a number. However after migrating to another mongoDB using Parse migration the lastMessageTimetoken is visible as NumberLong() |
uhm.. that's very very odd |
Did you run the reproduction project and see the error? |
I inserted a document in my DB with a NumberLong:
and then run with the mongo driver:
|
From node REPL (v 5.*) with mongo driver (npm install mongodb) connected to the database provided in the original post I ran the following command and got:
|
What MongoDB version are you using? |
Noticed you use node 5.+, I was testing on 4.3 |
3.0.9 hosted on Object Rocket I can switch to 4.3 and see if any difference. |
I got the same result using node v4.3.2 (npm v2.14.12) |
If I switch from using: to
|
Interesting, does the item have a toJSON function or something that would help us sanitize the data at large? |
nodejs is not capable of representing 64 bits integers, so it wraps them into strings. Not sure this is what you'd expect on the client. |
@zleman1593 quick question like that, does your number longs are actually 64bit ints? |
The lastMessageTimetoken field it is set in Parse by |
and it comes from Parse.com? @gfosco can you investigate that? If they are floats, I suggest you run an mongodb op. to update your LongNumber to regular numbers as you won't loose precision. |
Yes. All the data were created while still on parse.com |
hi guys We use Ubuntu self hosted + parse-server + mongodb (ubuntu also) + rocksdb (self hosted) As a temporary fix we have done this in untransformObject ( transform.js ) case 'symbol': It works so far but probably opens security breach or even crashes later on, so please provide a fix; Thanks; |
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
Environment Setup
Local
OSX 10.11.3
MongoDB on ObjectRocket v 3.0.9
Steps to reproduce
Clone this bug reproduction repo, npm install & npm start
https://github.com/zleman1593/parse-server-transform-bug
I migrated a copy of the database to object rocket and I am hosting it from there. This repo uses that db.
If you want to connect to a local db, here is the mongo dump you can use mongorestore with.
https://www.dropbox.com/s/gsfqvwp0lsien90/MongoDump.zip?dl=0
If you want a quick look at the problematic data, I exported it from parse (JSON)(I did not use this for the migration) : https://goo.gl/61X5Jv
Make this query:
curl -X GET \ -H "X-Parse-Application-Id: XXXXXXXXX" \ -H "X-Parse-Master-Key: XXXXXXXXXXX" \ -G \ --data-urlencode "where={\"clientId\":\"QArG4hBu8z\"}" \ http://localhost:1338/parse/classes/ProviderClient
Use this application ID: 3fko3frQqNK20Lx59EbfeP2X3u5Iy3eTstMsIze5 Use this master key: DFYYoY6iWXzgbSDxfZqJHrNaOfHZrpCHlH1vmBau
You can use other keys, just don't forget to switch them out in index.js
Query Response
{"code":1,"message":"Internal server error."}
Logs/Trace
error: Uncaught internal server error. bad value in untransformObject undefined
The error is throw here: https://github.com/ParsePlatform/parse-server/blob/f0ebb7bae6631493eb0fce608c4948ad37636b7c/src/transform.js in the untransformObject function when it comes across a function in the mongoObject when reading the lastMessageTimetoken BSON field which is a 'NumberLong'.
Issue #665 is likely related. @gfosco
The text was updated successfully, but these errors were encountered: