nextgenhealthcare / connect

The swiss army knife of healthcare integration.
Other
915 stars 275 forks source link

[BUG] Unable to save SMTP settings on New Fresh Mirth 4.0.1 install on Windows 2022 #5228

Open Rippenator opened 2 years ago

Rippenator commented 2 years ago

Mirth Log.txt

I have setup two new Servers on Windows 2022 using Mirth Connect 4.0.1 The problem exists on both servers. I am not able to save the SMTP information. After I enter in data I can send a test message, but after I refresh information is blank and log has errors

To Reproduce Under Settings Add SMTP Host Add SMTP Port Set Default From Address. Send test message. (Works) Refresh and settings are gone Look at server Log

Steps to reproduce the behavior: See above

Expected behavior The SMTP values save in the databse

Actual behavior The SMTP values are not saved.

Screenshots Attached Log

Environment (please complete the following information):

Workaround(s) No Workarounds

Additional context Add any other context about the problem here.

pacmano1 commented 2 years ago

Do both these servers use the same mirthDB?

Rippenator commented 2 years ago

Yes they do, but with different schemas.

~Jeff R. Ripp

From: pacmano1 @.> Sent: Thursday, June 2, 2022 3:08 PM To: nextgenhealthcare/connect @.> Cc: Ripp, Jeff @.>; Author @.> Subject: Re: [nextgenhealthcare/connect] [BUG] Unable to save SMTP settings on New Fresh Mirth 4.0.1 install (Issue #5228)

Do both these servers use the same mirthDB?

— Reply to this email directly, view it on GitHubhttps://github.com/nextgenhealthcare/connect/issues/5228#issuecomment-1145293964, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZH2GENCLUUJTXMSBDNZ54TVNEIDVANCNFSM5XWCHORA. You are receiving this because you authored the thread.Message ID: @.**@.>>


LEGAL DISCLAIMER: This message and all attachments may be confidential or protected by privilege. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or use of the information contained in or attached to this message is strictly prohibited. Please notify the sender of the delivery error by replying to this message and then delete it from your system. Thank you.

pacmano1 commented 2 years ago

I suspect for Nextgen to look at this you will need to provide more specifics. I have used the same db server with different named databases for each mirth instance. I have not used the same database with unique schemas for miirth's data store (so sharing your db connect string might help). The error suggests the row already exissts in the table and it came from somwhere, either the other engine or the engine your are on and there is some problem in mirth or permissions. If you confirm that row is empty before your start and not empty after you save it and so on, that would help also.

Rippenator commented 2 years ago

This was from our DBA.
I can confirm that the row was empty before you started the install and not empty after you saved it. You didn’t run any other Mirth installs in test, so I don’t think the row came from “the other engine”. So it had to come from the engine you are on. If the problem was permissions you wouldn’t have been able to insert anything into the table, or even create the table. So I think the problem is in Mirth. The scary thing is that they say they have never used the same database with different schemas for Mirth’s data stores. Is that no longer possible with the upgraded version of Mirth? It works fine in both test and prod in the old version.

pacmano1 commented 2 years ago

What DB engine? And I assume you have added the extra vmoptions required for java 9+. Share the mirth.properties jdbc connection string for both servers (remove private stuff of course).

Rippenator commented 2 years ago

The DB engine is Oracle (version 19.14.0.0.0 Enterprise edition). It’s the same for both the test and dev Mirth engines. Only the database schema name is different.

jdbc:oracle:thin:@slhtora-a:1521/TEST21

Also I did add the extra vmoptions. Without them it would not connect.

pacmano1 commented 2 years ago

The JDBC connection string is the thing Mack sent you. huh?

Anyway, it's Oracle, I'm out.

Rippenator commented 2 years ago

@pacmano1 Sorry I forgot to edit the message before I posted it.

pacmano1 commented 2 years ago

No worries at all. I just don't touch Oracle.

Rippenator commented 2 years ago

This is the error that is causing the problem

ERROR 2022-06-02 12:53:17,801 [ConfigurationServlet Thread (Set server settings) < qtp1381671334-36] com.mirth.connect.server.controllers.DefaultConfigurationController: Could not store property: category=core, name=smtp.password org.apache.ibatis.exceptions.PersistenceException: Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: ORA-00001: unique constraint (MIRTHTEST3.SYS_C0023196) violated

ab-20-m commented 2 years ago

The issue is a combination of Oracle treating empty-string as null and how the DefaultConfigurationController.saveProperty(category,name,value) assumes a null results from DefaultConfigurationController.getProperty(category, name) means the record doesn't exist.

The workaround would be to manually set some value in the database records for smtp.passsword and smtp.user properties and the values should then stick. The same mis-behavior can be observed for the following settings:

Rippenator commented 2 years ago

Yeah that is what we had to do for a workaround, but it then involves getting the DBA to make changes. Is this by design?

~Jeff R. Ripp

From: ab-20-m @.> Sent: Tuesday, June 28, 2022 11:06 AM To: nextgenhealthcare/connect @.> Cc: Ripp, Jeff @.>; Author @.> Subject: Re: [nextgenhealthcare/connect] [BUG] Unable to save SMTP settings on New Fresh Mirth 4.0.1 install on Windows 2022 (Issue #5228)

The issue is a combination of Oracle treating empty-string as null and how the DefaultConfigurationController.saveProperty(category,name,value) assumes a null results from DefaultConfigurationController.getProperty(category, name) means the record doesn't exist. https://github.com/nextgenhealthcare/connect/blob/74e70c466d1ec72e19ae020e893210a40f037d9b/server/src/com/mirth/connect/server/controllers/DefaultConfigurationController.java#L990-L994

The workaround would be to manually set some value in the database records for smtp.passsword and smtp.user properties and the values should then stick. The same mis-behavior can be observed for the following settings:

— Reply to this email directly, view it on GitHubhttps://github.com/nextgenhealthcare/connect/issues/5228#issuecomment-1168916498, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AZH2GEOU5YP63F35TQOL3NTVRMPGXANCNFSM5XWCHORA. You are receiving this because you authored the thread.Message ID: @.**@.>>


LEGAL DISCLAIMER: This message and all attachments may be confidential or protected by privilege. If you are not the intended recipient you are hereby notified that any disclosure, copying, distribution, or use of the information contained in or attached to this message is strictly prohibited. Please notify the sender of the delivery error by replying to this message and then delete it from your system. Thank you.