jcifs共享枚举超时

时间:2015-04-12 09:12:58

标签: jcifs netapp libsmbclient

我已经使用jcifs 1.3.17很长一段时间了,最​​近在枚举来自一台特定NetApp机器的共享时遇到了一些麻烦。

  • NetApp处于群集模式
  • 使用相同来源的smbclient成功完成

如有必要,我可以发布网络捕获(pcap文件)。

例外是:

jcifs.util.transport.TransportException: Transport2 timedout waiting for response to SmbComReadAndX[command=SMB_COM_READ_ANDX,received=false,errorCode=0,flags=0x0018,flags2=0xC803,signSeq=0,tid=1,pid=17493,uid=1,mid=16,wordCount=12,byteCount=0,andxCommand=0xFF,andxOffset=0,fid=1,offset=7352,maxCount=1024,minCount=1024,openTimeout=-1,remaining=1024,offset=7352]
    at jcifs.util.transport.Transport.sendrecv(Transport.java:73)
    at jcifs.smb.SmbTransport.send(SmbTransport.java:655)
    at jcifs.smb.SmbSession.send(SmbSession.java:255)
    at jcifs.smb.SmbTree.send(SmbTree.java:113)
    at jcifs.smb.SmbFile.send(SmbFile.java:792)
    at jcifs.smb.SmbFileInputStream.readDirect(SmbFileInputStream.java:181)
    at jcifs.dcerpc.DcerpcPipeHandle.doReceiveFragment(DcerpcPipeHandle.java:99)
    at jcifs.dcerpc.DcerpcHandle.sendrecv(DcerpcHandle.java:220)
    at jcifs.smb.SmbFile.doMsrpcShareEnum(SmbFile.java:1938)
    at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1851)
    at jcifs.smb.SmbFile.doEnum(SmbFile.java:1797)
    at jcifs.smb.SmbFile.listFiles(SmbFile.java:1773)
    at jcifs.smb.SmbFile.listFiles(SmbFile.java:1762)
    at com.mprv.filecrawler.cifs.SmbRootCrawler.listDirectories(SmbRootCrawler.java:32)
    at com.mprv.filecrawler.cifs.SmbDirCrawler.crawl(SmbDirCrawler.java:62)
    at com.mprv.filecrawler.cifs.SmbDirCrawler.init(SmbDirCrawler.java:38)
    at com.mprv.filecrawler.DirTask.run(DirTask.java:41)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
netShareEnum response status=50
netShareEnum response=NetShareEnumResponse[command=SMB_COM_TRANSACTION,received=false,errorCode=0,flags=0x0098,flags2=0xC801,signSeq=0,tid=1,pid=17493,uid=1,mid=5,wordCount=10,byteCount=5,totalParameterCount=4,totalDataCount=0,parameterCount=4,parameterOffset=56,parameterDisplacement=0,dataCount=0,dataOffset=60,dataDisplacement=0,setupCount=0,pad=1,pad1=0,status=50,converter=0,entriesReturned=16,totalAvailableEntries=0]
jcifs.smb.SmbException: 50
    at jcifs.smb.SmbFile.doNetShareEnum(SmbFile.java:1961)
    at jcifs.smb.SmbFile.doShareEnum(SmbFile.java:1855)
    at jcifs.smb.SmbFile.doEnum(SmbFile.java:1797)
    at jcifs.smb.SmbFile.listFiles(SmbFile.java:1773)
    at jcifs.smb.SmbFile.listFiles(SmbFile.java:1762)
    at com.mprv.filecrawler.cifs.SmbRootCrawler.listDirectories(SmbRootCrawler.java:32)
    at com.mprv.filecrawler.cifs.SmbDirCrawler.crawl(SmbDirCrawler.java:62)
    at com.mprv.filecrawler.cifs.SmbDirCrawler.init(SmbDirCrawler.java:38)
    at com.mprv.filecrawler.DirTask.run(DirTask.java:41)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

更新 根据pcap文件,似乎在某些时候,当收到大量共享时,JCIFS在Dcerpc片段之后停止要求更多数据包(SmbComReadAndX)。

1 个答案:

答案 0 :(得分:0)

似乎问题是服务器上的份额(~250份) Jcifs缓冲区从1024增加到4280字节。