rockstor / rockstor-core

Linux/BTRFS based Network Attached Storage(NAS)
http://rockstor.com/docs/contribute_section.html
GNU General Public License v3.0
557 stars 138 forks source link

smb is faulty #1755

Closed eliasmagn closed 11 months ago

eliasmagn commented 7 years ago

I am unable to connect from a windows 7 client to the rockstore share. When starting samba with smb -F I am able to connect but the transfer speed about 160MBs breaks down to 5,4MBs in 3minutes. Tested with 13k files with a size of 10kB to 10Mbs and with 2 different vdi images of ~ 10Gb size there is no diffrence i am using a router with openwrt. testet samba between debian stretch and same windows client via wireless is much faster. i will test the ethnic speed via cable tomorrow Logfiles from deamonized smbd -->

Traceback (most recent call last):
  File "/opt/rockstor/bin/mnt-share", line 42, in <module>
    import scripts.mount_share
  File "/opt/rockstor/src/rockstor/scripts/__init__.py", line 5, in <module>
    django.setup()
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/__init__.py", line 17, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/utils/log.py", line 86, in configure_logging
    logging_config_func(logging_settings)
  File "/usr/lib64/python2.7/logging/config.py", line 803, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib64/python2.7/logging/config.py", line 585, in configure
    '%r: %s' % (name, e))
ValueError: Unable to configure handler 'file': [Errno 13] Permission denied: '/opt/rockstor/var/log/rockstor.log'

log from non-deamonized smb -F --> STATUS=daemon 'smbd' finished starting up and ready to serve connections

eliasmagn commented 7 years ago

chown root /opt/rockstor/var/log/rockstor.log I am wondering about that error because smb runs as root on rockstore 3.9.1! can someone provide me with a ls -lah /opt/rockstor/var/log/rockstor.log I have forgotten the original permissions. to reproduce the error! I'll do a test install on a virtualhost soon.

phillxnet commented 7 years ago

@eliasmagn Pretty sure you can just delete that log and it will get re-created (once there is something to log of course).

From a fresh source code build:

-rw-r--r-- 1 root root 13769 Jul 11 17:07 /opt/rockstor-dev/var/log/rockstor.log

And from a regular install:

-rw-r--r-- 1 root root 702964 Jul  9 19:09 /opt/rockstor/var/log/rockstor.log
eliasmagn commented 7 years ago

I really don't know anything about django nor what causing its problem.. but the error persists even with a chown root /opt/rockstor/var/log/rockstor.log i have not the courage to remove the line from /opt/rockstor/bin/mnt-share causing the failure I have increased the debug level: This is running as deamon configured with rockstor vanilla :

[2017/07/13 00:13:13.486542,  1] ../source3/smbd/service.c:739(make_connection_snum)
  root preexec gave 1 - failing connection
[2017/07/13 00:13:13.486815,  3] ../source3/smbd/smb2_server.c:3098(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../source3/smbd/smb2_tcon.c:135
[2017/07/13 00:13:13.487904,  3] ../source3/lib/access.c:338(allow_access)
  Allowed connection from 192.168.1.219 (192.168.1.219)
[2017/07/13 00:13:13.488141,  3] ../source3/smbd/service.c:622(make_connection_snum)
  Connect path is '/mnt2/usdssdr5' for service [usdssdr5]
[2017/07/13 00:13:13.488268,  3] ../source3/smbd/vfs.c:113(vfs_init_default)
  Initialising default vfs hooks
[2017/07/13 00:13:13.488344,  3] ../source3/smbd/vfs.c:139(vfs_init_custom)
  Initialising custom vfs hooks from [/[Default VFS]/]
Traceback (most recent call last):
  File "/opt/rockstor/bin/mnt-share", line 42, in <module>
    import scripts.mount_share
  File "/opt/rockstor/src/rockstor/scripts/__init__.py", line 5, in <module>
    django.setup()
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/__init__.py", line 17, in setup
    configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
  File "/opt/rockstor/eggs/Django-1.8.16-py2.7.egg/django/utils/log.py", line 86, in configure_logging
    logging_config_func(logging_settings)
  File "/usr/lib64/python2.7/logging/config.py", line 803, in dictConfig
    dictConfigClass(config).configure()
  File "/usr/lib64/python2.7/logging/config.py", line 585, in configure
    '%r: %s' % (name, e))
ValueError: Unable to configure handler 'file': [Errno 13] Permission denied: '/opt/rockstor/var/log/rockstor.log'
[2017/07/13 00:13:14.689569,  1] ../source3/smbd/service.c:739(make_connection_snum)
  root preexec gave 1 - failing connection
[2017/07/13 00:13:14.689761,  3] ../source3/smbd/smb2_server.c:3098(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../source3/smbd/smb2_tcon.c:135
[2017/07/13 00:14:08.736770,  2] ../source3/smbd/process.c:2875(deadtime_fn)
  Closing idle connection
[2017/07/13 00:14:08.737073,  3] ../source3/smbd/server.c:154(msg_exit_server)
  got a SHUTDOWN message
[2017/07/13 00:14:08.738151,  3] ../source3/smbd/server_exit.c:246(exit_server_common)
  Server exit (normal exit)
[2017/07/13 00:14:08.743845,  3] ../source3/lib/util_procid.c:54(pid_to_procid)
  pid_to_procid: messaging_dgm_get_unique failed: Datei oder Verzeichnis nicht gefunden

And this one is from terminal with log to stdout :

[root@nas ~]# smbd -F -i -S -d 3
smbd version 4.4.4 started.
Copyright Andrew Tridgell and the Samba Team 1992-2016
uid=0 gid=0 euid=0 egid=0
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[sdabr1]"
Processing section "[usdssdr5]"
adding IPC service
added interface enp1s0 ip=192.168.1.183 bcast=192.168.1.255 netmask=255.255.255.0
loaded services
INFO: Profiling turned OFF from pid 13028
No builtin backend found, trying to load plugin
Module 'tdbsam' loaded
Failed to fetch domain sid for SAMBA
Failed to fetch domain sid for SAMBA
Initialise the svcctl registry keys if needed.
Initialise the eventlog registry keys if needed.
reloading printcap cache
reload status: ok
reloading printcap cache
cups_pcap_load_async: already waiting for a refresh event
reload status: error
waiting for connections
Unable to connect to CUPS server localhost:631 - Der Socket ist nicht verbunden
failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
Could not find child 13030 -- ignoring
Allowed connection from 192.168.1.219 (192.168.1.219)
init_oplocks: initializing messages.
Transaction 0 of length 108 (0 toread)
Selected protocol SMB2_10
GENSEC backend 'gssapi_spnego' registered
GENSEC backend 'gssapi_krb5' registered
GENSEC backend 'gssapi_krb5_sasl' registered
GENSEC backend 'spnego' registered
GENSEC backend 'schannel' registered
GENSEC backend 'naclrpc_as_system' registered
GENSEC backend 'sasl-EXTERNAL' registered
GENSEC backend 'ntlmssp' registered
GENSEC backend 'ntlmssp_resume_ccache' registered
GENSEC backend 'http_basic' registered
GENSEC backend 'http_ntlm' registered
Got NTLMSSP neg_flags=0xe2088297
Got user=[morn] domain=[XXXXXXXXXX] workstation=[XXXXXXXXXX] len1=24 len2=236
lp_load_ex: refreshing parameters
Initialising global parameters
Processing section "[global]"
Processing section "[homes]"
Processing section "[printers]"
Processing section "[print$]"
Processing section "[sdabr1]"
Processing section "[usdssdr5]"
adding IPC service
check_ntlm_password:  Checking password for unmapped user [XXXXXXXXXX]\[morn]@[X                                                                                                                                                             XXXXXXXXX] with the new password interface
check_ntlm_password:  mapped user is: [NAS]\[morn]@[XXXXXXXXXX]
Forcing Primary Group to 'Domain Users' for morn
check_ntlm_password: sam authentication for user [morn] succeeded
check_ntlm_password:  authentication for user [morn] -> [morn] -> [morn] succeed                                                                                                                                                             ed
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0xe2088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0xe2088215
Failed to fetch domain sid for SAMBA
Failed to fetch domain sid for SAMBA
Adding homes service for user 'morn' using home directory: '/home/morn'
adding home's share [morn] for user 'morn' at '/home/morn'
Allowed connection from 192.168.1.219 (192.168.1.219)
Connect path is '/mnt2/usdssdr5' for service [usdssdr5]
Initialising default vfs hooks
Initialising custom vfs hooks from [/[Default VFS]/]
string_to_sid: SID morn is not in a valid format
Forcing Primary Group to 'Domain Users' for morn
check_user_ok: user morn is an admin user. Setting uid as 0
xxxxxxxxxx (ipv4:192.168.1.219:51804) connect to service usdssdr5 initially as u                                                                                                                                                             ser morn (uid=0, gid=1000) (pid 13028)
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_                                                                                                                                                             OBJECT_NAME_NOT_FOUND] || at ../source3/smbd/smb2_create.c:293
creating new dirptr 0 for path ., expect_close = 0
smbd_dirptr_get_entry mask=[*] found . fname=. (.)
smbd_dirptr_get_entry mask=[*] found .. fname=.. (..)
smbd_dirptr_get_entry mask=[*] found speedtestimg fname=speedtestimg (speedtesti                                                                                                                                                             mg)
################################################
##Here i cutted the output.. many files from sysbench ... XD##
################################################
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[5] status[STATUS_NO_                                                                                                                                                             MORE_FILES] || at ../source3/smbd/smb2_query_directory.c:155
smbd_smb2_notify_send: notify change called on ., filter = FILE_NAME|DIR_NAME|AT                                                                                                                                                             TRIBUTES|LAST_WRITE, recursive = 0
Allowed connection from 192.168.1.219 (192.168.1.219)
Connect path is '/tmp' for service [IPC$]
Initialising default vfs hooks
Initialising custom vfs hooks from [/[Default VFS]/]
xxxxxxxxxx (ipv4:192.168.1.219:51804) connect to service IPC$ initially as user                                                                                                                                                              morn (uid=1000, gid=1000) (pid 13028)
get_referred_path: |usdssdr5| in dfs path \192.168.1.183\usdssdr5 is not a dfs r                                                                                                                                                             oot.
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_                                                                                                                                                             NOT_FOUND] || at ../source3/smbd/smb2_ioctl.c:309
smbd_do_qfsinfo: level = 1001
smbd_do_qfsinfo: level = 1005
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_                                                                                                                                                             FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_                                                                                                                                                             FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_                                                                                                                                                             FS_DRIVER_REQUIRED] || at ../source3/smbd/smb2_ioctl.c:309
morn opened file speedtestimg read=No write=No (numopen=3)
morn closed file speedtestimg (numopen=4) NT_STATUS_OK
################################################
##Here i cutted the output.. many files from sysbench ... XD##
################################################
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_                                                                                                                                                             FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_                                                                                                                                                             FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_                                                                                                                                                             FS_DRIVER_REQUIRED] || at ../source3/smbd/smb2_ioctl.c:309
xxxxxxxxxx (ipv4:192.168.1.219:51804) closed connection to service IPC$
smbd_do_qfsinfo: level = 1001
smbd_do_qfsinfo: level = 1005
Allowed connection from 192.168.1.219 (192.168.1.219)
Connect path is '/tmp' for service [IPC$]
Initialising default vfs hooks
Initialising custom vfs hooks from [/[Default VFS]/]
xxxxxxxxxx (ipv4:192.168.1.219:51804) connect to service IPC$ initially as user morn (uid=1000, gid=1000) (pid 13028)
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FS_DRIVER_REQUIRED] || at ../source3/smbd/smb2_ioctl.c:309
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FS_DRIVER_REQUIRED] || at ../source3/smbd/smb2_ioctl.c:309
xxxxxxxxxx (ipv4:192.168.1.219:51804) closed connection to service IPC$
Allowed connection from 192.168.1.219 (192.168.1.219)
Connect path is '/tmp' for service [IPC$]
Initialising default vfs hooks
Initialising custom vfs hooks from [/[Default VFS]/]
xxxxxxxxxx (ipv4:192.168.1.219:51804) connect to service IPC$ initially as user morn (uid=1000, gid=1000) (pid 13028)
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FILE_CLOSED] || at ../source3/smbd/smb2_server.c:2512
smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FS_DRIVER_REQUIRED] || at ../source3/smbd/smb2_ioctl.c:309
xxxxxxxxxx (ipv4:192.168.1.219:51804) closed connection to service IPC$

This is a lot of log data but i like to use the samba server! more than 111Mb/s up and 120 Mb/s down is pssible when running from commandline!

Hooverdan96 commented 11 months ago

since it has been over 6 years, and smb as well as Rockstor have gone through quite a few changes in this space, I recommend we close this issue. When it comes up again, we'll get a fresh start on it.