You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by "Hurni, Kevin (ITS)" <Ke...@its.ny.gov> on 2015/02/24 22:12:55 UTC

Apache Directory Studio-incorrect counts via LDAP

I apologize if I'm doing this wrong, but here goes:
Apache Directory Studio Version: 2.0.0.v20130628

I'm using LDAP against a MS Windows 2008 R2 server.

I constructed a search query.  It runs the query and then next to it, has a number of items such as:
(3686)

However, if you either expand the query (click the little arrow), it shows those little folders in bunches of 100, BUT it stops at:
3601...3683

AND
If I export to a .CSV there are actually only 3683

So somehow, Directory Studio isn't displaying the correct count in the parenthesis.

This is the first time I've ever run across this.

Please let me know how to proceed.
(Do I report a bug?)

Thank you

--Kevin


RE: Apache Directory Studio-incorrect counts via LDAP

Posted by "Hurni, Kevin (ITS)" <Ke...@its.ny.gov>.
Hello, no I do not.
In this case, it's a flat AD Domain with the default:
Cn=users

I limited the query to the container in question.
The container in question is flat, no sub ou's or cn's.

It seems to be something with either the query (again, this is the only time I've noticed it, but then again, never had a reason to doubt the number counts until this time), or something with Directory Studio.

The query was (IMO) fairly simple:
(&(objectClass=user)(!(mail=*hr.abc.com))(userPrincipalName=*somethingelse.com))

-----Original Message-----
From: Emmanuel Lécharny [mailto:elecharny@gmail.com] 
Sent: Tuesday, February 24, 2015 4:39 PM
To: users@directory.apache.org
Subject: Re: Apache Directory Studio-incorrect counts via LDAP

Le 24/02/15 22:12, Hurni, Kevin (ITS) a écrit :
> I apologize if I'm doing this wrong, but here goes:
> Apache Directory Studio Version: 2.0.0.v20130628
>
> I'm using LDAP against a MS Windows 2008 R2 server.
>
> I constructed a search query.  It runs the query and then next to it, has a number of items such as:
> (3686)
>
> However, if you either expand the query (click the little arrow), it shows those little folders in bunches of 100, BUT it stops at:
> 3601...3683
>
> AND
> If I export to a .CSV there are actually only 3683
>
> So somehow, Directory Studio isn't displaying the correct count in the parenthesis.
>
> This is the first time I've ever run across this.
>
> Please let me know how to proceed.
> (Do I report a bug?)

Do you have sub-trees ?


Re: Apache Directory Studio-incorrect counts via LDAP

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 24/02/15 22:12, Hurni, Kevin (ITS) a écrit :
> I apologize if I'm doing this wrong, but here goes:
> Apache Directory Studio Version: 2.0.0.v20130628
>
> I'm using LDAP against a MS Windows 2008 R2 server.
>
> I constructed a search query.  It runs the query and then next to it, has a number of items such as:
> (3686)
>
> However, if you either expand the query (click the little arrow), it shows those little folders in bunches of 100, BUT it stops at:
> 3601...3683
>
> AND
> If I export to a .CSV there are actually only 3683
>
> So somehow, Directory Studio isn't displaying the correct count in the parenthesis.
>
> This is the first time I've ever run across this.
>
> Please let me know how to proceed.
> (Do I report a bug?)

Do you have sub-trees ?


RE: Apache Directory Studio-incorrect counts via LDAP

Posted by "Hurni, Kevin (ITS)" <Ke...@its.ny.gov>.
Yes, I will try that tomorrow.

Thank you for the info/pointers.
--Kevin


-----Original Message-----
From: Stefan Seelmann [mailto:mail@stefan-seelmann.de] 
Sent: Tuesday, February 24, 2015 4:50 PM
To: users@directory.apache.org
Subject: Re: Apache Directory Studio-incorrect counts via LDAP

I suspect there are duplicate entries with same DN. Can you please try to disable alias dereferencing?

Kind Regards,
Stefan

On 02/24/2015 10:12 PM, Hurni, Kevin (ITS) wrote:
> I apologize if I'm doing this wrong, but here goes:
> Apache Directory Studio Version: 2.0.0.v20130628
> 
> I'm using LDAP against a MS Windows 2008 R2 server.
> 
> I constructed a search query.  It runs the query and then next to it, has a number of items such as:
> (3686)
> 
> However, if you either expand the query (click the little arrow), it shows those little folders in bunches of 100, BUT it stops at:
> 3601...3683
> 
> AND
> If I export to a .CSV there are actually only 3683
> 
> So somehow, Directory Studio isn't displaying the correct count in the parenthesis.
> 
> This is the first time I've ever run across this.
> 
> Please let me know how to proceed.
> (Do I report a bug?)
> 
> Thank you
> 
> --Kevin
> 


Re: Apache Directory Studio-incorrect counts via LDAP

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
On 02/25/2015 11:00 PM, Hurni, Kevin (ITS) wrote:
> Hello,
> Yes, once I realized that the "cn=users" had 3 group objects in them, then the count make sense.
> So there were like 5,386 (in parenthesis), but the export was 5,385.  As an example.
> What does puzzle me, though, is why does Apache have the number in parenthesis be different than the search results?  I thought they should match.
> 
> Example:
> Let's say you have ou=users
> And you have 500 user objects in there.  100 of the users have mail attribute present.  The other 400 do not.
> I would've thought that if you construct an LDAP query of base: ou=users and something like:
> (&(objectclass=user)(mail=*))
> That the number in parenthesis would be 100, and the results would be 100.
> 
> In this case, for some strange reason, Apache feels the need to include the 3 group objects in the parenthesis even though the search filter doesn't count/include them.

No, the filtering is done on the server (AD) and the server only returns
the entries that match the filter. Studio just displays those entries
returned by the server, it doesn't "know" that there are more ;)

I checked the code, the number in parenthesis is the number of search
result entries plus the number of search continuations (referrals). So
now I suspect a search result reference.

I was able to reproduce your problem. I have 4 normal entries and added
one referral. When I search I get the 4 entries plus one additional
entry that represents the search continuation, the number in parenthesis
is 5. Then I changed the folding size (in browser view preferences) to
3. Now I get the folders, the 1st shows 1...3 and the 2nd 4...4, the
search continuation is hidden, the number in parenthesis is still 5.

What you can try:
* disable the folding (Preferences -> Browser View), then I think those
search continuation entries should be visible. Or
* in the search change the Referral Handling to "Ignore Referrals"

Kind Regards,
Stefan


RE: Apache Directory Studio-incorrect counts via LDAP

Posted by "Hurni, Kevin (ITS)" <Ke...@its.ny.gov>.
Hello,
Yes, once I realized that the "cn=users" had 3 group objects in them, then the count make sense.
So there were like 5,386 (in parenthesis), but the export was 5,385.  As an example.
What does puzzle me, though, is why does Apache have the number in parenthesis be different than the search results?  I thought they should match.

Example:
Let's say you have ou=users
And you have 500 user objects in there.  100 of the users have mail attribute present.  The other 400 do not.
I would've thought that if you construct an LDAP query of base: ou=users and something like:
(&(objectclass=user)(mail=*))
That the number in parenthesis would be 100, and the results would be 100.

In this case, for some strange reason, Apache feels the need to include the 3 group objects in the parenthesis even though the search filter doesn't count/include them.

I don't recall seeing this behavior before in any directory/query I've done (ie: the number in parenthesis seems to always equal the actual results displayed, etc.)

??


-----Original Message-----
From: Emmanuel Lécharny [mailto:elecharny@gmail.com] 
Sent: Wednesday, February 25, 2015 4:56 PM
To: users@directory.apache.org
Subject: Re: Apache Directory Studio-incorrect counts via LDAP

Le 25/02/15 20:39, Hurni, Kevin (ITS) a écrit :
> There is no subtree as previously stated in the cn=users area in the AD tree.
>
> Unless I'm misinterpreting the use of the word subtree.

Ah, sorry, my bad. I misinterpreted the groups you are talking about, thinking they were sub-entries.

So basically, the count you get is equal to what you have, right ?

Re: Apache Directory Studio-incorrect counts via LDAP

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 25/02/15 20:39, Hurni, Kevin (ITS) a écrit :
> There is no subtree as previously stated in the cn=users area in the AD tree.
>
> Unless I'm misinterpreting the use of the word subtree.

Ah, sorry, my bad. I misinterpreted the groups you are talking about,
thinking they were sub-entries.

So basically, the count you get is equal to what you have, right ?

RE: Apache Directory Studio-incorrect counts via LDAP

Posted by "Hurni, Kevin (ITS)" <Ke...@its.ny.gov>.
There is no subtree as previously stated in the cn=users area in the AD tree.

Unless I'm misinterpreting the use of the word subtree.

--Kevin


-----Original Message-----
From: Emmanuel Lécharny [mailto:elecharny@gmail.com] 
Sent: Wednesday, February 25, 2015 2:32 PM
To: users@directory.apache.org
Subject: Re: Apache Directory Studio-incorrect counts via LDAP

Le 25/02/15 20:26, Hurni, Kevin (ITS) a écrit :
> Hello Stefan,
>
> Thank you again for the idea.  Fortunately (or unfortunately) there were no duplicate DN (I didn't think AD would let you do that anyway).
> HOWEVER, when I exported the list of everything I discovered that someone had accidentally put 3 groups (vs. users) into the CN=Users area in AD, which of course, is allowed, but that seems to explain the count difference.
>
> It seems that Apache displays the number of objects in parenthesis, regardless of the filter/search results.  Not sure if this is normal (you'll notice my previous posting with the filter, I was filtering on objectclass=user).   Although I think MS has objectclass=user on other non-user objects (like file servers, for some reason)
>
> But it's the only way I can find a difference of "3".  

You probably have done a SUBTREE search, which pull all the entries and their descendant...

Re: Apache Directory Studio-incorrect counts via LDAP

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 25/02/15 20:26, Hurni, Kevin (ITS) a écrit :
> Hello Stefan,
>
> Thank you again for the idea.  Fortunately (or unfortunately) there were no duplicate DN (I didn't think AD would let you do that anyway).
> HOWEVER, when I exported the list of everything I discovered that someone had accidentally put 3 groups (vs. users) into the CN=Users area in AD, which of course, is allowed, but that seems to explain the count difference.
>
> It seems that Apache displays the number of objects in parenthesis, regardless of the filter/search results.  Not sure if this is normal (you'll notice my previous posting with the filter, I was filtering on objectclass=user).   Although I think MS has objectclass=user on other non-user objects (like file servers, for some reason)
>
> But it's the only way I can find a difference of "3".  

You probably have done a SUBTREE search, which pull all the entries and
their descendant...

RE: Apache Directory Studio-incorrect counts via LDAP

Posted by "Hurni, Kevin (ITS)" <Ke...@its.ny.gov>.
Hello Stefan,

Thank you again for the idea.  Fortunately (or unfortunately) there were no duplicate DN (I didn't think AD would let you do that anyway).
HOWEVER, when I exported the list of everything I discovered that someone had accidentally put 3 groups (vs. users) into the CN=Users area in AD, which of course, is allowed, but that seems to explain the count difference.

It seems that Apache displays the number of objects in parenthesis, regardless of the filter/search results.  Not sure if this is normal (you'll notice my previous posting with the filter, I was filtering on objectclass=user).   Although I think MS has objectclass=user on other non-user objects (like file servers, for some reason)

But it's the only way I can find a difference of "3".  


-----Original Message-----
From: Stefan Seelmann [mailto:mail@stefan-seelmann.de] 
Sent: Tuesday, February 24, 2015 4:50 PM
To: users@directory.apache.org
Subject: Re: Apache Directory Studio-incorrect counts via LDAP

I suspect there are duplicate entries with same DN. Can you please try to disable alias dereferencing?

Kind Regards,
Stefan

On 02/24/2015 10:12 PM, Hurni, Kevin (ITS) wrote:
> I apologize if I'm doing this wrong, but here goes:
> Apache Directory Studio Version: 2.0.0.v20130628
> 
> I'm using LDAP against a MS Windows 2008 R2 server.
> 
> I constructed a search query.  It runs the query and then next to it, has a number of items such as:
> (3686)
> 
> However, if you either expand the query (click the little arrow), it shows those little folders in bunches of 100, BUT it stops at:
> 3601...3683
> 
> AND
> If I export to a .CSV there are actually only 3683
> 
> So somehow, Directory Studio isn't displaying the correct count in the parenthesis.
> 
> This is the first time I've ever run across this.
> 
> Please let me know how to proceed.
> (Do I report a bug?)
> 
> Thank you
> 
> --Kevin
> 


Re: Apache Directory Studio-incorrect counts via LDAP

Posted by Stefan Seelmann <ma...@stefan-seelmann.de>.
I suspect there are duplicate entries with same DN. Can you please try
to disable alias dereferencing?

Kind Regards,
Stefan

On 02/24/2015 10:12 PM, Hurni, Kevin (ITS) wrote:
> I apologize if I'm doing this wrong, but here goes:
> Apache Directory Studio Version: 2.0.0.v20130628
> 
> I'm using LDAP against a MS Windows 2008 R2 server.
> 
> I constructed a search query.  It runs the query and then next to it, has a number of items such as:
> (3686)
> 
> However, if you either expand the query (click the little arrow), it shows those little folders in bunches of 100, BUT it stops at:
> 3601...3683
> 
> AND
> If I export to a .CSV there are actually only 3683
> 
> So somehow, Directory Studio isn't displaying the correct count in the parenthesis.
> 
> This is the first time I've ever run across this.
> 
> Please let me know how to proceed.
> (Do I report a bug?)
> 
> Thank you
> 
> --Kevin
>