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

[Bug]: SMBJ won't connect and possibly crashes when trying to connect to Windows 11 24h2 passwordless shares; have to use SMB instead #1324

Open
Pentaphon opened this issue Dec 5, 2024 · 17 comments
Labels
bug Something isn't working

Comments

@Pentaphon
Copy link

Pentaphon commented Dec 5, 2024

Problem description

After updating to Windows 11 24h2, I can no longer connect to Windows 11 24h2 SMB shares using the SMBJ protocol. Nova also seems to crash when attempting to connect the same way I connected via SMBJ on previous versions of Windows.

Steps to reproduce the issue

  1. Clean install of latest Nova on Fire Stick 4K 1st gen or a phone.
  2. Try to connect to a Windows 11 24h2 share via SMBJ using "browse network share" with settings used in previous Windows 11 versions at [FEAT]: Switch from jcifs-ng to smbj to increase SMB throughput #835 (comment)
  3. Nova will go blue and go back to the network page, and on a phone, crash to the phone's launcher.
  4. Using trial and error, I could not find a way to connect to Windows 11 24h2 shares via SMBJ but interestingly enough, regular SMB works just fine on Windows 11 24h2 shares and even faster than it did before. This is the fastest that regular SMB has performed on Windows 11 from my experience.

@courville have you seen any SMBJ crashes from these devices?

This might have to do with https://www.neowin.net/news/windows-11-24h2-breaks-connection-to-some-third-party-nas-with-smb/

Expected behavior

I expect SMBJ to connect to Windows 11 24h2 but I can't seem to find a way to connect.

Your phone/tablet/androidTV model

FireTV 4K Stick 1st gen, Motorola phone

Operating system version

FireOS 7, Android 11

Application version and app store

6.2.97 and 6.3.6

Additional system information

No response

Debug logs

No response

@Pentaphon Pentaphon added the bug Something isn't working label Dec 5, 2024
@courville
Copy link
Contributor

courville commented Dec 7, 2024

Thanks for reporting. I searched the stacktrace on sentry and it appears to be this one (I guess):

com.hierynomus.smbj.session.SMB2GuestSigningRequiredException: Cannot require message signing when authenticating with a guest account
    at com.hierynomus.smbj.connection.SMBSessionBuilder.validateAndSetSigning(SMBSessionBuilder.java:258)
    at com.hierynomus.smbj.connection.SMBSessionBuilder.setupSession(SMBSessionBuilder.java:172)
    at com.hierynomus.smbj.connection.SMBSessionBuilder.setupSession(SMBSessionBuilder.java:152)
    at com.hierynomus.smbj.connection.SMBSessionBuilder.establish(SMBSessionBuilder.java:119)
    at com.hierynomus.smbj.connection.Connection.authenticate(Connection.java:202)
    at com.archos.filecorelibrary.smbj.SmbjUtils.getSmbConnection(SmbjUtils.java:107)
    at com.archos.filecorelibrary.smbj.SmbjUtils.getSmbShare(SmbjUtils.java:117)
    at com.archos.filecorelibrary.smbj.SmbjListingEngine$SmbjListingThread.run(SmbjListingEngine.java:84)

Seems to be an smbj issue.

@courville
Copy link
Contributor

Perhaps I should use cf. hierynomus/smbj#554 SmbConfig.builder().withMultiProtocolNegotiate(true).withSigningRequired(false).build()

courville added a commit to nova-video-player/aos-FileCoreLibrary that referenced this issue Dec 7, 2024
@courville
Copy link
Contributor

@Pentaphon
Copy link
Author

please try https://github.com/nova-video-player/aos-AVP/releases/tag/v6.3.8

@courville Just tried 6.3.8 with both devices and got the same results. When I try to connect, Nova goes totally blue and goes back to the network page on my FireTV 4K Stick 1st gen and on my Motorola phone, Nova crashes completely and I get a "Nova Player keeps stopping" message from the OS. I'm surprised the FireTV 4K stick doesn't crash to the launcher like my phone does.

@courville
Copy link
Contributor

On sentry I still get the same stacktrace even with the modification made to smbj config builder

com.hierynomus.smbj.session.SMB2GuestSigningRequiredException: Cannot require message signing when authenticating with a guest account
    at com.hierynomus.smbj.connection.SMBSessionBuilder.validateAndSetSigning(SMBSessionBuilder.java:258)
    at com.hierynomus.smbj.connection.SMBSessionBuilder.setupSession(SMBSessionBuilder.java:172)
    at com.hierynomus.smbj.connection.SMBSessionBuilder.setupSession(SMBSessionBuilder.java:152)
    at com.hierynomus.smbj.connection.SMBSessionBuilder.establish(SMBSessionBuilder.java:119)
    at com.hierynomus.smbj.connection.Connection.authenticate(Connection.java:202)
    at com.archos.filecorelibrary.smbj.SmbjUtils.getSmbConnection(SmbjUtils.java:106)
    at com.archos.filecorelibrary.smbj.SmbjUtils.getSmbShare(SmbjUtils.java:116)
    at com.archos.filecorelibrary.smbj.SmbjListingEngine$SmbjListingThread.run(SmbjListingEngine.java:84)
    

@Pentaphon
Copy link
Author

Pentaphon commented Dec 7, 2024

On sentry I still get the same stacktrace even with the modification made to smbj config builder

I guess this should be reported upstream? Windows 11 24h2 is still fairly new.

@Pentaphon
Copy link
Author

