network-share-reconnecter icon indicating copy to clipboard operation
network-share-reconnecter copied to clipboard

Silent Failure

Open bisraelsen opened this issue 5 years ago • 4 comments

I'm attempting to re-map drives. With the debug mode on I get a window showing that all of the servers are online, but then there are no other messages, and the drive connections are not refreshed...

I can connect the drives by hand.

Any ideas?

bisraelsen avatar Aug 23 '19 14:08 bisraelsen

@bisraelsen Hello can you please share your settings (please exclude the password if defined). If the online debug message appears that means that the remapping was actually done (ping ok + net use executed). Are you sure they are not refreshed? Sometimes the explorer doesn't update. You have to close and reopen or refresh (F5). Let me know what you think.

thexmanxyz avatar Aug 24 '19 09:08 thexmanxyz

@bisraelsen When everything is executed to establish the drive connection the script terminates. So if every server / shares is online and the net use was executed you are actually only getting one message. If you are sure the drives are still offline it might be a configuration issue.

thexmanxyz avatar Aug 24 '19 09:08 thexmanxyz

See my config below. I am pretty sure the "H" drive is not connected because I get a "this file is currently not available for use on this computer" message.

Dim srvConfigs

'Server Configuration (UNC)'
'Set srvCfgX = createUncSrvConfig(hostname, sharePaths, shareLetters, persistent, username, password)

'Server Configuration (URI)'
'Set srvCfgY = createUriSrvConfig(hostname, sharePaths, shareLetters, persistent, username, password, secure)

'Multi Server Configuration - three servers with two shares for each endpoint [remove unnecessary lines]'
Set srvCfg1 = createUncSrvConfig("server1", Array("\home3\user"), Array("H:"), "yes", "", "")
Set srvCfg2 = createUncSrvConfig("server2", Array("share1"), Array("S:"), "yes", "", "")
Set srvCfg3 = createUncSrvConfig("server3", Array("share2"), Array("P:"), "yes", "", "")
Set srvCfg4 = createUncSrvConfig("server4", Array("apps"), Array("U:"), "yes", "", "")

'add more server configurations here or remove them if needed [remove srvCfg2 and srvCfg3 for single server configuration]'
'srvConfigs = Array(srvCfg1, srvCfg2, srvCfg3) 
srvConfigs = Array(srvCfg1,srvCfg2,srvCfg3,srvCfg4) 

'-------------------------------------------------------------------------------------'
'                                                                                     '
'                                 Configure Script                                    '
'                                                                                     '
' These are the OPTIONAL script parameters which can be adapted to TUNE               '
' the script if it reconnects to slow or to MINIMIZE the overhead.                    '
'                                                                                     '
' pingEnabled - defines whether the script should use ping availability check         '
' pingWait - wait time after failed server ping                                       '
' pingTimeout - how many milliseconds pass before the ping is canceled                '
' pingCtn - how many pings per access request should be executed before giving up     '
' pingDefaultSrv - use common server if target service rejects pings (URI only)       '
' netUseWait - wait time after failed net use                                         '
' netUseCtn - how many net use fails per reconnect are allowed before giving up       '
' reconWait - wait time after failed availability check                               '
' reconAdaptive - boolean to enable automatic reconnection intensity or not           '
' serverRetryCtn - how many overall reconnection tries should be executed             '
' debug - enable or disable debug messages on current reconnection state              '
'-------------------------------------------------------------------------------------'

Set scriptConfig = new ScriptConfiguration
scriptConfig.pingEnabled = true
scriptConfig.pingWait = 100
scriptConfig.pingTimeout = 200
scriptConfig.pingCtn = 4
scriptConfig.pingDefaultSrv = false
scriptConfig.netUseWait = 0
scriptConfig.netUseCtn = 1
scriptConfig.reconWait = 2500
scriptConfig.reconAdaptive = true
scriptConfig.serverRetryCtn = 75
scriptConfig.debug = true

bisraelsen avatar Sep 09 '19 15:09 bisraelsen

@bisraelsen Thanks for your response. Everything looks quite well from the configuration perspective. Below I will anyway attach the documentation on server configurations. Maybe I missed something.

I would change (even if I'm pretty sure that this case is covered by the script): Set srvCfg1 = createUncSrvConfig("server1", Array("\home3\user"), Array("H:"), "yes", "", "") to Set srvCfg1 = createUncSrvConfig("server1", Array("home3\user"), Array("H:"), "yes", "", "")

when your original UNC path is \\server1\home3\user. If your shares are password protected I might also suggest to use the credentials within the script to verify if this changes something or fixes the issue (but it shouldn't be necessary). What is the SMB version of the server(s)? As an additional debug information you can add the following line:

MsgBox(getNetUseCmd(srvConfig, j))

below the line marked in the script here

This will output the net use commands executed during script execution, you can add the resulting commands here (password cleaned) which will help approaching the issue. Also it might show if there is an issue with the net use command. If you used hostnames instead of IPs like in your example snippet above. I would also try to use IPs if possible to narrow down the problem. This might also solve the problem. Please beware to use UNC in case of UNC shares and URI in case of URI shares. Is none of the shares reconnected?

UNC Sample Configuration

If your share is accessible over an UNC path like \\192.168.1.1\path\to\share use:

createUncSrvConfig("192.168.1.1", Array("path\to\share"), Array("Z:"), "yes", "", "")

URI Sample Configuration

If your share needs to be accessed over HTTP(S) like http://my.webserver.com/path/to/share use:

createUriSrvConfig("my.webserver.com", Array("path/to/share"), Array("Z:"), "yes", "", "", false)

thexmanxyz avatar Sep 10 '19 10:09 thexmanxyz