[SERVER-20171] Invalid "cannot use the part to traverse the element" Created: 28/Aug/15 Updated: 20/Jul/16 Resolved: 28/Oct/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | 3.0.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Chad Kreimendahl | Assignee: | Ramon Fernandez Marina |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | The following query on a collection with at least a few hundred documents matching the following fields causes some, but not all, records to be updated.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
When attempting to rename fields on all documents in a collection, we're seeing a strange occurrence of this error message that only happens on collections with certain kinds of data. The error only happens when doing an update with multi: true It updates some of the documents, a seemingly random number. Performing a restore of the collection and rerunning the query causes the same error, but different records to be updated. |
| Comments |
| Comment by Ramon Fernandez Marina [ 28/Oct/15 ] | ||||||||||
|
sallgeud, we haven't heard back from you for some time so I'm going to resolve this ticket. Since the error message indicates that there was at least one document where Entity was null when the command was run and there's insufficient evidence to point to a bug in the server the behavior you're seeing is expected. Regards, | ||||||||||
| Comment by Ramon Fernandez Marina [ 09/Oct/15 ] | ||||||||||
|
sallgeud, the error message you provided:
means there was at least one document where Entity was null when the command was run. If that's not the case and you continue to get this error message we'll need to look at your data to determine if there's a bug triggered by your specific dataset and/or operations. I've created an upload portal for you where you can, privately and securely, upload a dataset that reproduces the issue. Thanks, | ||||||||||
| Comment by Chad Kreimendahl [ 09/Oct/15 ] | ||||||||||
|
None of the entity objects were ever null and are not null today either. | ||||||||||
| Comment by Scott Hernandez (Inactive) [ 09/Oct/15 ] | ||||||||||
|
Chad, The behavior you are seeing is due to the "Entity" field being explicitly null, or really any type which is not an embedded document. Let me give you a slightly different repro/example:
In order to ensure you don't get errors like this, I'd suggest making sure your "Entity" field is either not there, or an embedded document ({}) so that it is compatible with dot-notation in rename. I'm guessing that at some point that some of your documents "Entity" field explicitly to null, and maybe not intentionally, which is very different than removing the field (with $unset), or keeping it as an empty embedded document ({}). I hope this helps clears up the current behavior and why you got an error while running your rename. --Scott | ||||||||||
| Comment by Chad Kreimendahl [ 31/Aug/15 ] | ||||||||||
|
1) exception: cannot use the part (Entity of Entity.Fields.495.BeginCalculation) to traverse the element ( {Entity: null}) code:16837 The current workaround to this is to ensure that every object we're updating as "Entity". So we were able to temporarily work around this by only updating records with Entity: {$exists: 1} However, we don't always know that we're reliant upon the same document property when doing this, when we may be updating hundreds of names. | ||||||||||
| Comment by Sam Kleinman (Inactive) [ 31/Aug/15 ] | ||||||||||
|
Thanks for the report. Could you please answer the following questions about your configuration to help us with the debugging process.
Thanks again. Regards, |