Fix duplicate SNMP connection handler entries in packaged config.ldif#659
Open
vharseko wants to merge 1 commit into
Open
Fix duplicate SNMP connection handler entries in packaged config.ldif#659vharseko wants to merge 1 commit into
vharseko wants to merge 1 commit into
Conversation
The `snmp` profile assembles the server template config.ldif in two antrun steps: `copy-config-ldif` copies the pristine resource/config/config.ldif into target/template/config, and `generate-config-ldif` appends config.snmp.ldif to it with `concat append="true"`. The copy used Ant's default `overwrite="false"`, so on an incremental build (without `clean`) the already-populated target file was newer than the source and was not refreshed, while the concat appended the SNMP fragment again on every build. Repeated builds therefore accumulated several `cn=SNMP Connection Handler,cn=Connection Handlers,cn=config` entries, and `setup` then failed with "Entry Already Exists ... multiple times". Add `overwrite="true"` to the config.ldif copy so the SNMP fragment is always appended to a freshly copied base file, making config.ldif generation idempotent regardless of incremental builds.
maximthomas
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix duplicate
cn=SNMP Connection Handlerentries that accumulate in the packaged serverconfig.ldif, which makessetupfail with Entry Already Exists after repeated (incremental) builds.Root cause
The
snmpprofile assembles the templateconfig.ldifin twomaven-antrun-pluginsteps inopendj-server-legacy/pom.xml:copy-config-ldif(generate-resources) copies the pristineresource/config/config.ldiftotarget/template/config/config.ldif.generate-config-ldif(prepare-package) appendsconfig.snmp.ldifwith<concat ... append="true">.The copy used Ant's default
overwrite="false". On an incremental build (withoutclean) the already-generated target file is newer than the source, so the copy is skipped and the file is not reset — while the concat appends the SNMP fragment again on every build, without checking whether it is already present. After N lifecycle runs that reachprepare-package, the file ends up with N copies of:and
setupaborts:Fix
Force the base
config.ldifcopy to overwrite, so the SNMP fragment is always appended to a freshly copied file. Generation becomes idempotent regardless of incremental builds.Testing
mvn -pl opendj-server-legacy package(noclean) → 5× SNMP entry intarget/package/opendj/template/config/config.ldif;setupfails with Entry Already Exists.packageruns keep it at 1;setup ... --sampleData 5000completes and the server starts normally.Affected files
opendj-server-legacy/pom.xml(1 line)