web stats
Mirth DB connection trouble to AWS RDS - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 01-29-2020, 01:08 PM
bherold bherold is offline
What's HL7?
 
Join Date: Jan 2020
Posts: 5
bherold is on a distinguished road
Default Mirth DB connection trouble to AWS RDS

Hello,

I'm attempting to connect Mirth to a new AWS RDS instance we set up. We are moving from an EC2.

Mirth is unable to connect to the AWS RDS DB, I keep receiving a connection error when I attempt to launch.

ERR_CONNECTION_REFUSED

Nothing really shows up in the Mirth log for this.

I am able to connect to the AWS RDS instance via SQL from the same server Mirth is on using the same username and password so I know the communication does work. The string I use to connect via SQL is as follows "rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com,1433"

However, Mirth does not like the comma, the Server Manager does not even start when a comma is in the URL string.

I have tried a ton of different string formats but cannot get a connection. Here are just some examples that I tried. For each of these examples I have tried to add/remove the quotes, semicolon, the 1433, etc.

jdbc:jtds:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com:1433/mirthdb
jdbc:jtds:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com:1433/mirthdb;
jdbc:jtds:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com/mirthdb
jdbc:jtds:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com/mirthdb;
jdbc:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com:1433/mirthdb
jdbc:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com:1433/mirthdb;
jdbc:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com/mirthdb
jdbc:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com/mirthdb;
jdbc:sqlserver://prddbsp.ccj5ypbzm0x1.us-east-1.rds.amazonaws.com,1433;instance=mirthdbA0Test;
jdbc:sqlserver://prddbsp.ccj5ypbzm0x1.us-east-1.rds.amazonaws.com,1433;instance='mirthdbA0Test'

I have also tried to download the Microsoft driver and update the dbdrivers file, but this also is not helping.

I'm on Mirth 3.8 and Java 1.8

Any feedback would be great.

Bob
Reply With Quote
  #2  
Old 01-30-2020, 08:07 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 615
kirbykn2 is on a distinguished road
Default

Did you load the MS SQL driver onto the MC server?
Is the SQL traffic from your MC server to the RDS DB allowed?

I am just starting an AWS project, and will also be attempting to run the MC DB on RDS.
__________________
Best,

Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.4
Mirth Connect Version 3.8.0
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_181-b13
PostgreSQL Version 9.6.8
Reply With Quote
  #3  
Old 01-30-2020, 08:21 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 1,175
agermano is on a distinguished road
Default

According to this: https://docs.aws.amazon.com/AmazonRD...rInstance.JDBC

Have you tried
Code:
jdbc:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com:1433
Reply With Quote
  #4  
Old 01-31-2020, 05:20 AM
bherold bherold is offline
What's HL7?
 
Join Date: Jan 2020
Posts: 5
bherold is on a distinguished road
Default

Yes, we had the MS driver on the same server as MC, and yes the SQL traffic was able to reach the RDS instance.

I did also try various versions of jdbc:sqlserver://rds-instance-name.endpoint.us-ABC-X.rds.amazonaws.com:1433 with both drivers, but no success.

Bob
Reply With Quote
  #5  
Old 01-31-2020, 05:48 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 615
kirbykn2 is on a distinguished road
Default

What happens when you try to telnet from the MC server to the RDS db port?
__________________
Best,

Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.4
Mirth Connect Version 3.8.0
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_181-b13
PostgreSQL Version 9.6.8
Reply With Quote
  #6  
Old 01-31-2020, 06:23 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 615
kirbykn2 is on a distinguished road
Default

* I spun up a new RDS instance.
* Create a new db called mirthdb.
* used this is the url connection string for the db "jdbc:jtds:sqlserver://MYINSTANCE.us-east-1.rds.amazonaws.com:1433/mirthdb"
* restarted the Mirth service.

It worked without issue.

I've attached a screenshot.
__________________
Best,

Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.4
Mirth Connect Version 3.8.0
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_181-b13
PostgreSQL Version 9.6.8
Reply With Quote
  #7  
Old 02-03-2020, 09:13 AM
bherold bherold is offline
What's HL7?
 
Join Date: Jan 2020
Posts: 5
bherold is on a distinguished road
Default

Hello, I was told telnet cannot be enabled on the RDS instance, as AWS RDS is a managed service that only exposes the connection endpoint.

I am able to connect to RDS from SSMS.

I attached an image of my db string, it does seem to match yours. But when I attempt to start the service, it just fails. I did receive something in the error log this time. I attached the latest entry. Here is the start of the error

ERROR 2020-02-03 12:06:02,048 [Main Server Thread] com.mirth.connect.server.Mirth: Error establishing connection to database, aborting startup. I/O Error: DB server closed connection.
INFO 2020-02-03 12:06:02,050 [Shutdown Hook Thread] com.mirth.connect.server.Mirth: shutting down mirth due to normal request
ERROR 2020-02-03 12:06:02,121 [Shutdown Hook Thread] com.mirth.connect.server.controllers.DefaultConfig urationController: Could not retrieve property: category=core, name=channelDependencies
org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: com.zaxxer.hikari.pool.HikariPool$PoolInitializati onException: Failed to initialize pool: I/O Error: DB server closed connection.
### The error may exist in sqlserver/sqlserver-configuration.xml
### The error may involve Configuration.selectProperty
### The error occurred while executing a query
### Cause: com.zaxxer.hikari.pool.HikariPool$PoolInitializati onException: Failed to initialize pool: I/O Error: DB server closed connection.

Bob
Attached Images
File Type: jpg mirth settings.JPG (29.7 KB, 1 views)
File Type: jpg error.JPG (12.5 KB, 1 views)
Attached Files
File Type: txt error log.txt (5.1 KB, 2 views)
Reply With Quote
  #8  
Old 02-04-2020, 06:20 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 615
kirbykn2 is on a distinguished road
Default

You don't enable telnet on an RDS instance. I was suggesting using Telent to verify that the port is open.

My guess is your RDS instance is not configured correctly to allow connection from the Mirth Server.

You need to verify the communication over the port your using is working from the MC server to the RDS db. You also need to verify that the user you are using has the appropriate permissions to the RDS db.
__________________
Best,

Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.4
Mirth Connect Version 3.8.0
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_181-b13
PostgreSQL Version 9.6.8
Reply With Quote
  #9  
Old 02-10-2020, 07:01 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 615
kirbykn2 is on a distinguished road
Default

Any luck?

I've gone through this process a couple of times now, with a few different SQL server types.

Here are some things to review.

* NAL
* Allow appropriate port traffic for db type
* Security Groups
* Choose correct subnet
* Confusion between instance name and database name
* Can/should your db be accessible from the public?
* Connection String
* DB user permissions

I always use a SQL client to connect to the RDS instance from the server I am running MC on. This is helpful to troubleshoot connection issues. Also, remember to view the Mirth logs.
__________________
Best,

Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.4
Mirth Connect Version 3.8.0
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_181-b13
PostgreSQL Version 9.6.8
Reply With Quote
  #10  
Old 02-13-2020, 12:01 PM
bherold bherold is offline
What's HL7?
 
Join Date: Jan 2020
Posts: 5
bherold is on a distinguished road
Default

Hello, thanks for your continued help on this and sorry for the delay. I was just able to meet with our team to resolve this issue.

The issue was that the RDS instance was enforcing ssl encryption which doesn't seem to work for the mirth connection. Once this was disabled, mirth was able to connect to RDS.

Bob
Reply With Quote
Reply

Tags
aws, database, mirth, rds

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:18 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation