Announcement

Collapse
No announcement yet.

Accessing shared network drives by SMB

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

  • Accessing shared network drives by SMB

    Hi all,
    I have a problem with reading batch files from a Shared Network Drive by using SMB.

    Mirth is able to use SMB and access/read those files from a Shared FOLDER which I created on my Web server (Win Server 2003). But it is not able to access them when I place them on a Shared Network DRIVE on a FILE Server.

    When it tries to access the Shared Network DRIVE with correct username and password for that drive, it generates the following error messages:


    Code:
    [2008-11-24 10:54:53,621]  FATAL (org.mule.impl.DefaultComponentExceptionStrategy:84): 
    
     >>> The error is: Error happened while listing files
    
    org.mule.MuleException: Error happened while listing files
    	at com.webreach.mirth.connectors.file.filesystems.SmbFileConnection.listFiles(SmbFileConnection.java:144)
    	at com.webreach.mirth.connectors.file.FileMessageReceiver.listFiles(FileMessageReceiver.java:433)
    	at com.webreach.mirth.connectors.file.FileMessageReceiver.poll(FileMessageReceiver.java:110)
    	at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:90)
    	at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290)
    	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
    	at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
    	at java.lang.Thread.run(Unknown Source)
    
     >>> Caused by: jcifs.smb.SmbAuthException: Logon failure: unknown user name or bad password.
    
    	at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:515)
    	at jcifs.smb.SmbTransport.send(SmbTransport.java:629)
    	at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:288)
    	at jcifs.smb.SmbSession.send(SmbSession.java:233)
    	at jcifs.smb.SmbTree.treeConnect(SmbTree.java:154)
    	at jcifs.smb.SmbFile.doConnect(SmbFile.java:847)
    	at jcifs.smb.SmbFile.connect(SmbFile.java:890)
    	at jcifs.smb.SmbFile.connect0(SmbFile.java:816)
    	at jcifs.smb.SmbFile.getType(SmbFile.java:1216)
    	at jcifs.smb.SmbFile.doEnum(SmbFile.java:1667)
    	at jcifs.smb.SmbFile.listFiles(SmbFile.java:1649)
    	at jcifs.smb.SmbFile.listFiles(SmbFile.java:1627)
    	at com.webreach.mirth.connectors.file.filesystems.SmbFileConnection.listFiles(SmbFileConnection.java:130)
    	... 7 more
    
    --------------------
    
    [2008-11-24 10:57:17,130]  FATAL (org.mule.impl.DefaultComponentExceptionStrategy:83): The Default Component Exception Strategy has been invoked but there is no current event on the context

    Obviously, it is not able to use the authentication info (which is correct) to access the shared drive.

    The file server which hosts the Shared Network Drive should be a UNIX machine.

    I checked the SMB portion of the negotiation logs for the 1) working Shared Folder on the Web Server and 2) NOT working Shared Drive on the File Server.

    The most prominent differences were:

    1) SRC Port for connecting to the Windows Web server is 'Microsoft-DS' and it is 'NETBIOS Session Service' for the UNIX File Server.

    2) Windows Web Server ?Supports Windows NT information level pass-through requests [SMB _INFO_PASSTHROUGH]? but the UNIX File Sever does not support this.

    I am not sure if these have any impact on this issue.

    Any comment would be appreciated.

    Thank you for reading my question.

    Sam


    Post edited by: SamG, at: 11/24/2008 12:12

  • #2
    Re:Accessing shared network drives by SMB

    What is the format of your username? If you look at the constructor for SmbFileConnection you will see the regular expression used to parse out the domain and username. Make sure that what you're passing in is being properly parsed.
    Gerald Bortis | Chief Information Officer | Mirth Corporation

    Comment


    • #3
      Re:Accessing shared network drives by SMB

      Thank you very much Gerald. You did it again. It was the formatting problem. Now I have access to all those shared locations. I appreciate your great help.

      Cheers
      Sam

      Comment


      • #4
        Re:Accessing shared network drives by SMB

        Just for reference, what formatting were you using before and what were the changes that made it work?
        Jacob Brauer
        Director, Software Development
        NextGen Healthcare

        sigpic

        Comment


        • #5
          Re:Accessing shared network drives by SMB

          Hi Jacob,

          Thank you for reminding me. I became too excited and forgot to explain the case

          A shared folder on a Windows server could be accessed by just MirthUsername without indicating the domain.

          A shared network drive on probably a UNIX file server could not be accessed by MirthUsername alone, although both two servers and the Mirth machine are in the same domain.

          The shared network drive needed the domain name but it couldn't work with the Windows' login style of
          Code:
          Domain \\ Username
          It needed slash > Domain / Username

          Code:
          MirthUsername  < Failed
          MirthDomain \\ MirthUsername  < Failed
          MirthDomain / MirthUsername  < Works
          Please keep doing your great job.

          Sam

          Post edited by: SamG, at: 11/26/2008 13:24

          Comment


          • #6
            Re:Accessing shared network drives by SMB

            Thanks! We've fixed the issue that should allow it to split on either \ or /. It will be in the next release. If you are building from the trunk you can check it out now.
            Jacob Brauer
            Director, Software Development
            NextGen Healthcare

            sigpic

            Comment


            • #7
              Jacob,
              Thanks for this post it helped me setup my smb connection, but is there an issue with moving the completed file to a directory? This is what I have in the Move-to Directory field //10.13.0.27/adt

              And I get this error

              ************************************************** ***************
              [2012-11-16 13:19:43,842] ERROR (org.mule.impl.DefaultComponentExceptionStrategy:9 5): Caught exception in Exception Strategy for: 02993783-1a8e-434f-aa60-f0cfe7e126fe: org.mule.MuleException: Failed to move file "/spool/LOA_REPORT" to "//10.13.0.27/adt/LOA_REPORT". The file already exists.
              org.mule.MuleException: Failed to move file "/spool/LOA_REPORT" to "//10.13.0.27/adt/LOA_REPORT". The file already exists.
              ************************************************** ***************

              Is there a known error with smb and the move-to directory?

              Comment

              Working...
              X