Announcement

Collapse
No announcement yet.

Mirth DB connection trouble to AWS RDS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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

    Comment


    • #3
      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

      Comment


      • #4
        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

        Comment


        • #5
          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

          Comment


          • #6
            * 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.
            Attached Files
            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

            Comment


            • #7
              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 Files

              Comment


              • #8
                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

                Comment


                • #9
                  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

                  Comment


                  • #10
                    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

                    Comment


                    • #11
                      SSL encryption we will work with the connection from Mirth. Depending on the driver you are using, you include it in your connection string.
                      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

                      Comment

                      Working...
                      X