jeromelebel / MongoHub-Mac

Mac Native Mongodb Client
2.43k stars 159 forks source link

Looks like MongoHub cannot sort if the field name is numeric #150

Open milko opened 9 years ago

milko commented 9 years ago

I have field names which are numeric (not numbers, but numeric strings): if I try to sort in the collection window by one of these fields, for example { "61" : -1 } I get no results, although I get the correct records count. If I set the sort field to, for instance { "_id" : -1 }, it sorts correctly.

I am using version 3.0.1

jeromelebel commented 9 years ago

do you use the console? Do you have this problem in the console too? Would it be possible for me to connect to your server?

milko commented 9 years ago

I don't use the console. The old version worked fine. The database I was working on is on my laptop, but the behaviour is the same also if I connect to a server.

jeromelebel commented 9 years ago

what is the version of your mongo server?

milko commented 9 years ago

I am using version 2.6.0. The problem is that on my laptop I have Mac OS X 10.9 and at work I have Mac OS X 10.7.5: at work the application fails to launch, so I am using an older version to work. I will try to install the new version again and send you the console output. By the way, when I tried the sort on the laptop, the console didn't throw any error.

milko commented 9 years ago

I just installed version 3.0.2 of MongoHub on my Mac Pro 10.7.5. Launched the application and no errors. Opened localhost connection and I got this in the console:

21/10/14 10:37:44.839 AM MongoHub: Unable to simultaneously satisfy constraints: ( "<NSAutoresizingMaskLayoutConstraint:0x7ff72ca9a260 h=--& v=--& V:[NSView:0x7ff72cca0b10(0)]>", "<NSLayoutConstraint:0x7ff72cc85cb0 V:[NSPopUpButton:0x7ff72c8638b0]-(0)-| (Names: '|':NSView:0x7ff72cca0b10 )>", "<NSLayoutConstraint:0x7ff72cc8b5c0 V:|-(0)-[NSScrollView:0x7ff72c869580] (Names: '|':NSView:0x7ff72cca0b10 )>", "<NSLayoutConstraint:0x7ff72c8680b0 V:[NSPopUpButton:0x7ff72c8638b0(21)]>", "<NSLayoutConstraint:0x7ff72cc77b70 V:[NSScrollView:0x7ff72c869580]-(-1)-[NSPopUpButton:0x7ff72c8638b0]>" )

Will attempt to recover by breaking constraint <NSLayoutConstraint:0x7ff72c8680b0 V:[NSPopUpButton:0x7ff72c8638b0(21)]>

Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.

milko commented 9 years ago

When I press the query button to view a collection I get the following errors:

21/10/14 10:40:14.567 AM MongoHub: -[NSBundle loadNibNamed:owner:topLevelObjects:]: unrecognized selector sent to instance 0x7ff72b421390 21/10/14 10:40:14.567 AM MongoHub: -[NSBundle loadNibNamed:owner:topLevelObjects:]: unrecognized selector sent to instance 0x7ff72b421390 21/10/14 10:40:14.646 AM MongoHub: ( 0 CoreFoundation 0x00007fff8df99f56 exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff8d7e2d5e objc_exception_throw + 43 2 CoreFoundation 0x00007fff8e0261be -[NSObject doesNotRecognizeSelector:] + 190 3 CoreFoundation 0x00007fff8df86e23 __forwarding + 371 4 CoreFoundation 0x00007fff8df86c38 _CF_forwarding_prep_0 + 232 5 MongoHub 0x000000010f3db891 -[MHQueryWindowController(UpdateTab) updateAddOperatorAction:] + 209 6 MongoHub 0x000000010f3d4c47 -[MHQueryWindowController awakeFromNib] + 119 7 AppKit 0x00007fff8993a389 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1311 8 AppKit 0x00007fff89a59e6b -[NSNib instantiateNibWithExternalNameTable:] + 606 9 AppKit 0x00007fff89a59bd8 -[NSNib instantiateNibWithOwner:topLevelObjects:] + 251 10 AppKit 0x00007fff89a5911f -[NSViewController loadView] + 186 11 AppKit 0x00007fff89a54dfe -[NSViewController view] + 41 12 MongoHub 0x000000010f3fdfb1 -[MHTabViewController addTabItemViewController:] + 401 13 MongoHub 0x000000010f403dfd -[MHConnectionWindowController query:] + 845 14 CoreFoundation 0x00007fff8df8970d -[NSObject performSelector:withObject:] + 61 15 AppKit 0x00007fff89f76ef0 -[NSToolbarButton sendAction:to:] + 82 16 AppKit 0x00007fff89f76f3e -[NSToolbarButton sendAction] + 68 17 AppKit 0x00007fff89ac9627 -[NSToolbarItemViewer mouseDown:] + 4995 18 AppKit 0x00007fff899f4c98 -[NSWindow sendEvent:] + 6306 19 AppKit 0x00007fff8998e3a5 -[NSApplication sendEvent:] + 5593 20 AppKit 0x00007fff89924a0e -[NSApplication run] + 555 21 AppKit 0x00007fff89ba0eac NSApplicationMain + 867 22 MongoHub 0x000000010f3c7f92 main + 34 23 MongoHub 0x000000010f3c4754 start + 52 )

milko commented 9 years ago

I will try the same procedure with the laptop on Mac OS 10.9 this evening, let's see if there is something there too.

milko commented 9 years ago

I realize this is a different bug than the one in this thread, but if we solve this problem we can fix the other one.

jeromelebel commented 9 years ago

The stack trace is related to 10.7. I'm planning to drop the support for 10.7 soon, but I just fixed this issue. For the constraint issue, it is relative to 10.7 too. But I don't have 10.7 to understand what is going on. I don't plan to fix myself.

And for the current issue, I would be interested to see how it goes for you on a 10.9

jeromelebel commented 9 years ago

Can you try https://mongohub.s3.amazonaws.com/MongoHub-NSBundle.zip on your 10.7 to see if your update tab is loaded correctly? and without warnings or error in the console. thanks

milko commented 9 years ago

I just installed that version, here is the console feedback:

==> Created a connection: 22/10/14 8:44:56.721 AM MongoHub: Unable to simultaneously satisfy constraints: ( "<NSAutoresizingMaskLayoutConstraint:0x7fe2799b6960 h=--& v=--& V:[NSView:0x7fe279c4f000(0)]>", "<NSLayoutConstraint:0x7fe279c56fb0 V:[NSPopUpButton:0x7fe279cbd290]-(0)-| (Names: '|':NSView:0x7fe279c4f000 )>", "<NSLayoutConstraint:0x7fe279c56e90 V:|-(0)-[NSScrollView:0x7fe279c2aaa0] (Names: '|':NSView:0x7fe279c4f000 )>", "<NSLayoutConstraint:0x7fe279cca030 V:[NSPopUpButton:0x7fe279cbd290(21)]>", "<NSLayoutConstraint:0x7fe279cb2fd0 V:[NSScrollView:0x7fe279c2aaa0]-(-1)-[NSPopUpButton:0x7fe279cbd290]>" )

Will attempt to recover by breaking constraint <NSLayoutConstraint:0x7fe279cca030 V:[NSPopUpButton:0x7fe279cbd290(21)]>

Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.

==> Double-clicked on a collection name (to get the query panel): it doesn't open the query panel. 22/10/14 8:47:09.187 AM MongoHub: +[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil

22/10/14 8:47:09.427 AM MongoHub: ( 0 CoreFoundation 0x00007fff8c1a3f56 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff8b9ecd5e objc_exception_throw + 43 2 CoreFoundation 0x00007fff8c19128c +[NSInvocation invocationWithMethodSignature:] + 620 3 MongoHub 0x000000010baf0f49 -[MHQueryWindowController(UpdateTab) updateAddOperatorAction:] + 425 4 MongoHub 0x000000010bae9db7 -[MHQueryWindowController awakeFromNib] + 119 5 AppKit 0x00007fff87b44389 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1311 6 AppKit 0x00007fff87c63e6b -[NSNib instantiateNibWithExternalNameTable:] + 606 7 AppKit 0x00007fff87c63bd8 -[NSNib instantiateNibWithOwner:topLevelObjects:] + 251 8 AppKit 0x00007fff87c6311f -[NSViewController loadView] + 186 9 AppKit 0x00007fff87c5edfe -[NSViewController view] + 41 10 MongoHub 0x000000010bb13261 -[MHTabViewController addTabItemViewController:] + 401 11 MongoHub 0x000000010bb190ad -[MHConnectionWindowController query:] + 845 12 MongoHub 0x000000010bb165ce -[MHConnectionWindowController sidebarDoubleAction:] + 62 13 CoreFoundation 0x00007fff8c19370d -[NSObject performSelector:withObject:] + 61 14 AppKit 0x00007fff87c358ca -[NSApplication sendAction:to:from:] + 139 15 AppKit 0x00007fff87c357fe -[NSControl sendAction:to:] + 88 16 AppKit 0x00007fff87c9c3e2 -[NSTableView _sendAction:to:row:column:] + 87 17 AppKit 0x00007fff87c991a5 -[NSTableView mouseDown:] + 5875 18 AppKit 0x00007fff8801890b -[NSOutlineView mouseDown:] + 74 19 MongoHub 0x000000010bb0a539 -[MHDatabaseCollectionOutlineView mouseDown:] + 73 20 AppKit 0x00007fff87bfec98 -[NSWindow sendEvent:] + 6306 21 AppKit 0x00007fff87b983a5 -[NSApplication sendEvent:] + 5593 22 AppKit 0x00007fff87b2ea0e -[NSApplication run] + 555 23 AppKit 0x00007fff87daaeac NSApplicationMain + 867 24 MongoHub 0x000000010badd102 main + 34 25 MongoHub 0x000000010bad98c4 start + 52 )

