Skip to content

Avoid keystore errors by restoring the clean-appdata-on-build behavior - #391

Merged
mgaffigan merged 1 commit into
OpenIntegrationEngine:mainfrom
mgaffigan:fix/gradle-keystore-modified
Jul 27, 2026
Merged

Avoid keystore errors by restoring the clean-appdata-on-build behavior#391
mgaffigan merged 1 commit into
OpenIntegrationEngine:mainfrom
mgaffigan:fix/gradle-keystore-modified

Conversation

@mgaffigan

@mgaffigan mgaffigan commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Ant used to clear appdata on build. Without that, the following errors occur when starting the server during development after multiple build-run cycles:

ERROR 2026-07-25 18:02:21.925 [Main Server Thread] com.mirth.connect.server.controllers.DefaultConfigurationController: Could not initialize security settings. java.io.IOException: Keystore was tampered with, or password was incorrect at java.base/com.sun.crypto.provider.JceKeyStore.engineLoad(JceKeyStore.java:882) at java.base/java.security.KeyStore.load(KeyStore.java:1473) at com.mirth.connect.server.controllers.DefaultConfigurationController.initializeSecuritySettings(DefaultConfigurationController.java:1239) at com.mirth.connect.server.Mirth.startup(Mirth.java:221) at com.mirth.connect.server.Mirth.run(Mirth.java:169) Caused by: java.security.UnrecoverableKeyException: Password verification failed ... 5 more

This PR restores the historical behavior.

Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
@github-actions

Copy link
Copy Markdown

Test Results

654 tests  ±0   654 ✅ ±0   3m 25s ⏱️ +43s
108 suites ±0     0 💤 ±0 
108 files   ±0     0 ❌ ±0 

Results for commit 0a8874f. ± Comparison against base commit ac47cc8.

@pacmano1

Copy link
Copy Markdown
Contributor

Why all of appdata? Why not just the keystore? I might have channels in mirthdb and I am testing stuff and don't want to re-import those channels. I'd make the full appdata wipe opt-in (a flag) and delete just keystore.jks by default.

@mgaffigan

Copy link
Copy Markdown
Contributor Author

@pacmano1, I was matching the ant behavior. Something that maintains the DB would be nice if you want to submit something.

@pacmano1

Copy link
Copy Markdown
Contributor

@pacmano1, I was matching the ant behavior. Something that maintains the DB would be nice if you want to submit something.

so your ask is a flag to "leave mirthdb"?

@mgaffigan

Copy link
Copy Markdown
Contributor Author

so your ask is a flag to "leave mirthdb"?

My original goal was to modify Gradle to "copy if newer" for config directory. That would avoid the issue, and preserve the database. I couldn't find a clean way to do that, though.

@tonygermano

Copy link
Copy Markdown
Member

Ant used to clear appdata on build.

Ant ran a clean on build and deleted the entire setup folder, so not exactly original behavior.

@mgaffigan
mgaffigan merged commit 8c0ff78 into OpenIntegrationEngine:main Jul 27, 2026
4 checks passed
@mgaffigan
mgaffigan deleted the fix/gradle-keystore-modified branch July 27, 2026 13:20
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

Successfully merging this pull request may close these issues.

5 participants