Announcement

Collapse
No announcement yet.

Unstable Connectivity for File Reader using SMB

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

  • Unstable Connectivity for File Reader using SMB

    We have Mirth Connect 3.5.2.
    I have a channel set up using a source connector as a File Reader to read xml files via SMB.
    This connection worked initially and suddenly is now unable to connect.
    I have the client's SMB credentials (IP/Path of folder, username and password)
    I have worked with the client to confirm the credentials and permissions are set properly on this folder to read.
    I am able to access this same folder via windows explorer.

    Can you suggest anything to assist in resolving this inability to connect and pick up these files with Mirth Connect using SMB?

  • #2
    On your source connection, you will have a button that says 'Test Read'. Is that successful?

    Comment


    • #3
      If they upgraded a server or changed group policy, the SMB File Writer only supports SMB1, and won't be able to connect if they have that protocol disabled.

      http://www.mirthcorp.com/community/i...wse/MIRTH-4239

      I ran into this recently, and my solution (when running mirth on windows) was to call the following from the deploy script :

      Code:
      logger.info('channel: "' + channelName + '" deploy: ' +
      JSON.stringify(executeRuntimeCommand(['net', 'use', 'q:', '\\\\10.120.101.20\\share', $('Password'), '/USER:' + $('User')])));
      The drive will get mounted for the user the mirth service is running as. Then I had my File Writer write to the mounted drive as a local file instead of SMB.

      The code template for executeRuntimeCommand is here https://github.com/nextgenhealthcare...time%20Command

      Comment


      • #4
        Use mklink

        On a Windows Server we prefer to use "mklink" to mount a folder to a network drive. After that you can use the standard file connector.

        Example
        Code:
        mklink /D D:\Transfer \\server\share
        This will create a link to your share. In Mirth you can now use "FileReader" with method "file" and use the path "D:\Transfer" to get access to your share.

        [Edit]: You'll need a cmd console with admin rights to create the link.

        Good luck
        Last edited by omnitux; 08-22-2019, 08:24 AM.

        Comment


        • #5
          I can't tell if it's the same case as the original poster, but in my case, the share belonged to a third party, and I needed to supply alternate credentials. I don't think there's a way to do that with mklink unless you call 'net use' first to connect to the share before you link it.

          Network connections in windows are per user, and even if you link it as an admin, I don't think that will automatically give other users access if their current user doesn't already have permission to the share, but I could be wrong about that part.

          You don't need local admin rights to map a drive for the current user.

          Comment


          • #6
            Of cause you are right. I forgot to mention that the user who starts the mirthconnect service has to be able to connect to the share. In my opinion the original poster needs a stable connection to a share and I can confirm that Java's SMB connection are often not stable enough for production environments. So in my experience it's a good way to use mklink.

            Local admin rights are only needed if you make the link in a folder where you need these rights - maybe in C:\ or something like that.

            Comment


            • #7
              The 'test connection' is not successful.

              Comment

              Working...
              X