![]() |
|
#1
|
|||
|
|||
|
sfxcl return value 0 on failure?
The documentation and thread in the forum that I've read say that sfxcl should return a non-zero if the run has any errors and 0 if none. What I want to know, I guess, is what exactly constitutes an 'error'? My error handling just failed to detect a failure to transmit the file because sfxcl returned 0 when it couldn't find it's configuration directory. I get a nice message:
A configuration path has not been specified or cannot be found. Please use the /F command line switch, or run the application in GUI mode first. and a 0 return value, which my code interpreted as a successful transmission of the file which it clearly was not. So, what are the cases where sfxcl will NOT transmit and WILL return 0? I would like to be able to have my calling code report failure to transmit any time there is actually a failure to transmit. I've jimmied it to watch for this message and report failure in this case. Questions: Should I need to do this (i.e., is this a bug or a feature)? Where else do I need to check something besides the return value to see if the file actually went? |
|
#2
|
||||
|
||||
|
Hello smagee,
Quote:
Would you be able to tell me the exact command line that is being used to call sfxcl? Please star out (***) sensitive information, such as passwords or passphrases and usernames. Can you tell me what version of SecureFX you are using (including the build number)? Typically, we see the error asking sfxcl to e run with a /F, sfxcl is either being run under an account that has not executed the SecureFX GUI ( in older versions), or when using sfxcl from an account that does not have a Config folder in the default location (when using newer versions). In the current version of SecureFX, you can resolve this by copying the SecureFX Config folder to a location that is accessible to the account being used to run sfxcl and specifying this using the /F option. In older versions of SecureFX, this is more problematic, as configuration information is stored in the registry under the HKEY_CURRENT_USER hive. There are a couple of work-arounds for this. If this is a scheduled task, then you can specify a user account to be used when the script is executed, when you create the task. If your script is going to be run by a different user, then the following instruction may help. They describe how to modify the registry to allow you to alllow sfxcl to be run by a system user. Please let me know how this works for you. Thanks, -bocks ================ The instructions that follow describe the process that needs to be followed in order to successfully run SFXCL as the SYSTEM user. NOTE: Before proceeding make sure you have configured the Global Configuration in SecureFX as desired. If you later make changes to the Global Options, please follow this same procedure to ensure that the SYSTEM user gets updated with the changes to SecureFX's global configuration.
|
|
#3
|
||||
|
||||
|
Hi bocks-
Quote:
One of my questions was 'Is this expected behavior?'. From the view of my calling code, there was a failure - I told sfxcl to send the file and it didn't. You are correct, my preference would be for sfxcl to return a non-zero result in any case where the file didn't get sent. However, I was aware that returning zero in this case might be designed behavior - the transmission never started, so it didn't fail. So what I need to know is the other cases where I might not actually send the file though sfxcl returns a 0. Quote:
c:\program files\securefx\sfxcl.exe /NoPrompt /RetryCount 1 <file>.zip sftp://<uid>:<pwd>@<host>/<file>.zip Quote:
sfxcl version 3.0.1 (build 869) SSH2Core version 3.1.0.545 Quote:
That is exactly the case - I forgot to run through the config before executing the calling program. So I was surprised when the calling program reported success but the files didn't show on the server. Poking around, I realized that the file actually hadn't been sent and why. I've now changed my code to read the output stream, detect this case, and generate a useful error saying that sfxcl isn't configured properly. Are there other cases where sfxcl might exit with 0 status but not actually send the file? If I only want to report success when the file is actually sent, I need to know all the cases where transmission wasn't attempted as well as the cases where the transmission failed. |
|
#4
|
||||
|
||||
|
Hi smagee,
Quote:
The expected behavior of sfxcl is to return an error for all errors or transfer failures. The exception would be when you use a command line option that modifies the default behavior. An example would be using the "/Overwrite never" command-line option to prevent a transfer form overwriting an existing file. Failure to transer a file that met this criteria would not constitue an error. This defines the behavior that you have seen as a bug. I have created an incident report and forwarded it to the SecureFX product manager and our developers. We will be posting to this Forum when a fix becomes available, but if you would like to be notified privately, I will need to get your contact information. Please send an email to me at Support@vandyke.com with a subject of Attn: Shannon re: Forums thread #984. I will then add your contact information to the notification list for this bug. Once I have some more information, I will either contact you or post back to the Forums to let you know what is happening with regards to this bug. Thank you, -bocks |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|