@courville I think 6.3.8 introduced a new problem. On a clean install I can no longer scrape my library on my FireTV 4K Stick via regular SMB. When I "index folder" and add to library I get the total number of files being scraped and then it stops and crashes back to the "Network" page. It just keeps crashing to a blue screen and goes back to the Nova homepage when I go to "non scraped videos" and attempt to "rescrape all". Can you see this on your end via Sentry?

courville added a commit to nova-video-player/aos-FileCoreLibrary that referenced this issue Dec 7, 2024
@courville
Copy link
Contributor

courville commented Dec 7, 2024

@Pentaphon thx for the warning (I do not experience it though).
I guess this is related to:

java.lang.UnsupportedOperationException: null
    at java.util.concurrent.CopyOnWriteArrayList$CowIterator.set(CopyOnWriteArrayList.java:818)
    at java.util.Collections.sort(Collections.java:247)
    at com.archos.mediascraper.themoviedb3.SearchShowParser.getSearchShowParserResult(SearchShowParser.java:71)
    at com.archos.mediascraper.themoviedb3.SearchShowParser.getResult(SearchShowParser.java:53)
    at com.archos.mediascraper.themoviedb3.SearchShow.search(SearchShow.java:124)
    at com.archos.mediascraper.xml.ShowScraper4.getMatches2(ShowScraper4.java:125)
    at com.archos.mediascraper.xml.BaseScraper2.search(BaseScraper2.java:97)
    at com.archos.mediascraper.Scraper.getAutoDetails(Scraper.java:107)
    at com.archos.mediascraper.AutoScrapeService$3.run(AutoScrapeService.java:509)

I will fix it (see #1327).

@courville
Copy link
Contributor

@Pentaphon sorry for this back and forth and crashes. Do you have access to this https://github.com/nova-video-player/aos-AVP/releases/tag/untagged-7d0a1b8bdca7f05cecb9 (not yet released and I removed the previous ones)?

@Pentaphon
Copy link
Author

Pentaphon commented Dec 7, 2024

Do you have access to this

Page not found for me.

Currently rolling back to 6.3.6 which is working perfectly with regular SMB (but sadly not SMBJ)

@courville
Copy link
Contributor

courville commented Dec 7, 2024

https://drive.google.com/file/d/1RRjikbJYEx-mdPNaXUZj_ehRBDkJIvpr/view?usp=sharing
https://drive.google.com/file/d/1lxu8I-svwOgy951PmAKrk0jlCMNJRR25/view?usp=sharing
(arm64 and arm32 apk)

This release should solve the crash in the scrape and also catch the exception with smbj (it will still not work but not crash).

@Pentaphon
Copy link
Author

Pentaphon commented Dec 7, 2024

This release should solve the crash in the scrape

@courville A clean install of 6.3.9 is currently scraping my library so that is fixed, but oddly enough, when I first opened 6.3.9, it crashed 5 times when attempting to scrape 5 local videos I use for calibrating my TV with such titles as "1-Black Clipping.mp4" which has never happened before. I would open 6.3.9, file 1 of 5 would get a thumbnail, get a crash, open 6.3.9, file 2 of 5 would get a thumbnail, get a crash, open 6.3.9, file 3 of 5 would get a thumbnail, get a crash..and so on. Not sure if you saw those 5 crashes on your end.

As for connecting to my Windows 11 24h2 share via SMBJ, I can confirm that 6.3.9 shows me in red:

An error occurred
getSmbConnection: SMB2GuestSigningRequiredException

@courville
Copy link
Contributor

Will investigate the local video crashes tonight. I had to implement que drastic changes due to Google new requirements for targetSdk34...

@courville
Copy link
Contributor

AndroidRuntime            org.courville.nova    E  FATAL EXCEPTION: Thread-20 (Ask Gemini)
                                                   Process: org.courville.nova, PID: 2858
                                                   java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.os.Handler.sendEmptyMessageDelayed(int, long)' on a null object reference
                                                   	at android.os.Parcel.createExceptionOrNull(Parcel.java:2432)
                                                   	at android.os.Parcel.createException(Parcel.java:2410)
                                                   	at android.os.Parcel.readException(Parcel.java:2393)
                                                   	at android.os.Parcel.readException(Parcel.java:2335)
                                                   	at com.archos.mediaprovider.IMediaThumbnailService$Stub$Proxy.getThumbnail(IMediaThumbnailService.java:105)
                                                   	at com.archos.mediaprovider.video.VideoProvider$MediaThumbRequest$2.run(VideoProvider.java:1313)

courville added a commit to nova-video-player/aos-MediaLib that referenced this issue Dec 7, 2024
@courville
Copy link
Contributor

courville commented Dec 7, 2024

This should solve the thumbnail issue:
https://drive.google.com/file/d/1rCgZMgso38WunECec4cTdjB3PWz_9Jvj/view?usp=sharing, https://drive.google.com/file/d/1urWSn1Mj-AD4pHNHm6RmYyuUV4fDWe_3/view?usp=sharing
Thanks for your accurate reports

@Pentaphon
Copy link
Author

Pentaphon commented Dec 8, 2024

This should solve the thumbnail issue:

@courville Just tested and can confirm it worked. Thanks! Glad you were able to solve these various little issues on top of the original issue.

@Pentaphon
Copy link
Author

Pentaphon commented Dec 29, 2024

@courville a Kodi contributor seems to have figured out the Windows 11 24h2 passwordless SMB share issue Kodi has at xbmc/xbmc#26165

Perhaps this might also offer the solution for Nova's SMBJ issue? I could be totally wrong, but I figured it might also help Nova.

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

2 participants