Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    _ChezW@m_
    @JrmChP_twitter
    ok
    _ChezW@m_
    @JrmChP_twitter
    I restart everything ? or just ldap & webapp need to run ?
    François Armand
    @fanf
    just ldap and webapp should be enough
    @JrmChP_twitter can you also make a grep "Purged " into/var/log/rudder/webapp/` ? Old software may not be deleted, which would make the duration worse
    _ChezW@m_
    @JrmChP_twitter

    grep "Purged" /var/log/rudder/webapp/*

    doesn't return anything.

    still waiting for the pre_commit_inventory message
    got it:
    [2021-01-07 18:26:42+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:merge_uuid': 350524 ms
    Alexis Mousset
    @amousset
    that's a lot of milliseconds
    _ChezW@m_
    @JrmChP_twitter
    :-)
    _ChezW@m_
    @JrmChP_twitter
    [2021-01-07 18:29:53+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:merge_uuid': 179560 ms
    second one is better...
    Alexis Mousset
    @amousset
    but still unreasonably high
    _ChezW@m_
    @JrmChP_twitter
    yep
    should i put the indexes back ?
    François Armand
    @fanf
    yes please, and reindex :/
    _ChezW@m_
    @JrmChP_twitter
    first was long... but then it seems better...
    [2021-01-07 20:39:34+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:merge_uuid': 228292 ms
    [2021-01-07 20:39:34+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:check_machine_cn': 1 ms
    [2021-01-07 20:39:34+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:set_last_inventory_date': 0 ms
    [2021-01-07 20:39:34+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:add_ip_values': 1 ms
    [2021-01-07 20:39:34+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:log_inventory': 4 ms
    [2021-01-07 20:39:39+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:check_os_type_is_known': 0 ms
    François Armand
    @fanf
    it's just the merge_uuid that is long
    other are always quick
    so, there is something very strange with that. Indexes should change something, and they don't seem to do anything at all
    I'm a bit lost
    François Armand
    @fanf
    was it a full reindex ?
    _ChezW@m_
    @JrmChP_twitter
    nope juste quick
    [2021-01-07 20:43:01+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:merge_uuid': 201982 ms
    [2021-01-07 20:43:01+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:check_machine_cn': 0 ms
    [2021-01-07 20:43:01+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:set_last_inventory_date': 0 ms
    [2021-01-07 20:43:01+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:add_ip_values': 0 ms
    [2021-01-07 20:43:01+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:log_inventory': 1 ms
    [2021-01-07 20:43:03+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:check_os_type_is_known': 0 ms
    [2021-01-07 20:45:55+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:merge_uuid': 171494 ms
    [2021-01-07 20:45:55+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:check_machine_cn': 0 ms
    [2021-01-07 20:45:55+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:set_last_inventory_date': 0 ms
    [2021-01-07 20:45:55+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:add_ip_values': 1 ms
    [2021-01-07 20:45:55+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:log_inventory': 0 ms
    [2021-01-07 20:45:58+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:check_os_type_is_known': 0 ms
    [2021-01-07 20:50:16+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:merge_uuid': 257570 ms
    [2021-01-07 20:50:16+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:check_machine_cn': 0 ms
    [2021-01-07 20:50:16+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:set_last_inventory_date': 0 ms
    [2021-01-07 20:50:16+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:add_ip_values': 0 ms
    [2021-01-07 20:50:16+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:log_inventory': 1 ms
    [2021-01-07 20:50:23+0100] TRACE inventory-logger.timing - Precommit 'pre_commit_inventory:check_os_type_is_known': 0 ms
    this is not that good...
    François Armand
    @fanf
    I believe there is just too many garbage softwares, if they are never purged. I don't understand why you don't have the regular Purged XXX unreferenced softwares logs
    _ChezW@m_
    @JrmChP_twitter
    is there a way to purge manually ?
    /var/log/rudder/webapp/2021_01_07.stderrout.log.111542556:[2021-01-07 01:12:38+0100] DEBUG inventory-processing - Found 855621 unreferenced software in ou=software, going to delete them
    /var/log/rudder/webapp/2021_01_07.stderrout.log.111542556:[2021-01-07 01:20:36+0100] ERROR scheduled.job - Error when deleting unreferenced softwares; cause was: Accumulated: BackendException: Error when doing action 'delete' with and LDIF change request: null; cause was: com.unboundid.ldap.sdk.LDAPException: A client-side timeout was encountered while waiting 30001ms for a response to delete request with message ID 29193 for entry 'softwareId=14418e68-9ffb-485f-9e1d-65d62acecf19,ou=Software,ou=Inventories,cn=rudder-configuration' from server localhost:389.
    maybe a timeout can be extended?
    François Armand
    @fanf
    I just saw that too
    hum
    @JrmChP_twitter do you use dynamic groups with query based on software? (name, version, etc ?)
    _ChezW@m_
    @JrmChP_twitter
    dynamic groups yes. With some hooks to see if for exemple Proftp is installed.
    hook creates a properties on true or false to tell us if software is installed.
    _ChezW@m_
    @JrmChP_twitter
    most of the groups are based on the existence of a defined node property
    François Armand
    @fanf
    OK, next plan: let me build the cleaning script by hand, we will run it in command line
    _ChezW@m_
    @JrmChP_twitter
    ok :-)
    François Armand
    @fanf
    so, first, find all unused software. Create de directory for work, and go in it. Then:
    • all softwares: ldapsearch -LLL -o ldif-wrap=no -h localhost -p 389 -x -D "cn=Manager,cn=rudder-configuration" -w LDAP_PASS_FROM_rudder-passwords_file -b "ou=Software,ou=Inventories,cn=rudder-configuration" -s sub 1.1 | sort | uniq | cut -d: -f2 > all-soft-sorted.dns
    • nodes softwares: ldapsearch -LLL -o ldif-wrap=no -h localhost -p 389 -x -D "cn=Manager,cn=rudder-configuration" -w LDAP_PASS -b "ou=Nodes,ou=Accepted Inventories,ou=Inventories,cn=rudder-configuration" -s one 'nodeId=*' software | grep softwareId | sort | uniq | cut -d: -f2 > nodes-soft-sorted.dns
    • software to delete: grep -f nodes-soft-sorted.dns -v all-soft-sorted.dns > soft-to-delete.dns
    • then delete: ldapdelete -h localhost -p 389 -x -D "cn=Manager,cn=rudder-configuration" -w LDAP_PASS -f soft-to-delete.dns
    François Armand
    @fanf
    you should have around 855600 lines in soft-to-delete.dns
    hope it helps
    OH
    please do an archive of ldap content before that, and be ready to restore. Procedure was just tested on one of our lab env, one time, now, so... Well. It should work
    but better safe than sorry
    François Armand
    @fanf
    perhaps you will need to split the very big file by 1000 lines. Perhaps it's better to stop rudder webapp while you do that to avoid stressing even more openldap
    I need to go, bye
    _ChezW@m_
    @JrmChP_twitter
    ok cool. i'll test that tomorrow.
    good night
    _ChezW@m_
    @JrmChP_twitter
    Hello @fanf ldapdelete doesn't work :
    ldapdelete -h localhost -p 389 -x -D "cn=Manager,cn=rudder-configuration" -w MYPASS  -f soft-to-delete.dns
    ldap_delete: Operation not allowed on non-leaf (66)
        additional info: subordinate objects must be deleted first
    819639 lines in soft to delete
    François Armand
    @fanf
    @JrmChP_twitter hello, perhaps there is a middle node remaining, likely ou=Software,ou=Inventories,cn=rudder-configuration. You can either remove that line from soft-to-delete.dns or add the -c option to continu to other softwares
    _ChezW@m_
    @JrmChP_twitter
    yeah you were right. Delete is in progress...