Samba storage is not online

yarii

Renowned Member
Mar 24, 2014
145
8
83
I cannot use samba storage from plugin. After clicking contents there is a message "storage 'backup-input' is not online (500)".

But from console:

$ mount | grep /mnt/pve --count
2

I can enter to this dirs and do commands like ls, touch.

As You can see in screenshot there is Enabled = NO :(
Tried to disable/enable storage but It did not repair this.

# tail /var/log/syslog | grep backup-input
Aug 30 13:32:32 vps2 pvedaemon[1620]: storage 'backup-input' is not online
Aug 30 13:32:33 vps2 pvedaemon[1621]: storage 'backup-input' is not online
Aug 30 13:32:34 vps2 pvedaemon[1622]: storage 'backup-input' is not online
Aug 30 13:32:39 vps2 pvestatd[1589]: storage 'backup-input' is not online
Aug 30 13:32:39 vps2 pvedaemon[1620]: storage 'backup-input' is not online
 

Attachments

  • cifs.png
    cifs.png
    23.8 KB · Views: 14
Hi,

the mount command only indicates that this share was mounted not that it is available.
To ensure that the mount is working you must write on this share.

Maybe you smb server is not answering the online check.
Code:
 smbclient  //192.168.18.70/<Share> -d 0 -m smb3 -U Guest -N -c 'echo 1 0'
 
Last edited:
Well this storage (but has other samba share) is used also for second server as a backup storage (the server is older version of proxmox) and there is no problem like this. I use cifs plugin there also.

smbclient //ipaddress/input-vps2 -d 0 -m smb3 -U vps2_rw -c 'echo 1 0'
Enter vps2_rw's password:
Domain=[DSM1] OS=[] Server=[]
 
And there is a bug - If You remove a storage. This directory doesn't unmount the CIFS share.
 
> the mount command only indicates that this share was mounted not that it is available.

That was the purpose of using ls and touch commands to check that in first post.
 
And there is a bug - If You remove a storage. This directory doesn't unmount the CIFS share.
This is not a bug this is intended.
 
So the share is mounted right. I could do whatever I want but GUI says that storage is offline. If I don't use a plugin-storage-samba and mount directory by hand (or by fstab) in /mnt and add that as a storage all the things are working as I expected.

Where is the code that is checking avability of storage?
 
Why don't You check storage avability by ping? It's no use to relogin every time to check if its avaible.

I did:
Code:
time smbclient  //192.168.18.70/<Share> -d 0 -m smb3 -U Guest -N -c 'echo 1 0'

and this command and the results are:

real 0m3.636s
user 0m0.063s
sys 0m0.008s

So think this function needs to be repaired in some other way.

# ping 10.100.0.200
PING 10.100.0.200 (10.100.0.200) 56(84) bytes of data.
64 bytes from 10.100.0.200: icmp_seq=1 ttl=64 time=0.288 ms
64 bytes from 10.100.0.200: icmp_seq=2 ttl=64 time=0.285 ms
64 bytes from 10.100.0.200: icmp_seq=3 ttl=64 time=0.283 ms

This is a Synology DSM with
# samba --version
Version 4.4.16

Code:
sub check_connection {
    my ($class, $storeid, $scfg) = @_;

    my $server = $scfg->{server};

    my $cmd = ['/usr/bin/smbclient', '-L', $server, '-d', '0', '-m'];

    push @$cmd, $scfg->{smbversion} ? "smb".int($scfg->{smbversion}) : 'smb3';

    if (my $cred_file = get_cred_file($storeid)) {
    push @$cmd, '-U', $scfg->{username}, '-A', $cred_file;
    push @$cmd, '-W', $scfg->{domain} if defined($scfg->{domain});
    } else {
    push @$cmd, '-U', 'Guest','-N';
    }

    my $out_str;
    eval {
    run_command($cmd, timeout => 2, outfunc => sub {$out_str .= shift;},
            errfunc => sub {});
    };

    if (my $err = $@) {
    die "$out_str\n" if ($out_str =~ m/NT_STATUS_ACCESS_DENIED/);
    return 0;
    }

    return 1;
}
 
This stopped working after last samba client upgrade whitch did requirement not to use smb1 whitch was default allowed in Synology NAS. So maybe You should allow what version of samba to use when mounting and not to require smb3?
 
Why don't You check storage avability by ping?
Ping is not a proper test it only says ipmc is working.
I saw Server where the kernel was frozen and you can ping them.

So maybe You should allow what version of samba to use when mounting and not to require smb3?
You can set version to smb2.
smb1 is deprecated and in the whole world as unsecure known.
If you have software what relay on smb1 I would change it.
 
This function only works propper in smb1. In SMB2 and SMB3 the login process takes lot more time and sometimes it doesn't fit in required 5seconds.

How to change this in client to negotiate smb2 insted smb3 ?
 
see man pvecm
option --smbversion

and sometimes it doesn't fit in required 5seconds.
It has to answer in 2 sec.

can you please run this
Code:
for i in {1..20}; do time /usr/bin/smbclient //ipaddress/input-vps2 -d 0 -m smb3 -U vps2_rw -c 'echo 1 0'; done;
 
Ok - I found this: share/perl5/PVE/Storage/CIFSPlugin.pm.

Will You do commit with this to pve-storage ?
 
In file "/usr/share/perl5/PVE/Storage/CIFSPlugin.pm"

Change from:
Code:
my $cmd = ['/usr/bin/smbclient', '-L', $server, '-d', '0', '-m'];
to
Code:
my $cmd = ['/usr/bin/smbclient', $server, '-d', '0', '-m'];
 
You are on an old version because this is already changed.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!