thomasmauerer / hassio-addons

My collection of addons for Home Assistant
MIT License
458 stars 54 forks source link

SMB timeout #120

Open 2-MAdD opened 1 year ago

2-MAdD commented 1 year ago

Hi,

i'm getting this error on HA using this plugin:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/00-banner.sh
-----------------------------------------------------------
 Add-on: Samba Backup
 Create backups and store them on a Samba share
-----------------------------------------------------------
 Add-on version: 5.2.0
 You are running the latest version of this add-on.
 System: Home Assistant OS 9.3  (amd64 / qemux86-64)
 Home Assistant Core: 2022.11.4
 Home Assistant Supervisor: 2022.11.2
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
cont-init: info: /etc/cont-init.d/00-banner.sh exited 0
cont-init: info: running /etc/cont-init.d/01-log-level.sh
Log level is set to DEBUG
cont-init: info: /etc/cont-init.d/01-log-level.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
[22-11-25 13:07:51] INFO: ---------------------------------------------------
[22-11-25 13:07:51] INFO: Host/Share: 192.168.xx.xx/Temp_restore
[22-11-25 13:07:51] INFO: Target directory: HA_Backup
[22-11-25 13:07:51] INFO: Keep local/remote: 7/14
[22-11-25 13:07:51] INFO: Trigger time: 11:37
[22-11-25 13:07:51] INFO: Trigger days: Mon Tue Wed Thu Fri Sat Sun
[22-11-25 13:07:51] INFO: ---------------------------------------------------
[22-11-25 13:07:51] DEBUG: Backups local/remote: 0/0
[22-11-25 13:07:51] DEBUG: Total backups succeeded/failed: 0/0
[22-11-25 13:07:51] DEBUG: Last backup: never
[22-11-25 13:07:57] WARNING: do_connect: Connection to 192.168.xx.xx failed (Error NT_STATUS_IO_TIMEOUT)
[22-11-25 13:07:57] FATAL: Cannot access share. Unknown reason.
[22-11-25 13:07:57] DEBUG: Posting sensor data to API at /core/api/states/sensor.samba_backup
[22-11-25 13:07:57] DEBUG: API Status: 200
[22-11-25 13:07:57] DEBUG: API Response: {"entity_id":"sensor.samba_backup","state":"FAILED","attributes":{"friendly_name":"Samba Backup","backups_local":"0","backups_remote":"0","total_backups_succeeded":"0","total_backups_failed":"0","last_backup":"never"},"last_changed":"2022-11-25T12:05:03.254218+00:00","last_updated":"2022-11-25T12:05:03.254218+00:00","context":{"id":"01GJQATJMPDJ8YVCNDKNCCH86J","parent_id":null,"user_id":"f9392b5e809040cf89076526c9e48d01"}}

looking at the error WARNING: do_connect: Connection to 192.168.xx.xx failed (Error NT_STATUS_IO_TIMEOUT) and google it, it seems to be something with SMB versions:

his is most likely because the box your trying to do smbclient uses an outdated (and insecure) version of SMB such as SMBv1.

You'll need to edit the smb.conf in your machine and specify the client min protocol into CORE. You'll also need to specify the client max protocol into SMB3.

More information here: https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html

Steps: On your host machine:

sudo nano /etc/samba/smb.conf
Add the following settings under Global Settings:
client min protocol = CORE
client max protocol = SMB3
Write (Ctrl + O) and Exit (Ctrl + X) nano text editor.
Retry smbclient

see here

as my nas is on SMBv3 i dont want to downgrade it.

thomasmauerer commented 1 year ago

Actually it's the other way around. This most likely means that your NAS only supports an outdated SMB version, so this addon refuses to connect. You could take a look at the compatibility_mode option --> https://github.com/thomasmauerer/hassio-addons/blob/master/samba-backup/DOCS.md#option-compatibility_mode

2-MAdD commented 1 year ago

Hi, tried that also, but gives the same error message. The SMB on my NAS (Synology) is set to:

Maximum SMB3 Minimum SMB2 and large MTU

Please let me know if you need more information