Replies: 8 comments
-
You probably can by making system calls and running Mirth as a privileged user but this is not a good idea. Having MC restart itself doesn't fix the underlying problem and would add more system administration headaches. Can you show how your channel is set up? Do you have MC using SMB directly or does it read from a local disk that Windows mounts from the network? Showing a screenshot of the file reader settings would be helpful. Please blur any addresses, usernames or passwords. What error do you get? Copy and paste it |
Beta Was this translation helpful? Give feedback.
-
Thanks @jonbartels for quick reply My channel's reading files works well but if remote server (that share folder) restart or network connection fail, reading files will be failed. I'm using Mirth Connect Server 3.8.1. My channel's connector type is javascript Reader/javascript Writer
I have MC using SMB directly and this is my all javascript Reader code (is implemented Source Tab):
I got error message via mail (at sendMail() in catch() block ): [ERROR] com.mirth.connect.connectors.file.FileConnectorException: Error listing files in dir [his_ris] for pattern [^(ORM|PHY|MDM|ADT|ORU-RPT)_\w{2}_\d{14,100}.xml$] I appreciate if you help me to find out the cause and how to fix it. |
Beta Was this translation helpful? Give feedback.
-
You may find mounting the file system locally to the mirth server makes more sense - and then testing for the existence of some file that should always exists out there. Windows can have the file system mounted even when logged off, it is just a bit more painful than in Linux. Also the service user for mirth should be a named user not the default the installer uses. |
Beta Was this translation helpful? Give feedback.
-
MC uses the JCIFS library for SMB file shares. You can see MCs source, make sure you select the right tag version for your MC version. If restarting MC allows the service to reconnect that seems like there is something being cached, stuck, or re-used inside MC or JCIFS. Maybe like this JCIFS mailing list message I also think that your code should have try/finally blocks to close things like input streams and file handles. I agree with pacmano, letting the OS handle netmounts so MC can treat it as a local file is usually better. It is more robust. There are also more sysadmins who can help with a Windows netmount than with MC, you can let a teammate fix the problem! ha ha! |
Beta Was this translation helpful? Give feedback.
-
Curious - why are you using as JS reader here and not the standard file reader? I am sure it is related to your use case, but I am interested to know why. |
Beta Was this translation helpful? Give feedback.
-
Mounts in windows are all user-based rather than system-based. When I do need to mount a network share in windows I do it in a mirth deploy script, (by running |
Beta Was this translation helpful? Give feedback.
-
Thanks @pacmano1 and @jonbartels
You mean MC service user = user who can access the network folder, right?
Yes! I need to read following FIFO - First-In-First-Out) to make sure correct data processed. |
Beta Was this translation helpful? Give feedback.
-
Thanks @tonygermano I'll try your solution. We must mount (using |
Beta Was this translation helpful? Give feedback.
-
Stupid question but
Can I restart a Mirth Windows service inside Mirth java script?
My problem is:
My Mirth read XML files from shared network folders. However, I sometimes got network connection error and my channel nerver reconnnects even the network connection fixed. My channel become work after I restart Mirth service manually.
I want to check network connection and restart Mirth service if the connection fail.
Can I do?
Beta Was this translation helpful? Give feedback.
All reactions