Differences
This shows you the differences between the selected revisions of the page.
2019-08-26 | 2019-08-26 | ||
links (martin) | structure (martin) | ||
Line 1: | Line 1: | ||
====== Why I cannot connect/transfer using script, when I can using GUI (or vice versa)? ====== | ====== Why I cannot connect/transfer using script, when I can using GUI (or vice versa)? ====== | ||
- | There are two common reasons for that: | + | ===== Common Problems ===== |
- | * You run script from a different environment (under a different account/service; with a different configuration) than the GUI. See another [[faq_scheduler|F.A.Q.]] ((Although it covers a different topic, its recommendations are valid for this case as well.)) | + | There are two common reasons why a script does not work, when a connectivity is otherwise possible: |
+ | * You run script from a different environment (under a different account/service; with a different configuration) than the GUI. \\ See another FAQ: [[faq_scheduler|My script works fine when executed manually, but fails or hangs when run by Windows Scheduler, SSIS or other automation service. What am I doing wrong?]] ((Although it covers a different topic, its recommendations are valid for this case as well.)) | ||
* You have your [[session_configuration|session configured]] differently in the script and in the %%GUI%%. | * You have your [[session_configuration|session configured]] differently in the script and in the %%GUI%%. | ||
* Use a [[ui_generateurl|Generate Session URL/Code]] command to avoid common mistakes in manually typed URL's or code; and to make sure all the settings from your GUI configuration is used in the script. \\ A common problem is [[session_url#special|special characters]] in some part of the [[session_url|session URL]] (typically a password or a username). | * Use a [[ui_generateurl|Generate Session URL/Code]] command to avoid common mistakes in manually typed URL's or code; and to make sure all the settings from your GUI configuration is used in the script. \\ A common problem is [[session_url#special|special characters]] in some part of the [[session_url|session URL]] (typically a password or a username). | ||
* Passphrase to an SSH private key is not a password, you need to specify it using ''[[scriptcommand_open|-passphrase]]'' switch, not in a password part of the session %%URL%%. | * Passphrase to an SSH private key is not a password, you need to specify it using ''[[scriptcommand_open|-passphrase]]'' switch, not in a password part of the session %%URL%%. | ||
* With [[webdav|WebDAV]] and [[s3|S3]] protocols, it is possible that you do not have an access to the root folder (bucket list in S3). You may need to specify your WebDAV root or S3 bucket in the session URL. For example ''%%https://username@example.com/dav/%%'' or ''%%s3://key@s3.amazonaws.com/bucket/%%''. Even if you have the code generated from a working WinSCP GUI session, it won't include the root path, as the GUI cannot be aware of the root path restriction. | * With [[webdav|WebDAV]] and [[s3|S3]] protocols, it is possible that you do not have an access to the root folder (bucket list in S3). You may need to specify your WebDAV root or S3 bucket in the session URL. For example ''%%https://username@example.com/dav/%%'' or ''%%s3://key@s3.amazonaws.com/bucket/%%''. Even if you have the code generated from a working WinSCP GUI session, it won't include the root path, as the GUI cannot be aware of the root path restriction. | ||
+ | |||
+ | ===== Logging ===== | ||
You can also enable a [[logging|session logging]] both in the %%GUI%% (on //[[ui_pref_logging|Logging page]]// of Preferences dialog) and the script (using a command-line parameter ''[[commandline#logging|/log]]'') and compare the logs to find out what is different. Use a command-line parameter ''[[commandline#logging|/loglevel=*]]'' to enable a password logging and check if a correct password is used. | You can also enable a [[logging|session logging]] both in the %%GUI%% (on //[[ui_pref_logging|Logging page]]// of Preferences dialog) and the script (using a command-line parameter ''[[commandline#logging|/log]]'') and compare the logs to find out what is different. Use a command-line parameter ''[[commandline#logging|/loglevel=*]]'' to enable a password logging and check if a correct password is used. | ||
Line 11: | Line 14: | ||
If you decide to [[troubleshooting|seek a help]], make sure you provide both complete logs, when describing your issue. | If you decide to [[troubleshooting|seek a help]], make sure you provide both complete logs, when describing your issue. | ||
- | See also: | + | ===== Further Reading ==== |
* More generic article on [[faq_environment|making WinSCP work in a new environment (operating system, machine, user account, network)]]. | * More generic article on [[faq_environment|making WinSCP work in a new environment (operating system, machine, user account, network)]]. | ||
* [[guide_debugging_scheduler|Debugging transfer task running in Windows Scheduler, SSIS or other automation service]]. | * [[guide_debugging_scheduler|Debugging transfer task running in Windows Scheduler, SSIS or other automation service]]. |