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

1.7.1 SMB ECONNREFUSED for Debian Samba (Regression from 1.6.2) #1181

Closed
SokolInTheCloud opened this issue Mar 26, 2024 · 15 comments
Closed
Assignees
Labels
bug Something isn't working
Milestone

Comments

@SokolInTheCloud
Copy link

Screenshot_20240326-095932_Material_Files
Having problem with SMB (linux samba), which worked nice with version 1.6.2 and prior.
I'm using firewall, Material Files is allowed (any in any out). But maybe newer versions require some additional permissions?

@SokolInTheCloud SokolInTheCloud changed the title 1.7.1 still have ptoblem with SMB 1.7.1 still have problem with SMB Mar 26, 2024
@LevonTostig
Copy link

Hi @SokolInTheCloud, I had similar issues with my SMB shares in Materials Files 1.7.1.
After using "Clear Storage" in the app settings a setting up my SMB share anew, it all worked again. Just clearing the cache had no effect though. Perhaps you could give this a try.

Addendum: The error message I saw, was not exactly the same, but it also pertained to java8.nio.

@SokolInTheCloud
Copy link
Author

SokolInTheCloud commented Mar 27, 2024

Hi @LevonTostig
Thank you for this suggestion, but it doesn't work in my case.
After clearing storage I got another error
Screenshot_20240327-132022_Material_Files
I'm using LineageOS 18.1 (Android 11) and Material Files from F-Droid, SMB destination is anonymous samba folder on Debian, if it's matter.

@SokolInTheCloud
Copy link
Author

SokolInTheCloud commented Mar 27, 2024

Hey, I just found that on Google Play the latest version is 1.6.2 (the latest working with SMB)
So it seems that all F-Droid users are free beta-testers for Material Files :)

@zhanghai
Copy link
Owner

zhanghai commented Mar 27, 2024

So it seems that all F-Droid users are free beta-testers for Material Files :)

It seems that you are not assuming a positive intent for me. I'm experiencing back and forth with Play Developer Support about getting the new version released on Play this time, and filing appeals isn't fun. Play version will be updated once they are approved. That was usually within 12 hours in the past and I haven't heard of any Play user complaining them being the free beta-testers for F-Droid users. Well, in terms of "free" I don't have any paid users anyway...

The ECONNREFUSED errno usually means the remote server rejected the socket connection (usually a low level thing). I don't have a good guess of why either.

@LevonTostig
Copy link

@SokolInTheCloud I am almost sorry, that I tried to help you. I am not sure, that you appreciate what FOSS means. And no, the smiley and the end of the sentence about beta-testers does not help.

Somebody (in this case @zhanghai) is providing you with a software free of charge and you choose to complain in this very odd way.

Perhaps you can still try to check the connection to your SMB share from another device.

It might also help to now, what is providing the SMB share.

Last, but not least: LineageOS 18.1 is old and has finally when put to rest (https://lineageos.org/Sunsetting-LineageOS-18.1/). This means, that more and more software might stop working on your phone in the not so distant future.

@SokolInTheCloud
Copy link
Author

SokolInTheCloud commented Mar 28, 2024

@zhanghai Hi, and thank you for your answer. I wish you the good luck with google bureaucracy. I saw what I saw - that F-Droid has versions 1.7.0 and 1.7.1 for several days, both versions have some issues, and it's just my guess about beta testing :) I don't mind being a free beta tester to make any FOSS project better. So I also spend my time for feedback on the issues described above. I suppose this could be more useful than just a bunch of negative reviews on Google Play.

Previously I used some other paid app from Google Play for my SMB. I'll try to find and install it to check if the problem on my side (maybe it's lineageos security issue or Debian samba config could be updated). Anyway I like Material Files 1.6.2 and I just trying to help make it better.

@SokolInTheCloud
Copy link
Author

@LevonTostig I thanked you for your answer, it can really help someone else. And I would be glad if it worked in my case too. Unfortunately, this is not the case. What else can I do?

I have a bunch apps on my phone, all of them work pretty good. As I wrote above Material Files 1.6.2. works with all my SMB shares with no issues. So I suppose the reason is new code in new version of Material Files.

@SokolInTheCloud
Copy link
Author

@zhanghai I found this app on F-Droid https://github.com/wa2c/cifs-documents-provider
It can use 2 libs to connect to SMB: jCIFS NG and smbj. jCIFS works fine with my Debian samba share, while smbj gives me an error pretty similar to the above
Screenshot_20240328-114626_CIFS_Documents_Provider
I have localized the error. May be this provide some clue to fix the error in Material Files?

@SokolInTheCloud
Copy link
Author

@zhanghai I also tried this app https://play.google.com/store/apps/details?id=com.cxinventor.file.explorer
Seems like it uses both JCIFS and SMBJ too. I don't know how it handles these libs, there are no user settings to choose one. But this app works well with my SMB shares. So it's obviously that the error reason is not my configuration, it's in app or in SMBJ. Hope it will be easy to fix the error with all the info I collected.

@zhanghai
Copy link
Owner

zhanghai commented Mar 29, 2024

What I can tell is that SMBJ was updated from 0.11.5 to 0.13.0 between 1.6.2 and 1.7.1. It is said to have fixed several things in its changelogs, but of course might have also introduced bugs. I didn't really touch SMB connection code in this app between 1.6.2 and 1.7.1 (changes).

However I personally don't even use SMB myself (I only read some SMB spec to implement it) so I can't debug a specific configuration somehow broken either. After all, everything is open-source so anyone can debug it and propose fixes and I'll be happy to apply in that case.

I'll also update the issue title to make it clear this is about Debian Samba and 1.6.2 to 1.7.1 so that if there's anyone else encoutering it they may find this bug and try to further debug it.

@zhanghai zhanghai added the bug Something isn't working label Mar 29, 2024
@zhanghai zhanghai self-assigned this Mar 29, 2024
@zhanghai zhanghai changed the title 1.7.1 still have problem with SMB 1.7.1 SMB ECONNREFUSED for Debian Samba (Regression from 1.6.2) Mar 29, 2024
@SokolInTheCloud
Copy link
Author

@zhanghai I have played with samba and app settings. Samba log was useless. But it seems that the error Attempt to invoke interface method 'byte[] java.security.Key.getEncoded()' on a null object reference appears only in Anonymous authentication mode, while in Guest or Password modes everything works fine.
I'm not a programmer, but perhaps the error says that some function gets null as a username or password in SMB Anonymous mode.

@zhanghai
Copy link
Owner

zhanghai commented Apr 7, 2024

Sounds like hierynomus/smbj#792

@zhanghai zhanghai added this to the v1.8.0 milestone Apr 7, 2024
zhanghai added a commit that referenced this issue Apr 7, 2024
To work around regression in SMB anonymous authentication.

See also hierynomus/smbj#792

This reverts commit d9ce4e6.

Bug: #1181
@zhanghai
Copy link
Owner

zhanghai commented Apr 7, 2024

Could you try the APK in https://github.com/zhanghai/MaterialFiles/actions/runs/8591504511 's artifacts?

@SokolInTheCloud
Copy link
Author

@zhanghai Hi! The debug version works nice with SMB in all three modes (Anonymous, Guest, Password).

@zhanghai
Copy link
Owner

zhanghai commented Apr 9, 2024

Thanks for confirming, the rollback of SMBJ will be in the next release.

@zhanghai zhanghai closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants