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
[Solved] Direct restore (smbclient with SMB3) broken with smbclient <= 4.7.3 #175
Comments
First off, this issue is specific to smbclient, not BackupPC. In looking at the code in smbclient (source3/client/clitar.c#1639), it should check if the directory exists first before trying to create it (see the call to cli_chkpath() 4 lines earlier). I'm not sure why it fails the directory check, but it must have failed for it to attempt the cli_mkdir() that then fails. In looking at the interactive commands in client.c, if you do a "cd PATH" it calls cli_chkpath(). Does that command print an error? Similarly, the mkdir PATH command first calls cli_chkpath(). It only tries to create the path if that fails. The fact that it prints an error for you means that for some reason cli_chkpath() doesn't return success on that path. I am guessing there is something wrong with that directory. |
Hello Craig, I can open a (SMB3) session to my windows host. In this session I can change and create directories as I like.
Also testes to put some files: No Problem. I did test the direct restore operation on many shares in my environment and even asked a colleague with a different setup to test a direct restore in his environment. So if there is a problem with my directory, it seems to be something that is quite usual in windows environments. Right now, I'm not sure, if this combination of BackupPC 4.1.x/PoolV4/smbclient 4.5.x/Windows Server does work for anybody. At least no one replied to my call a few days ago. My use-case might also just be an edge case, nobody else is using. The last time I needed to recover files was in 2013 with BackupPC 3.x - no problem then. So I can't say, when [my system|BackupPC] stopped to work. One thing I noticed a few minutes ago, upping debug level:
Why do I get 'SMB2 messages'? The command should use SMB3. But this might just mean nothing. Any help on this is really appreciated. PS: Sorry for closing and reopening this. Must have hit the wrong button. |
@craigbarratt You are right: the issue is a smbclient issue. Today (after Christmas Holidays) I setup an Windows 7 Client with SMB1 enabled (and not domain joined). As soon as I gave the SMB3 option, backup failed. So it's got to be something with smbclient. Where's the place to bring this to someones attention? Is this the right place to add my findings? Or should I have written to the list? Sorry for closing & reopening. I tend to hit the wrong button... :-( Logs from two restore operations. The first one has SMB3 option as only difference. I also highlighted a few rows that seem suspicious. Why is OS/Server field empty? Running: /usr/bin/smbclient \\win7\ShareSMB1 -U backupoperator -E -d 1 -c tarmode\ full -mSMB3 -Tx - Running: /usr/bin/smbclient \\win7\ShareSMB1 -U backupoperator -E -d 1 -c tarmode\ full -Tx - |
Final note on this issue: I switched my VM from Debian 9.2 to testing (buster/sid). |
Thanks for tracking this down! Closing the issue. |
Trying a 'direct restore' to a Windows host, using the (default) configuration for smb restore:
The operation stops after trying to create a directory that already exists.
Tested on three setups:
1.) Server: Debian 8.10, BackupPC 4.1.5, smbclient 4.2.14, tar 1.27.1, Hosts: Windows Server 2012 R2, Windows 10 1709
2.) Server: Debian 9.2, BackupPC 4.1.5, smbclient 4.5.12, tar 1.29, Hosts: Windows Server 2012 R2
3.) VM Server: Debian 9.2, BackupPC 4.1.5, smbclient 4.5.12, tar 1.29, Hosts: Windows Server 2016
What I've done and checked so far:
Although this was not likely, since smbclient-sessions do work.
Proposed solution:
Let BackupPC continue to work, if creation of a directory fails just because it already exists. Alternatively do not try to create a directory, if it already exists.
The text was updated successfully, but these errors were encountered: