Skip to content

invalid key name: _noBody #448

Description

@ngjohn

Hi,

I create an ParseObject in client side,
then, try to update the record using below code.

    ParseObject     record = ParseObject.CreateWithoutData("LockRecord", objectID);
    record.Increment("lock_count");
    Task run_task =   record.SaveAsync();

..

if(run_task.IsCanceled || run_task.IsFaulted)
{
// fail.....
}

the saveAsync() failed....

when I print out the exception msg, it said "invalid key name: _noBody"

this error happen after I host the server myself, it is not happened before~

Can someone give me some hints? Thanks a lot.

Activity

  1. gfosco commented on Feb 16, 2016

    @gfosco
    Contributor

    Can you check in your mongo database, do many of your LockRecord objects have a _noBody key on them?

  2. changed the title [-]fail in SaveAsync() in doNet sdk[/-] [+]invalid key name: _noBody[/+] on Feb 16, 2016
  3. ngjohn commented on Feb 16, 2016

    @ngjohn
    Author

    Hi,

    I just check the LockRecord table, no _noBody key was found~
    they looks like this...

    {
        "_id": "0OynPm0hnK",
        "attacker_id": "65lnd0hqMy",
        "defender_id": "zp2B6QvNuD",
        "lock_count": 3,
        "_created_at": {
            "$date": "2015-12-30T09:56:18.225Z"
        },
        "_updated_at": {
            "$date": "2015-12-30T10:01:47.704Z"
        }
    }
    

    For your information, this database is migrated from my existing Parse's DB. using the 'migrate' button...
    after migration, i found lot of strange Collection such as _dummy, _Index, _EventDimension....

    this problem is the first-time happened to me (after self-host), and I am new to mongodb)
    I really dun know what is the reason~

    Also, the SaveAsync() fail issues happened on ParseUser as well, when I try to update a _User field from the client code.

    Thanks.

  4. gfosco commented on Feb 16, 2016

    @gfosco
    Contributor

    Ok, looks like the dot net SDK sets this field and we're choking on it... https://github.com/ParsePlatform/Parse-SDK-dotNET/search?utf8=%E2%9C%93&q=_noBody

    Valid bug, will work on a PR.

  5. added
    type:bugImpaired feature or lacking behavior that is likely assumed
    on Feb 16, 2016
  6. ngjohn commented on Feb 18, 2016

    @ngjohn
    Author

    Hi,

    I just updated the parse-server to v2.1.0,
    and I run a test on [Unity] the SaveAsync()... I got the same _noBody result.
    do i miss something? or other package I need to update as well...?

    I confirmed that the parse-server is v2.1.0.
    and node is v4.3

    Thanks a lot.

  7. drew-gross commented on Feb 18, 2016

    @drew-gross
    Contributor

    No, 2.1.0 was supposed to supposed to fix this issue. We'll take a look. If you want to help, you could submit a PR that includes a failing test case :)

  8. ngjohn commented on Feb 18, 2016

    @ngjohn
    Author

    Hi, gross,

    I do want to help, can I submit a PR with code snippet in c# ? because I am developing on Unity c# .

    currently, I am quite sure that this is ONLY happened in Unity ( Not in VS dotNet project)

    :)

  9. drew-gross commented on Feb 18, 2016

    @drew-gross
    Contributor

    Currently our test setup is only JavaScript, sorry :( the Unity SDK is the only one uses the _noBody key so it would be the only one that fails. If you don't want to write JavaScript, another way to help would be to capture a failing network request as a CURL command (or similar) and post that here. Unfortunately I don't know how to do that in Unity, but I searched for some tools, it seems like this one might help: http://www.telerik.com/fiddler

  10. gfosco commented on Feb 18, 2016

    @gfosco
    Contributor

    If the previous fix didn't work (removing _noBody from the request.body,) it's possible that this option is being passed as the request.query string... If you add some a console.log statement to print these out and make a few requests, you might be able to pinpoint the issue.

  11. ngjohn commented on Feb 19, 2016

    @ngjohn
    Author

    HI,
    I try to remove the _noBody, and confirmed it is Ok ( I just make several create, update , query request to the server...)

     var parsed = Json.Parse(t.Result) as IDictionary<string, object>;
              // Inject the method
              parsed["_method"] = httpRequest.Method;
              //parsed["_noBody"] = noBody;    // fix _noBody bug.....( #448 )
              bytes = UTF8Encoding.UTF8.GetBytes(Json.Encode(parsed));
    

    https://github.com/ParsePlatform/Parse-SDK-dotNET/search?utf8=%E2%9C%93&q=_noBody

    I will keep checking for any side-effect of removing the _noBody key.

    Hope this help some other Unity developer.

  12. flovilmart commented on Feb 19, 2016

    @flovilmart
    Contributor

    @gfosco this is actually for non POST methods: https://github.com/ParsePlatform/Parse-SDK-dotNET/blob/f577ee38a0d55a199a473065b18acad084e4b083/ParseCommon/Internal/HttpClient/Unity/HttpClient.Unity.cs#L43

    if (!httpRequest.Method.Equals("POST") || httpRequest.Data == null) { 

  13. ngjohn commented on Feb 21, 2016

    @ngjohn
    Author

    Yes, I found that 'update' & 'delete' object will use PUT methods....
    and this will inject a '_noBody' in the request.

  14. gfosco commented on Feb 26, 2016

    @gfosco
    Contributor

    Assuming that #512 corrected things in 2.1.3. Please re-open if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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