-
Notifications
You must be signed in to change notification settings - Fork 104
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
Changing jcifs resolveOrder makes connection issue due to wrong server IP used #258
Comments
Note that using default jcifs resolvOrder creates issues to connect to WD MyCloud NAS devices. I am thus out of "universal" solution. |
OK I have found 2 users that have the issues in the field that are willing to debug. One requiring |
jcifs.netbios.NameServiceClientImpl on TRACE level along with jcifs.smb.SmbTransportImpl and jcifs.smb.SmbSessionImpl should be a good start to figure out what is going on there. |
Thanks for the proposal. I have made this morning a jar package of my test program with jcifs.netbios.NameServiceClientImpl set to TRACE available to the motivating users having the issue. I add right away the missing jcifs.smb.SmbSessionImpl and hopefully will report soon with log files. |
OK I instrumented my application nova to get TRACE for Just to recap, I have two users having systematic problems:
Both users have jcifs-ng trying to connect to the wrong IP while nova figures out in the udp discovery process the right IP/share
I got logs from the first user as requested and we see very early Please find the complete logs (not sure it will help at this stage): Please do not hesitate to ask for more tests to progress on this issue. [EDIT] [UPDATE] Logs from second user with
Behavior on these users are 100% reproduceable. |
Also adds a bunch of new resolver diagnostics, some refactoring.
In the first case (smb 2 resolver option not tickedlog.zip) the "wrong" address really seems to be returned by DNS (no fallback to netbios). Maybe multiple addresses are returned (unfortunately no proper logging for that until now) - in that case failover to the other returned addresses should be performed, but maybe something is broken there? Otherwise, this looks like somthing is wrong with the user's DNS setup. NetBIOS will not be tried if DNS returns a result. In the second case the netbios query returns both addresses (192.168.25.1 and 192.168.1.2). Here, we obviously pick the wrong one and discard the remaining addresses. This issue should be fixed in master by using all returned addresses and performing failover. I also added a bunch of new debugging that might help figuring out the remaining issue. |
Thank you! I will deploy a test build based on master for the two users to collect feedback and more logs. |
Probably yes, but this order is likely to cause connection delays if netbios is not available, so I would not really recommend it for general usage. |
Understood, thus let's go to the bottom of this issue and get logs from first user (92.242.132.24) with default resolver order. |
OK got the logs with the master and your latest changes (I am fortunate to have motivated testers) and here is the result for the one with strange DNS answers (92.242.132.24):
|
It appears the user's DNS server is really returning that address for all non-existant domain. |
Indeed, on the issue discussion thread poking around with nslookup we came up with the same finding. |
If the server has multiple network interfaces that seems to be the case, I was able to reproduce that with a samba server. We could possibly still try to be smarter about the order in which we try the addresses, but I'm not sure that it is worth the effort. |
I figured that I should report a strange issue encountered by some users in the field (not systematic and not reproduced by me) with my android application.
In the application, jcifs resolveOrder is changed to
jcifs.resolveOrder="BCAST,DNS"
instead of default one.And following error happens sometimes:
Note that the fail to connect happens with SERVER<20>/192.168.25.1 and 192.168.25.1 is not an IP belonging to the subnet used by the user since SERVER has 192.168.1.2 address.
Two independent users reported this behavior, one with a QNAP NAS and the other one with a win7 PC SMB server.
Unfortunately, I am unable to get packet captures of the issue and I guess this will not help you figure it out.
The text was updated successfully, but these errors were encountered: