Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE in DiskShare #415

Open
cliviu opened this issue Dec 13, 2018 · 6 comments
Open

NPE in DiskShare #415

cliviu opened this issue Dec 13, 2018 · 6 comments

Comments

@cliviu
Copy link

cliviu commented Dec 13, 2018

Hi, Got NPE with 0.9.1 : Caused by: java.lang.NullPointerException
at com.hierynomus.smbj.share.DiskShare.getDiskEntry(DiskShare.java:112)
at com.hierynomus.smbj.share.DiskShare.open(DiskShare.java:67)
at com.hierynomus.smbj.share.DiskShare.exists(DiskShare.java:187)
at com.hierynomus.smbj.share.DiskShare.folderExists(DiskShare.java:183)

Here are the last log lines before the exception:
2018-12-12 16:47:59,443|DFSPathResolver |INFO |DFS Share Net-... does not cover \path1 resolve through DFS
2018-12-12 16:47:59,443|DFSPathResolver |INFO |Starting DFS resolution for \path1
2018-12-12 16:47:59,443|DFSPathResolver |INFO |DFS resolved path1-> path2
What can be the problem ?
Thanks !

@cliviu
Copy link
Author

cliviu commented Jan 16, 2019

Any thoughts about this ? What can cause the problem ? The NPE occurs in the "if" line :
SMB2CreateResponse response = responseContext.resp;
if(response.getFileAttributes().contains(FILE_ATTRIBUTE_DIRECTORY)) {

Either "response" or the "fileAttributes" must be null but I'm not sure what kind of external configuration can cause this problem ...

@cliviu
Copy link
Author

cliviu commented Jan 16, 2019

I have another hint: the DFS Resolution returns the same URL when the NPE is thrown ....
2018-12-12 16:47:59,443|DFSPathResolver |INFO |Starting DFS resolution for \host\share
2018-12-12 16:47:59,443|DFSPathResolver |INFO |DFS resolved \host\share-> \host\share

@cliviu
Copy link
Author

cliviu commented Jan 18, 2019

shortly before this I make a call DiskShare.getFileInformation("" ) just to test the connection which returns with no exception.
Any ideas ?

@Disablez
Copy link
Contributor

Disablez commented Jun 4, 2019

This could help...
#474

@Disablez Disablez mentioned this issue Jun 4, 2019
@throwinto2
Copy link

I seem to be getting the exact same exception at the exact same code lines. I have multiple DFS shares set up on various servers and it seems like only some encounter this problem. They are all in the same domain, same setup and all shares are set up in the same way.
I sadly cannot pinpoint the cause. At first it looked like the DFS shares on a domain controller were more stable, but this was seemingly fixed in 2017. What seemed to work to a certain extent is creating a new DFS namespace with new shares. Maybe the DFS namespace cache is the cause..
Did #474 and #342 resolve this problem? I'm hoping it will be available in the next version when it is released.

@davisnw
Copy link

davisnw commented Feb 13, 2020

I found that at least in my case, the NullPointerException only occurs if I reuse SmbClient. See also #531

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants