Score:0

Samba and ZFS resulting in NT_STATUS_BAD_NETWORK_NAME

jp flag

I am currently trying to share my ZFS dataset using SMB. Unfortunately I receive the error NT_STATUS_BAD_NETWORK_NAME every time I try to connect to the share. The error does not make much sense to me since as far as I understood it from this source https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-cifs/8f11e0f3-d545-46cc-97e6-f00569e3e1bc the error NT_STATUS_BAD_NETWORK_NAME is about an invalid server name. But if so, how can it be that I can flawlessly access the normal share but not the ZFS share. Shouldn't this error occur for both shares?

I also looked in to this post What does NT_STATUS_BAD_NETWORK_NAME mean in Samba? suggesting that the permissions might be set incorrectly. But I dont think that this is the cause of the problem since the permissions for both the /mnt/share as well as the /basis/media directory are set to be 755.

Maybe this error is about the configuration of the ZFS dataset or some hidden ZFS configuration that does not allow SMB to share the ZFS file system?

[global]
        workgroup = SAMBA
        security = user
        passdb backend = tdbsam
        unix password sync = yes
        passwd program = /usr/bin/passwd %u

# normal SMB share
[test]
        path = /mnt/share
        writable = yes
        browseable = yes
        read only = no
        valid users = @media
        public = no
        guest ok = no

# ZFS SMB share
[zfs]
        path = /basis/media
        writable = yes
        browseable = yes
        read only = no
        valid users = @media
        public = no
        guest ok = no

I am trying to access the share via smbclient //localhost/zfs -U <USER>%<PWD>. No matter how I am trying to access the share, either locally or from another machine, the error persists.

Edit: Part of the log file that is suspected to be related to the error

[2023/05/20 14:49:02.615284,  0] ../../source3/smbd/smb2_service.c:787(make_connection_snum)
  make_connection_snum: canonicalize_connect_path failed for service zfs, path /basis/media
[2023/05/20 14:49:02.615366,  3] ../../source3/smbd/smb2_server.c:3961(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_BAD_NETWORK_NAME] || at ../../source3/smbd/smb2_tcon.c:151
cn flag
What are the operating systems of the SMB server and the clients? Does the error occur locally or from another host if you use the IP address? Is the service actually running on the server?
Score:0
jp flag

I completely started from scratch and created a new ZFS pool. But this time I mounted the pool at /mnt/basis instead of /. For everything else, I did exactly the same as I had tried before. Although this solution worked for me, I'm not sure why it worked, because all permissions were set exactly the same.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.