Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDBC backend differs in behaviour with JE backend #471

Closed
prthakre opened this issue Jan 31, 2025 · 5 comments
Closed

JDBC backend differs in behaviour with JE backend #471

prthakre opened this issue Jan 31, 2025 · 5 comments

Comments

@prthakre
Copy link

Describe the bug
JDBC back-end type throws unique constraint violation while loading same set of entries as in JE back-end

To Reproduce
Steps to reproduce the behavior:

  1. Create TWO LDAP entries with say same mail attribute
  2. Add these to JDBC back-end (postgresql)
  3. Second entry fails to add with Unique constraint violation error.

Expected behavior
The entries should be successfully added to LDAP as is the case in JE.

Screenshots
NONE

Desktop (please complete the following information):

  • OS: macOS
  • Version: 4.9.1

Additional context
Seems like on database side all INDEXES have UNIQUE and PRIMARY constraints.

@vharseko
Copy link
Member

vharseko commented Feb 4, 2025

please check in 4.9.2

@vharseko vharseko closed this as completed Feb 4, 2025
@prthakre
Copy link
Author

prthakre commented Feb 5, 2025

Afraid, this hasn't fixed the issue.
exception while adding entry: org.opends.server.backends.pluggable.spi.StorageRuntimeException: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry 'a2e3a7806db26ce20d48c5280c0617932385fc53c878f9f901baa733cca25623' for key 'opendj_05e5788660277d6827e0bfee937af75409ba17d418746f5b7195308b.PRIMARY'

Is there anything in the logs to pinpoint the original entry causing this?

@vharseko
Copy link
Member

vharseko commented Feb 5, 2025

Please attach script for reproduce

@prthakre
Copy link
Author

prthakre commented Feb 5, 2025

Will prepare custom data to replicate this with JDBC back-end.

@vharseko
Copy link
Member

vharseko commented Feb 5, 2025

please provide "Steps to reproduce" the behavior like:

docker run --rm -it -d -p 5432:5432 -e POSTGRES_DB=database_name -e POSTGRES_PASSWORD=password --name postgres postgres
timeout 5m bash -c 'until docker logs postgres | grep -q "database system is ready to accept connections"; do sleep 5; done'
export OPENDJ_JAVA_ARGS="-server -Xmx512m"
opendj-server-legacy/target/package/opendj/setup -h localhost -p 1389 --ldapsPort 1636 --adminConnectorPort 4444 --enableStartTLS --generateSelfSignedCertificate --rootUserDN "cn=Directory Manager" --rootUserPassword password --cli --acceptLicense --no-prompt
opendj-server-legacy/target/package/opendj/bin/dsconfig create-backend -h localhost -p 4444 --bindDN "cn=Directory Manager" --bindPassword password --backend-name=userRoot --type jdbc --set base-dn:dc=example,dc=com --set db-directory:jdbc:postgresql://localhost:5432/database_name?user=postgres\&password=password --set enabled:true --no-prompt --trustAll
opendj-server-legacy/target/package/opendj/bin/makeldif -o /tmp/test.ldif -c suffix=dc=example,dc=com opendj-server-legacy/target/package/opendj/config/MakeLDIF/example.template
opendj-server-legacy/target/package/opendj/bin/ldapmodify --hostname localhost --port 1636 --bindDN "cn=Directory Manager" --bindPassword password --useSsl --trustAll -f /tmp/test.ldif -a 1> /dev/null
opendj-server-legacy/target/package/opendj/bin/status --bindDN "cn=Directory Manager" --bindPassword password
opendj-server-legacy/target/package/opendj/bin/ldapsearch --hostname localhost --port 1636 --bindDN "cn=Directory Manager" --bindPassword password --useSsl --trustAll --baseDN "dc=example,dc=com" --searchScope base "(objectClass=*)" 1.1
opendj-server-legacy/target/package/opendj/bin/ldapsearch --hostname localhost --port 1636 --bindDN "cn=Directory Manager" --bindPassword password --useSsl --trustAll --baseDN "ou=people,dc=example,dc=com" --searchScope sub "(uid=user.*)" dn | grep ^dn: | wc -l | grep -q 10000
opendj-server-legacy/target/package/opendj/bin/stop-ds

and attach files with data, logs, screenshots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants