{"record":{"id":"21297714add2baeb","repo":"RocketChat/Rocket.Chat","slug":"the-value-of-the-setting-ldap-background-synchron","errorCode":null,"errorMessage":"The value of the setting 'LDAP background synchronization interval' has changed from \"${ldapSyncInterval.value}\" to \"${newLdapDefault}\". Please review your settings.","messagePattern":"The value of the setting 'LDAP background synchronization interval' has changed from \"(.+?)\" to \"(.+?)\"\\. Please review your settings\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/startup/migrations/v295.ts","lineNumber":34,"sourceCode":"\t\tconst newCrowdDefault = 'every_1_hours';\n\n\t\tconst ldapSyncInterval = await Settings.findOneById<Pick<ISetting, 'value'>>('LDAP_Background_Sync_Interval', {\n\t\t\tprojection: { value: 1 },\n\t\t});\n\t\tconst crowdSyncInterval = await Settings.findOneById<Pick<ISetting, 'value'>>('CROWD_Sync_Interval', { projection: { value: 1 } });\n\n\t\t// update setting values\n\t\tawait updateAuditedBySystem({\n\t\t\treason: 'Migration 295',\n\t\t})(Settings.updateValueById, 'LDAP_Background_Sync_Interval', newLdapDefault);\n\t\tawait updateAuditedBySystem({\n\t\t\treason: 'Migration 295',\n\t\t})(Settings.updateValueById, 'CROWD_Sync_Interval', newCrowdDefault);\n\n\t\t// notify user about the changes if the value was different from the default\n\n\t\tif (ldapSyncInterval && ldapSyncInterval.value !== oldLdapDefault) {\n\t\t\tSystemLogger.warn(\n\t\t\t\t`The value of the setting 'LDAP background synchronization interval' has changed from \"${ldapSyncInterval.value}\" to \"${newLdapDefault}\". Please review your settings.`,\n\t\t\t);\n\t\t}\n\n\t\tif (crowdSyncInterval && crowdSyncInterval.value !== oldCrowdDefault) {\n\t\t\tSystemLogger.warn(\n\t\t\t\t`The value of the setting 'CROWD background synchronization interval' has changed from \"${crowdSyncInterval.value}\" to \"${newCrowdDefault}\". Please review your settings.`,\n\t\t\t);\n\t\t}\n\t},\n});\n","sourceCodeStart":16,"sourceCodeEnd":46,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/startup/migrations/v295.ts#L16-L46","documentation":"Logged by database migration 295 ('Change old LDAP_Background_Sync_Interval ... to pre-defined values') during server startup on first boot after upgrade. The setting changed from free-text (old default 'Every 24 hours') to a select with fixed options; the migration unconditionally writes 'every_24_hours' via updateAuditedBySystem, and warns only when the workspace had a NON-default value (ldapSyncInterval.value !== 'Every 24 hours'), because that custom interval is being silently discarded.","triggerScenarios":"Migration 295 runs (version bump from a release older than it). The pre-upgrade read of LDAP_Background_Sync_Interval returns a document whose value is anything other than 'Every 24 hours' — e.g. 'Every 1 hours', 'Every 12 hours', or custom text typed into the old free-text field. The value is overwritten with 'every_24_hours' and the warning, containing the old and new values, is printed once.","commonSituations":"Upgrading a workspace where admins had tuned LDAP background sync to run hourly or every few hours to keep external-directory users in sync faster; admins who typed arbitrary strings into the old free-text interval field. After the migration, sync frequency silently becomes once a day, which can surprise large organizations relying on frequent sync.","solutions":["After upgrading, open Admin -> LDAP -> Background Sync and set 'LDAP background synchronization interval' back to the cadence you need (the new select offers predefined options such as every hour).","Pre-upgrade: note your current interval value so you know what to restore; the warning message itself prints the old value.","If you run CROWD too, check the companion CROWD_Sync_Interval warning — the same migration changed it.","Verify the audited change log shows 'Migration 295' as the actor for the update, so you can distinguish migration changes from manual ones."],"exampleFix":"// after migration 295 reset your cadence (server-side example)\nawait Settings.updateValueById('LDAP_Background_Sync_Interval', 'every_1_hours'); // pick a supported option\n// available options follow the pattern 'every_N_hours' / 'every_24_hours'","handlingStrategy":"validation","validationCode":"// Pre-upgrade check: will migration 295 discard my custom LDAP interval?\nconst current = await Settings.getValueById('LDAP_Background_Sync_Interval');\nif (current && current !== 'Every 24 hours') {\n  console.log(`Custom interval \"${current}\" will be reset to every_24_hours by migration 295 — re-set it after upgrade`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Before major upgrades, export non-default values of LDAP_Background_Sync_Interval and CROWD_Sync_Interval so intent is recoverable.","After upgrading past migration 295, re-open Admin -> LDAP -> Background Sync and choose the desired predefined cadence.","Read the migration notes for releases you cross; interval settings that become selects lose free-text values by design."],"tags":["migration","ldap","settings","upgrade","breaking-change"],"backgroundTag":"migration-overwrote-setting","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}