Skip to content

Fix embedded server rebuildIndex failing with Connect Error - #685

Merged
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:features/embedded-rebuild-index-offline
Jul 8, 2026
Merged

Fix embedded server rebuildIndex failing with Connect Error#685
vharseko merged 1 commit into
OpenIdentityPlatform:masterfrom
vharseko:features/embedded-rebuild-index-offline

Conversation

@vharseko

Copy link
Copy Markdown
Member

Problem

EmbeddedDirectoryServer.rebuildIndex() always fails with:

EmbeddedDirectoryServerException: An error occurred while attempting to rebuild index ... Error code is: 1

The tool output shows what actually happens:

Password for user 'cn=Directory Manager':You have provided options for scheduling this operation as a task but options
provided for connecting to the server's tasks backend resulted in the following error: 'Connect Error'

rebuildIndex() is an offline-only operation (it requires the server to be stopped), but RebuildIndexParameters did not pass --offline to the rebuild-index tool. TaskTool runs locally only when --offline is given, so the tool went into task scheduling mode: prompted for the bind password and tried to connect to the tasks backend of the stopped server.

Found by running the slow TestNG group (excluded from CI), where EmbeddedDirectoryServerTestCase.testRebuildIndexOffline fails.

Fix

  • Add --offline to RebuildIndexParameters.toCommandLineArguments().
  • Move EmbeddedDirectoryServerTestCase out of the slow group into the default build (11 tests, ~1 minute). testSetupFromArchive stays in the slow group for now: it fails with "Time service not started" because the slf4j adapter still routes through the stopped main server's error log publishers — it will be enabled together with the fix for that issue.

Verification

  • testRebuildIndexOffline passes (offline rebuild executes and the server restarts).
  • Under the default CI group filter the class runs 11 tests, all green, ~58s.

EmbeddedDirectoryServer.rebuildIndex() is an offline-only operation
(it requires the server to be stopped), but RebuildIndexParameters did
not pass the --offline flag to the rebuild-index tool. Since TaskTool
runs locally only when --offline is given, the tool went into task
scheduling mode instead: it prompted for the bind password and tried
to connect to the tasks backend of the stopped server, failing with
'Connect Error' and exit code 1.
Move EmbeddedDirectoryServerTestCase out of the "slow" group into the
default build (11 tests, ~1 minute). testSetupFromArchive stays in the
"slow" group for now: it fails with "Time service not started" because
the slf4j adapter still routes through the stopped main server's error
log publishers; it will be enabled together with the fix for that.
@vharseko
vharseko merged commit 316a758 into OpenIdentityPlatform:masterJul 8, 2026
33 of 34 checks passed
@vharseko
vharseko deleted the features/embedded-rebuild-index-offline branch July 8, 2026 16:12
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@vharseko@maximthomas