Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

SFTP Error

  • Filter
  • Time
  • Show
Clear All
new posts

  • SFTP Error

    I have a channel defined, where it is reading an HL7 file using SFtp from one server, and relaying it to another SFtp server. I am seeing two types of errors intermittently. The first I'm guessing is due to a timeout on the SFtp server. It appears more frequently when there hasn't been any activity for a while.

    ERROR-409: SFTP Connector error
    ERROR MESSAGE: Error writing to Sftp
    4: java.lang.NullPointerException

    I'm not sure if anything can be done about that one, although it would be a nice feature if Mirth would try to resend it automatically some number of times if there were errors.

    The second is a little more confusing to me:

    ERROR-301: Transformer conversion error
    ERROR MESSAGE: Error adapting message
    com.webreach.mirth.model.converters.SerializerExce ption: Unable to parse, message is null or too short:

    To me, it appears that Mirth thinks that there is a file to pick for the reader, but there isn't one available.

    Any insight into either of those?

    Vince Ciganik

  • #2
    Re:SFTP Error

    I think you are correct on the first one.

    For the second one, how is the "sending" application writing those files? Is it working on the files directly in the path that is available via SFTP or does it create the files and then move them to that path when they are ready to send??
    Jon Bartels

    Zen is hiring!!!!
    Talented healthcare IT professionals wanted. Engineers to sales to management.
    Good benefits, great working environment, genuinely interesting work.


    • #3
      Re:SFTP Error

      The files are being written directly into the directory. I think you are suggesting that the Mirth server is attempting to pick up the files as they are being written to the directory, and failing at that point, which is a valid point, although the files are pretty small at around 30K, with the file information stored in a string and written out one time (not opening the file for write, looping and writing information on each loop etc.).

      I could try staging them in a different directory and then just moving them to the final destination. I suppose there is still the possibility that I will get the errors if the file is in the process of moving into the directory, but it should be less.

      In either case, I need to see if the verify if the file is actually being transferred. It seems to me that if I am seeing that error, with no raw message listed, that eventually the file does get written to the directory and processed at that time, and these errors, while valid, do not mean that information is being lost.



      • #4
        Re:SFTP Error

        I also get error #1 a lot. Does anyone know if there is a plan to add this feature in to version 1.80?



        • #5
          I have been getting error #2 (Premature end of file; unable to parse, message is null or too short; using Mirth 1.7.1) on one my my channels only. It happens about 3 of every 4 times. I redirect the files to an error directory when problems happen. If I manually open the files and delete the final character in the message (a carriage return) and save it, it will process just fine.

          Mirth runs on a windows server in our environment.

          Perhaps it is related, but a previous channel we wrote refused to process file created on a linux machine. They made a change on their end to put the "windows-friendly" CR/LF line endings and it began working just fine for us.

          So, perhaps the fact that I am deleting that CR at the end of the file means nothing. Perhaps the fact that I am re-saving the file while in windows is reformatting the file into an always-compatible format. I'd really like to figure out a way not to have to manually re-save these files.


          • #6
            Upgrade to 1.8 or Check "Convert LF to CR" on all inbound and outbound transformers.
            Daniel Svanstedt
            Software Engineer
            Mirth Corporation

            Want professional services, support, and enterprise or virtual appliances? It's all available from the Mirth Corporation:
            Mirth Support | Mirth Training | Mirth Appliances | Online Training | Developer Q&A

            Don't forget, Mirth Support gives you access to all of our online training videos, and silver support gives you access to developer Q&As!


            • #7
              Here's a bigger version of the error (yes I convert LF to CR):
              [2009-07-06 16:54:10,613] ERROR (org.mule.impl.DefaultExceptionStrategy:231):
              ************************************************** ******************************
              Message : org.xml.sax.SAXParseException: Premature end of file. (com.webreach.mirth.model.converters.SerializerExc eption)
              Type : org.mule.umo.transformer.TransformerException
              Code : 64999
              JavaDoc :
              Transformer : Transformer{name='8c82ae1c-92ea-453b-b3ea-06eb0ab97715_source_transformer', returnClass=false, returnClass=false, sourceTypes=[]}
              ************************************************** ******************************
              Exception stack is:
              1. Premature end of file. (org.xml.sax.SAXParseException)
              org.apache.xerces.util.ErrorHandlerWrapper:-1 (null)
              2. org.xml.sax.SAXParseException: Premature end of file. (com.webreach.mirth.model.converters.SerializerExc eption)
              com.webreach.mirth.model.converters.ER7Serializer: 195 (null)
              3. org.xml.sax.SAXParseException: Premature end of file. (com.webreach.mirth.model.converters.SerializerExc eption) (org.mule.umo.transformer.TransformerException)
              com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer:448 (
              ************************************************** ******************************
              Root Exception stack trace:
              org.xml.sax.SAXParseException: Premature end of file.

              at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source)

              at org.apache.xerces.util.ErrorHandlerWrapper.fatalEr ror(Unknown Source)

              at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)

              at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source)

              at org.apache.xerces.impl.XMLVersionDetector.determin eDocVersion(Unknown Source)

              at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)

              at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source)

              at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

              at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source)

              at com.webreach.mirth.model.converters.ER7Serializer. fromXML(

              at com.webreach.mirth.model.converters.ER7Serializer. fromXML(

              at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform

              at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.transform(JavaScriptTransformer.ja va:346)

              at org.mule.transformers.AbstractEventAwareTransforme r.doTransform( 8)

              at org.mule.transformers.AbstractTransformer.transfor m(

              at org.mule.transformers.AbstractTransformer.transfor m(

              at org.mule.impl.MuleEvent.getTransformedMessage(Mule

              at org.mule.routing.inbound.SelectiveConsumer.isMatch (

              at org.mule.routing.inbound.InboundMessageRouter.rout e(

              at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR

              at org.mule.providers.AbstractMessageReceiver.routeMe ssage(

              at org.mule.providers.AbstractMessageReceiver.routeMe ssage(

              at com.webreach.mirth.connectors.vm.VMMessageReceiver .getMessages(

              at org.mule.providers.TransactedPollingMessageReceive r.poll(


              at .java:290)

              at eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)

              at eadPoolExecutor$ :675)

              at Source)

              ************************************************** ******************************


              • #8
                Good news: Mirth 1.8.0 properly processes these files now without any manual edits!

                (although 1.8.0 is giving me some other unrelated issue when logging processed messages..)


                • #9
                  Where is CONVERT LF to CR?


                  • #10
                    In the properties window of your messageTemplate(s)

                    I too have some times a error like Jimoran.
                    But I think Mirth is picking the file up while it is still being written. (race condition)

                    Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified