Project

General

Profile

Actions

Bug #3404

closed

Searching on Last Inventory Date is not working in Rudder 2.4

Added by Nicolas CHARLES over 9 years ago. Updated about 9 years ago.

Status:
Released
Priority:
2
Category:
Web - Nodes & inventories
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Regression:

Description

Dennis Cabooter, in ticket #3394 says :
"searching on Last Inventory Date is not working in Rudder 2.5, which is a useful search criterium."

To be more precise, the search with "=" does not work as expected, because the full datetime of inventory is taken into account, but the time is never chosen by the user (midnight is used).


Related issues 2 (0 open2 closed)

Related to Rudder - Bug #3425: The datepickers in Rudder are always the French onesReleasedFrançois ARMAND2013-04-11Actions
Related to Rudder - Bug #3437: "Global time settings: Time zone" errorReleasedMatthieu CERDA2013-04-12Actions
Actions #1

Updated by Nicolas CHARLES over 9 years ago

Dennis, I've been trying to reproduce this bug, without success.
Could you explain in detail what is not working for you?

Thanks

Actions #2

Updated by Dennis Cabooter over 9 years ago

No matter which date I choose, I always get "No data available in table". How can I help you with more info?

Actions #3

Updated by Nicolas CHARLES over 9 years ago

Hum, that's weird.
Just to be sure, the format on the node inventory is like this one 2013-04-11 00:51 ?

And when you search, the format is like 10/04/2013 ?

(I'm suspecting a locale problem)

Actions #4

Updated by Dennis Cabooter over 9 years ago

This is exactly what happens. Also, the calendar to choose from is (partly) in French.

Actions #5

Updated by Dennis Cabooter over 9 years ago

What can I do to fix the locale problem?

Actions #6

Updated by Dennis Cabooter over 9 years ago

I can see the following in the reports, since the Rudder server is a client as well. However, the reports doesn't say why it fails.

- Time zone  Error
  - Value  Message                                                           Status
    None   Time zone could not be set (localtime file could not be changed)  Error
Actions #7

Updated by Nicolas CHARLES over 9 years ago

Ha ? In which report do you find this message ?

Actions #8

Updated by Nicolas CHARLES over 9 years ago

I've opened a bug for the datepicker problem, which might or might not be related
http://www.rudder-project.org/redmine/issues/3425

Actions #9

Updated by Dennis Cabooter over 9 years ago

- Rule: Global time settings
  - Directive: Global time settings
    - Component: Time zone
      - Value: None
      - Message: Time zone could not be set (localtime file could not be changed)
      - Status: Error

Did you also get that the calendar is (partly) in French?

Actions #10

Updated by Nicolas CHARLES over 9 years ago

Dennis Cabooter wrote:

[...]

Did you also get that the calendar is (partly) in French?

Yes, that's the ticket http://www.rudder-project.org/redmine/issues/3425
It may looks related, but not completly, hence the new ticket

Actions #11

Updated by Dennis Cabooter over 9 years ago

Removing /etc/localtime makes the following error dissappear:

R: @@ntpConfiguration@@result_error@@87cd8f51-de03-43e4-88ea-bb4d55c27878@@342fc6d5-9399-4a93-87e0-9c7efd2d9727@@19@@Time 
zone@@None@@2013-04-1213:05:34+02:00##root@#Time zone could not be set (localtime file could not be changed)

After running cf-agent -KI a symlink is created:

lrwxrwxrwx 1 root root 25 Apr 12 11:07 /etc/localtime -> ../posix/Europe/Amsterdam

Running cf-agent -KI now produces the following output:

 -> Link /etc/localtime as promised
R: @@ntpConfiguration@@log_info@@87cd8f51-de03-43e4-88ea-bb4d55c27878@@342fc6d5-9399-4a93-87e0-9c7efd2d9727@@19@@Time zone@@None@@2013-04-12 
11:07:46+00:00##root@#Time zone was already set (localtime file didn't need changing)
Actions #12

Updated by Dennis Cabooter over 9 years ago

I will create a separate issue from the last post, since it has nothing to do with this issue.

Actions #13

Updated by Matthieu CERDA over 9 years ago

This separate issue mentioned here is awaiting a review.

Actions #14

Updated by François ARMAND over 9 years ago

Hello Dennis,

About your problem with search, could you please:

- validate that you have at least one accepted node with a value for "Inventory date" (on node detail, it's in tab "node summary", in "Rudder information" section) - that is just to be sure :)
- set Rudder log level to "debug" (change <root level="info"> to <root level="debug"> in /opt/rudder/etc/logback.xml
- restart Rudder, now you should be able to see how Rudder translate search into LDAP queries. For example, for a search with parameter "Node summaray, Last inventory date, =<, 23/09/2011", I see:

[2013-04-16 14:11:54] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [692208163279] Start search for { returnType:'NodeReturnType' with 'And' criteria [node.inventoryDate lteq 23/09/2011] }
[2013-04-16 14:11:54] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [692208163279] |- LDAPObjectType(ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration,One,Some((inventoryDate<=20110922220000.000Z)),DNJoin,Set())
[2013-04-16 14:11:54] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [692208163279] |--- SearchRequest(baseDN='ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration', scope=ONE, deref=NEVER, sizeLimit=1000, timeLimit=10, filter='(inventoryDate<=20110922220000.000Z)', attrs={policyServerId, osFullName, localAdministratorAccountName, cn, createTimestamp, agentName, ipHostNumber, publicKey, nodeId, nodeHostname, objectClass})
[2013-04-16 14:11:54] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [692208163279] |---- 1 result(s)
[2013-04-16 14:11:54] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [692208163279] `-> 1 results

When you have such a query log available, could you post it so that we can be sure that the date is correctly interpreted or if we see other strange things ?

Thanks for your help, I hope we will be able to find a solution soon.

Actions #15

Updated by Dennis Cabooter over 9 years ago

[2013-05-07 11:41:33] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [181942231907] Start search for { returnType:'NodeReturnType' with 'And' criteria [node.inventoryDate eq 07/05/2013] }
[2013-05-07 11:41:33] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [181942231907] |- LDAPObjectType(ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration,One,Some((inventoryDate=20130506220000.000Z)),DNJoin,Set())
[2013-05-07 11:41:33] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [181942231907] |--- SearchRequest(baseDN='ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration', scope=ONE, deref=NEVER, sizeLimit=1000, timeLimit=10, filter='(inventoryDate=20130506220000.000Z)', attrs={policyServerId, osFullName, localAdministratorAccountName, cn, createTimestamp, agentName, ipHostNumber, publicKey, nodeId, nodeHostname, objectClass})
[2013-05-07 11:41:33] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [181942231907] |---- 0 result(s)
[2013-05-07 11:41:33] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [181942231907] `-> 0 results

Actions #16

Updated by Dennis Cabooter over 9 years ago

This is the debug log if I use < instead of =

[2013-05-07 11:46:42] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [949770325652] Start search for { returnType:'NodeReturnType' with 'And' criteria [node.inventoryDate lt 07/05/2013] }
[2013-05-07 11:46:42] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [949770325652] |- LDAPObjectType(ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration,One,Some((&(inventoryDate=*)(!(inventoryDate>=20130506220000.000Z)))),DNJoin,Set())
[2013-05-07 11:46:42] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [949770325652] |--- SearchRequest(baseDN='ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration', scope=ONE, deref=NEVER, sizeLimit=1000, timeLimit=10, filter='(&(inventoryDate=*)(!(inventoryDate>=20130506220000.000Z)))', attrs={policyServerId, osFullName, localAdministratorAccountName, cn, createTimestamp, agentName, ipHostNumber, publicKey, nodeId, nodeHostname, objectClass})
[2013-05-07 11:46:42] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [949770325652] |---- 2 result(s)
[2013-05-07 11:46:42] DEBUG com.normation.rudder.services.queries.InternalLDAPQueryProcessor - [949770325652] `-> 2 results
Actions #17

Updated by François ARMAND over 9 years ago

  • Description updated (diff)

The problem is that the comparison is done in both date and time, but the user only choose a date, and so the time is set "midnight" (which is very rarely the time when the inventory was done).

Actions #18

Updated by François ARMAND over 9 years ago

  • Subject changed from Searching on Last Inventory Date is not working in Rudder 2.5 to Searching on Last Inventory Date is not working in Rudder 2.4
  • Status changed from New to Pending technical review
  • Assignee set to Nicolas CHARLES
  • Priority changed from N/A to 2
  • Target version set to 2.4.6
  • Pull Request set to https://github.com/Normation/rudder/pull/208
Actions #19

Updated by François ARMAND over 9 years ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100
Actions #21

Updated by Nicolas PERRON about 9 years ago

  • Status changed from Pending release to Released
Actions

Also available in: Atom PDF