Permission errors in 6.11.0 when deleting files from phone with android file managers


aqua

Recommended Posts

Well... after a bit of testing, it doesn't seem to have anything to do with the smb.conf file...

 

After running testparm -v on the fedora and unraid system, I identified a list of parameters on fedora that were different.

 

[global]
    bind interfaces only = No
    host msdfs = Yes
    map to guest = Never
    max open files = 16384
    multicast dns register = Yes
    ntlm auth = ntlmv2-only
    null passwords = No
    passdb backend = tdbsam
    server min protocol = SMB2_02
    acl allow execute always = No
    aio read size = 1
    aio write size = 1
    create mask = 0744
    directory mask = 0755
    use sendfile = No
    wide links = No

 

The above changes were pushed into /boot/config/smb-extras.conf, and smb restarted... no changes to the issue at hand (although I'm keen to revisit this for performance tuning in the future, such as the aio read/write size)

 

Note: I did try 0777 on both the masks to no affect. There were also some other different parameters but they were either, completely unrelated (printer stuff), file path related, or flat out broke SMB after implementing... all those have been omitted from the list above.

 

I think from here... I might try to repeat the above using a slackware vm install... but other than that, a bit lost for now

Link to comment
  • 3 months later...

I hate to beat a dead horse, but has Lime Tech resolved this issue yet? I used to use Solid Explorer on Android all the time to manage files on my shares. Every since 6.11, I have also been experiencing failures when deleting directories with files. I've tried all of the file managers listed in this thread and none of them work. I'm sure I'm not the only one with the problem and it would be great if the devs prioritize this.

Link to comment
41 minutes ago, jserio said:

I hate to beat a dead horse, but has Lime Tech resolved this issue yet? I used to use Solid Explorer on Android all the time to manage files on my shares. Every since 6.11, I have also been experiencing failures when deleting directories with files. I've tried all of the file managers listed in this thread and none of them work. I'm sure I'm not the only one with the problem and it would be great if the devs prioritize this.

No, they haven't fixed it. File Manager + works but doesn't have multiple tabs/windows available, which kills the way I use the file managers. I haven't found one that works that allows for multiple windows/tabs.

Link to comment
14 minutes ago, aqua said:

No, they haven't fixed it. File Manager + works but doesn't have multiple tabs/windows available, which kills the way I use the file managers. I haven't found one that works that allows for multiple windows/tabs.

I just tried File Manager + and received the same error.

 

I wonder if this isn't related to Samba but perhaps the file caching or recycle bin plugins?

Screenshot_20231229-201853.png

Link to comment
1 hour ago, jserio said:

I just tried File Manager + and received the same error.

 

I wonder if this isn't related to Samba but perhaps the file caching or recycle bin plugins?

Screenshot_20231229-201853.png

To answer my own question, it has nothing to do with folder caching or the recycle bin.

 

However, if I comment out the min client directive in the Samba config (essentially enabling SMB1) and set the protocol to SMB1 in Solid Explorer, everything works. Seems to be an issue with SMB2/3 support in Unraid or the Samba version in the apps is incompatible.

Edited by jserio
Additional info.
Link to comment
  • 2 weeks later...

Thanks for kicking the topic back up and your research Jserio!

Although I've been a really happy Unraid user for quite some years now (since 2015), I'm extremely disappointed in the way that Lime-Tech (does not) handle this issue.

I'm certain that there are way more things that need to be fixed, and understand that priorities have to be made, but this has been going on for well over a year now, and still not a word from the devs about a proposed fix.

Many plugins refuse to update because of version 6.10 being too old, but updating to 6.11 or up breaks core functionality for most of us in this thread.

 

@limetech / @ljm42 Please please pretty please, could you be so kind to at least take a serious look at this issue and see what can be done about it?

 

Thanks in advance.

Edited by v3n0m
  • Thanks 1
  • Upvote 3
Link to comment
  • 1 month later...

This issue started after Samba was updated from 4.16 to 4.17, so likely some Samba change, if you can, use SMB1 since according to a post above it still works, another option if it's possible for your use case, is to use disk shares (or exclusive shares) since those are not affected.

  • Like 1
Link to comment
  • 3 weeks later...

Just for others which want to know how to enable SMBv1 on unraid (v6.8.12 currently).
 

Add the following under "Settings -> SMB -> SMB Extras":

 

# delete file workaround for android file managers -> enable SMBv1
# see thread: https://forums.unraid.net/topic/128657-permission-errors-in-6110-when-deleting-files-from-phone-with-android-file-managers/?do=findComment&comment=1387002
min protocol = NT1

 

pOpY

Edited by pOpYRaid
Link to comment
2 hours ago, pOpYRaid said:

Just for others which want to know how to enable SMBv1 on unraid (v6.8.12 currently).
 

Add the following under "Settings -> SMB -> SMB Extras":

 

# delete file workaround for android file managers -> enable SMBv1
# see thread: https://forums.unraid.net/topic/128657-permission-errors-in-6110-when-deleting-files-from-phone-with-android-file-managers/?do=findComment&comment=1387002
min protocol = NT1

 

pOpY

Turning on NetBIOS in SMB settings enables SMB1.

 

On 3/7/2024 at 1:20 PM, pOpYRaid said:

 

Would be nice this gets fixed.

SMB1 is an old protocol and is not very secure.  I would not expect LT to invest any time in making changes to an older, unsecure protocol to work better with Unraid.

 

It needs to be fixed on the Android side - like update SMB support to v2 or v3.

Link to comment
23 minutes ago, dlandon said:

SMB1 is an old protocol and is not very secure.  I would not expect LT to invest any time in making changes to an older, unsecure protocol to work better with Unraid.

 

It needs to be fixed on the Android side - like update SMB support to v2 or v3.

You are of course correct that SMB1 is problematic from a security point at this time but I don't think you are correct in stating this is something that needs to be fixed on the android side - it seems like the most probable explanation so far in this thread is this is a mis-implementation of samba on unraid, somehow. Android already has clients that can handle SMB 1, 2, and 3 and things were perfectly fine with SMB2+ on unraid 6.9.2 but broke on 6.11.0+.

  • Upvote 2
Link to comment
On 2/15/2024 at 2:03 PM, JorgeB said:

This issue started after Samba was updated from 4.16 to 4.17, so likely some Samba change

But I'm not saying it's a Samba problem, something changed in Samba and the way it interacts with FUSE, since non user shares are not affected by this.

Link to comment
5 hours ago, dlandon said:

Turning on NetBIOS in SMB settings enables SMB1.

That not worked for me.

Using the extra setting worked, also with NetBIOS disabled.

 

5 hours ago, dlandon said:

SMB1 is an old protocol and is not very secure.  I would not expect LT to invest any time in making changes to an older, unsecure protocol to work better with Unraid.

Nobody said SMBv1 should be fixed in unraid. The issue is that some android file managers not working with the unraid SMBv2/3 shares. So this must be fixed on unraid side. Windows 11 SMBv3 shares works just fine with Solid Explorer, while unraid does not 

 

5 hours ago, dlandon said:

 

It needs to be fixed on the Android side - like update SMB support to v2 or v3.

As said, other Windows SMBv3 shares works just fine in solid explorer.

Link to comment

This is 100% an issue with Samba 4.17 and the later versions of Unraid. What I'd like to know, is it possible to manually upgrade Samba to the the latest stable release, 4.19.5? This was the last thing I started to experiment with but haven't yet had time to continue....

 

I thought I might be able to use NerdTools, but there doesn't seem to be Samba available there... 

Link to comment
14 hours ago, BlueBell said:

Samba to the the latest stable release, 4.19.5?

I'm afraid I have already tested and it's still the same, it only works with disk or exclusive shares, possibly also with SMB1, didn't test that, since the Android app I use requires SMB2+

Link to comment
2 hours ago, JorgeB said:

I'm afraid I have already tested and it's still the same, it only works with disk or exclusive shares, possibly also with SMB1, didn't test that, since the Android app I use requires SMB2+

What Android app are you using?  I'd like to do some testing.

Link to comment
Just now, dlandon said:

What Android app are you using?  I'd like to do some testing.

 In my case "Solid Explorer". It has a option to switch back to SMBv1, which works with unraid (when enabled).
With SMBv2/3 it has the bug on deleting files from the array.

Link to comment
2 minutes ago, pOpYRaid said:

 In my case "Solid Explorer". It has a option to switch back to SMBv1, which works with unraid (when enabled).
With SMBv2/3 it has the bug on deleting files from the array.

Are you using the recycle bin plugin?

Link to comment

I've done some testing and found out Samba is crashing:

[2024/03/14 09:07:19.329402,  0] ../../source3/smbd/fd_handle.c:39(fd_handle_destructor)
  PANIC: assert failed at ../../source3/smbd/fd_handle.c(39): (fh->fd == -1) || (fh->fd == AT_FDCWD)
[2024/03/14 09:07:19.329435,  0] ../../lib/util/fault.c:178(smb_panic_log)
  ===============================================================
[2024/03/14 09:07:19.329442,  0] ../../lib/util/fault.c:179(smb_panic_log)
  INTERNAL ERROR: assert failed: (fh->fd == -1) || (fh->fd == AT_FDCWD) in smbd (smbd[192.168.1.) (client [192.168.1.188]) pid 22564 (4.19.5)
[2024/03/14 09:07:19.329447,  0] ../../lib/util/fault.c:186(smb_panic_log)
  If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug, see https://wiki.samba.org/index.php/Bug_Reporting
[2024/03/14 09:07:19.329451,  0] ../../lib/util/fault.c:191(smb_panic_log)
  ===============================================================
[2024/03/14 09:07:19.329464,  0] ../../lib/util/fault.c:192(smb_panic_log)
  PANIC (pid 22564): assert failed: (fh->fd == -1) || (fh->fd == AT_FDCWD) in 4.19.5
[2024/03/14 09:07:19.329708,  0] ../../lib/util/fault.c:303(log_stack_trace)

This is with samba 4.19.

 

I seem to have found a get around, but I'm baffled right now about why this works.  Install the recycle bin plugin and be sure it is running.

 

In my testing it looks like file deletes work.  Deleting directories works but an error is displayed and the Android app does not show the directory as being deleted until closed and re-opened.  The directory delete also crashes samba.  Since the recycle bin plugin is for deleted files through SMB, there is something the recycle bin vfs is doing that prevents the file deletes from failing in this situation.

 

Because samba is crashing it looks to be an issue that the samba team needs to fix.  At this time, I don't see any way through samba settings we will be able to fix this on the Unraid side.  It could also be an issue with the Android app, but I doubt it.

 

In doing some research, there is a samba bug here that might solve the issue.

  • Like 2
  • Upvote 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.