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

Column name restrictions enforced on sub-object keys #165

Closed
sdf611097 opened this issue Feb 2, 2016 · 18 comments
Closed

Column name restrictions enforced on sub-object keys #165

sdf611097 opened this issue Feb 2, 2016 · 18 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@sdf611097
Copy link
Contributor

I just migrate the db to mongolab.

I start the parse server example.

I try to query something with javascript sdk 1.7.0 on nodejs v4.2.4.

Below is my javascript code.

var Parse = require('parse/node').Parse;
Parse.initialize("myAppId", "jsKey");
Parse.serverURL = 'http://localhost:1337/parse'

var clz = Parse.Object.extend('myClass');
var query = new Parse.Query(clz);
query.find().then(function(list){
console.log(list.length);
},function(error){
console.log(error);
});

One of my original class(size 4) will get ParseError { code: 1, message: undefined }.

Others get all obj size (not original default limit 100)

I use original keys and with default parse api server endpoint.

It works, and get 4 and 100 as expected.

I found that query.limit default 100 is gone.
query.skip cannot exceed 10000 constraint is gone.
Could you also list all influence of the code?
(In this case, query with 100 results must add query.limit(100); )

Only contains 'hello' cloud code.

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

Would be interested in any details / debugging you can do about the class returning the undefined error. It's possible to set the environment variable VERBOSE=1 and it will log all input/output.

True, the limits are gone... We should probably re-enable the default limit 100, but the rest are no longer enforced because it was a constraint of running hundreds of thousands of apps as a service..

@sdf611097
Copy link
Contributor Author

parse-server-example running on port 1337.
GET /parse/classes/ActionLink { 'user-agent': 'node-XMLHttpRequest, Parse/js1.7.0 (NodeJS 4.2.4)',
accept: '/',
'content-type': 'text/plain',
host: 'localhost:1337',
'content-length': '164',
connection: 'close' } {
"where": {}
}
error: bad key in untransform: 0
Uncaught internal server error. bad key in untransform: 0 undefined
GET /parse/classes/ActionLink { 'user-agent': 'node-XMLHttpRequest, Parse/js1.7.0 (NodeJS 4.2.4)',
accept: '
/
',
'content-type': 'text/plain',
host: 'localhost:1337',
'content-length': '164',
connection: 'close' } {
"where": {}
}
error: bad key in untransform: 0
Uncaught internal server error. bad key in untransform: 0 undefined
GET /parse/classes/ActionLink { 'user-agent': 'node-XMLHttpRequest, Parse/js1.7.0 (NodeJS 4.2.4)',
accept: '
/
',
'content-type': 'text/plain',
host: 'localhost:1337',
'content-length': '164',
connection: 'close' } {
"where": {}
}
error: bad key in untransform: 0
Uncaught internal server error. bad key in untransform: 0 undefined
GET /parse/classes/ActionLink { 'user-agent': 'node-XMLHttpRequest, Parse/js1.7.0 (NodeJS 4.2.4)',
accept: '
/
',
'content-type': 'text/plain',
host: 'localhost:1337',
'content-length': '164',
connection: 'close' } {
"where": {}
}
error: bad key in untransform: 0
Uncaught internal server error. bad key in untransform: 0 undefined
GET /parse/classes/ActionLink { 'user-agent': 'node-XMLHttpRequest, Parse/js1.7.0 (NodeJS 4.2.4)',
accept: '
/
',
'content-type': 'text/plain',
host: 'localhost:1337',
'content-length': '164',
connection: 'close' } {
"where": {}
}
error: bad key in untransform: _0
Uncaught internal server error. bad key in untransform: _0 undefined

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

Take a look in your Mongo database for the ActionLink collection... do you really have objects with a key named _0 ?

@sdf611097
Copy link
Contributor Author

Yes, I have a object with a key named _0 ( _Version)

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

Did you have this object in hosted Parse?... It's not a valid column name...

@sdf611097
Copy link
Contributor Author

Column name does not start with _ , it's named "android"
something like this
"os":{
"_0":{ 'k1':'v1'},
"_1":{ }
}

@gfosco
Copy link
Contributor

gfosco commented Feb 2, 2016

Interesting. Looks like we're enforcing the column name restriction on sub-objects. I'll accept it as a bug and take a look soon.

@gfosco gfosco changed the title Query some class get ParseError { code: 1, message: undefined } Column name restrictions enforced on sub-object keys Feb 2, 2016
@gfosco gfosco added type:bug Impaired feature or lacking behavior that is likely assumed and removed troubleshooting labels Feb 2, 2016
@mahabubakram
Copy link

ALso I have found this problem with one of the key used for keeping twitter auth "_auth_data_twitter".

And it is saying bad key in untransform: _auth_data_twitter undefined

@nlutsenko
Copy link
Contributor

Yup, there are more like that.
I am working on a fix, but it takes slightly more time than I thought it would.

@enjoyjeremy-bc
Copy link

+1
I'm also having this issue. The class I'm querying has a Pointer column, if that helps.
I get this error:
Uncaught internal server error. bad key in untransform: _content undefined

montymxb pushed a commit to montymxb/parse-server that referenced this issue Feb 14, 2016
montymxb pushed a commit to montymxb/parse-server that referenced this issue Feb 14, 2016
montymxb pushed a commit to montymxb/parse-server that referenced this issue Feb 14, 2016
@giano
Copy link

giano commented Feb 15, 2016

+1

@flovilmart
Copy link
Contributor

@mahabubakram the _auth_data_twitter problem should be fixed with #247.

@giano
Copy link

giano commented Feb 18, 2016

Sorry, still here.

@flovilmart
Copy link
Contributor

@giano just the _auth_data_twitter should be fixed, as well as other auth_data.... But not the other cases

@gfosco
Copy link
Contributor

gfosco commented Feb 20, 2016

Still experiencing this with 2.1.2?

@sdf611097
Copy link
Contributor Author

It's still failed in parse-server@2.1.2.

GET /parse/classes/ActionLink { 'user-agent': 'node-XMLHttpRequest, Parse/js1.7.1 (NodeJS 4.2.1)',
accept: '/',
'content-type': 'text/plain',
host: 'zencirclectl.cloudapp.net:1337',
'content-length': '174',
connection: 'close' } {
"where": {}
}
error: bad key in untransform: _0
Uncaught internal server error. bad key in untransform: _0 undefined

@flovilmart
Copy link
Contributor

@gfosco found the culprit, the untransform is recursive, that's why we apply the same rules to nested objects as top-level.

@gfosco
Copy link
Contributor

gfosco commented Feb 20, 2016

Nice, @flovilmart 👍 Merged that, closing this. @sdf611097 You can pull the master branch or wait for 2.1.3. Let us know if you have any problems. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

7 participants