==> Clicked on the query button: it shows an empty right side window pane.

22/10/14 8:48:31.577 AM MongoHub: *\ -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]

22/10/14 8:48:31.690 AM MongoHub: ( 0 CoreFoundation 0x00007fff8c1a3f56 exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff8b9ecd5e objc_exception_throw + 43 2 CoreFoundation 0x00007fff8c131392 -[NSArrayM objectAtIndex:] + 274 3 MongoHub 0x000000010bb129d3 -[MHTabViewController _tabItemViewControllerWithIndex:] + 419 4 MongoHub 0x000000010bb13b28 -[MHTabViewController setSelectedTabIndex:] + 120 5 Foundation 0x00007fff899889d2 _NSSetUnsignedLongLongValueAndNotify + 261 6 MongoHub 0x000000010bb13bd0 -[MHTabViewController selectTabItemViewController:] + 128 7 MongoHub 0x000000010bb14c6a -[MHTabItemViewController select] + 58 8 MongoHub 0x000000010baea956 -[MHQueryWindowController select] + 54 9 MongoHub 0x000000010bb190c0 -[MHConnectionWindowController query:] + 864 10 CoreFoundation 0x00007fff8c19370d -[NSObject performSelector:withObject:] + 61 11 AppKit 0x00007fff88180ef0 -[NSToolbarButton sendAction:to:] + 82 12 AppKit 0x00007fff88180f3e -[NSToolbarButton sendAction] + 68 13 AppKit 0x00007fff87cd3627 -[NSToolbarItemViewer mouseDown:] + 4995 14 AppKit 0x00007fff87bfec98 -[NSWindow sendEvent:] + 6306 15 AppKit 0x00007fff87b983a5 -[NSApplication sendEvent:] + 5593 16 AppKit 0x00007fff87b2ea0e -[NSApplication run] + 555 17 AppKit 0x00007fff87daaeac NSApplicationMain + 867 18 MongoHub 0x000000010badd102 main + 34 19 MongoHub 0x000000010bad98c4 start + 52 )

milko commented 9 years ago

So it still doesn't work. I hope the console logs may help you, at least to catch eventual problems that might affect later OS X versions.

jeromelebel commented 9 years ago

Let's put on hold this issue (about the sort issue). And let's continue there : https://github.com/jeromelebel/MongoHub-Mac/issues/157

milko commented 9 years ago

I just tried MongoHub on OS X 10.9 and now the sort works, i don't know what is going on, but I have no problems. I wonder if the updates of these days have done something to the system. It looks as if the issue is solved... at least for Mavericks.

milko commented 9 years ago

OK, I managed to get the console output for the sort problem, here it is:

milko commented 9 years ago

2014-10-26T17:53:33.057+0100 [conn1] ERROR: Runner error, stats: { "type" : "SORT", "works" : 2405, "yields" : 18, "unyields" : 18, "invalidates" : 0, "advanced" : 0, "needTime" : 2403, "needFetch" : 0, "isEOF" : 0, "forcedFetches" : 0, "memUsage" : 33563334, "memLimit" : 33554432, "children" : [ { "type" : "COLLSCAN", "works" : 2403, "yields" : 18, "unyields" : 18, "invalidates" : 0, "advanced" : 2402, "needTime" : 1, "needFetch" : 0, "isEOF" : 0, "docsTested" : 2402, "children" : [] } ] } 2014-10-26T17:53:33.059+0100 [conn1] assertion 17144 Runner error: Overflow sort stage buffered data usage of 33563334 bytes exceeds internal limit of 33554432 bytes ns:BIOVERSITY._units query:{ $query: {}, $orderby: { 61: -1 } }

milko commented 9 years ago

I put in the sort field: {"61":-1}

milko commented 9 years ago

It looks like it doesn't consider the quotes.