[GODRIVER-2847] CLONE - RunCommandCursor always fails and returns an error message referencing internal driver details Created: 13/May/23 Updated: 06/Dec/23 Resolved: 15/Jul/23 |
|
| Status: | Closed |
| Project: | Go Driver |
| Component/s: | Command & Dispatch |
| Affects Version/s: | 1.11.6 |
| Fix Version/s: | 1.13.0, 1.13.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jacob Bills | Assignee: | Matt Dale |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Documentation Changes: | Not Needed | ||||||||||||||||
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
||||||||||||||||
| Description |
|
Example code:
This simpler example fails in the same way:
Error:
It's quite possible that i'm just doing something wrong. In which, case the bug is just that the error message does not indicate what I did wrong. However, im pretty sure there's a real bug here preventing this from working. I see that `RunCommandCursor` calls `ResultCursor`, which calls `NewCursorResponse` with `c.result`. `c.result` only appears to ever be set by `Execute` which, is never called. `NewCursorResponse` then returns the above error when it tries to verify the type of the "cursor" field on a nil document. |
| Comments |
| Comment by Githook User [ 15/Jul/23 ] | ||||||||
|
Author: {'name': 'Matt Dale', 'email': '9760375+matthewdale@users.noreply.github.com', 'username': 'matthewdale'}Message: | ||||||||
| Comment by Matt Dale [ 14/Jul/23 ] | ||||||||
| Comment by Jacob Bills [ 18/May/23 ] | ||||||||
|
That makes sense and this works. I can confirm this error is returned for both aggregate() and find() commands when using explain. It is only slightly inconvenient since both aggregate and find I expect it to return a cursor in the routine I'm calling runcommand from. Thanks | ||||||||
| Comment by Matt Dale [ 17/May/23 ] | ||||||||
|
Hey jacobtbills@gmail.com, I believe the issue is that the RunCommandCursor method expects the response to contain cursor information, but the explain and ping commands do not return a cursor (they return a document with the requested information). You should use the RunCommand method instead. For example:
Does the above example work for your use case? P.S. You're correct that the error message could be improved to suggest using the RunCommand method instead. | ||||||||
| Comment by Jacob Bills [ 13/May/23 ] | ||||||||
|
Confirmed bug is still present in go driver v1.11.6 | ||||||||
| Comment by PM Bot [ 13/May/23 ] | ||||||||
|
Hi jacobtbills@gmail.com, thank you for reporting this issue! The team will look into it and get back to you soon. |