Status Code
Hi,
FTP is giving a status code = 2 and am not sure why?
Here is the log:
It is at this line:
Here is my code:
I am using the same FTP script for others but this is the only one failing with status code =2
Any help is appreciated.
FTP is giving a status code = 2 and am not sure why?
Here is the log:
It is at this line:
< 2023-05-16 09:17:17.964 Status code: 2
2023-05-16 09:17:17.884 Script: Authenticated. . 2023-05-16 09:17:17.884 -------------------------------------------------------------------------- . 2023-05-16 09:17:17.884 Using SFTP protocol. . 2023-05-16 09:17:17.885 Doing startup conversation with host. < 2023-05-16 09:17:17.885 Script: Starting the session... > 2023-05-16 09:17:17.885 Type: SSH_FXP_INIT, Size: 5, Number: -1 < 2023-05-16 09:17:17.902 Type: SSH_FXP_VERSION, Size: 176, Number: -1 . 2023-05-16 09:17:17.902 SFTP version 6 negotiated. . 2023-05-16 09:17:17.903 Server requests EOL sequence "\r\n". . 2023-05-16 09:17:17.903 Server software: Cerberus FTP Server 11.1.0.0 (110100000) by Cerberus, LLC . 2023-05-16 09:17:17.903 Server support information (supported2): . 2023-05-16 09:17:17.903 Attribute mask: 2BD, Attribute bits: FF, Open flags: 7 . 2023-05-16 09:17:17.903 Access mask: 3, Open block vector: 0, Block vector: 0, Max read size: 0 . 2023-05-16 09:17:17.903 Attribute extensions (0) . 2023-05-16 09:17:17.903 Extensions (2) . 2023-05-16 09:17:17.903 check-file . 2023-05-16 09:17:17.903 copy-file . 2023-05-16 09:17:17.903 We will use UTF-8 strings as it is mandatory with SFTP version 4 and newer . 2023-05-16 09:17:17.903 Getting current directory name. . 2023-05-16 09:17:17.903 Getting real path for '.' > 2023-05-16 09:17:17.903 Type: SSH_FXP_REALPATH, Size: 11, Number: 16 < 2023-05-16 09:17:17.922 Type: SSH_FXP_NAME, Size: 72, Number: 16 . 2023-05-16 09:17:17.923 Real path is '/' . 2023-05-16 09:17:17.923 Startup conversation with host finished. < 2023-05-16 09:17:17.923 Script: Session started. < 2023-05-16 09:17:17.923 Script: Active session: [1] FRO098@ftp.glasslewis.com > 2023-05-16 09:17:17.923 Script: put \\fcmcftp\FTP\Usr\Portia\ProxyHoldings\FRO098*.csv . 2023-05-16 09:17:17.924 Copying 1 files/directories to remote directory "/" - total size: 238,997 . 2023-05-16 09:17:17.925 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: . 2023-05-16 09:17:17.925 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; EncryptNewFiles: Yes; ExcludeHiddenFiles: No; ExcludeEmptyDirectories: No; InclM: ; ResumeL: 0 . 2023-05-16 09:17:17.925 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml . 2023-05-16 09:17:17.925 File: '\\fcmcftp\FTP\Usr\Portia\ProxyHoldings\FRO098-20230515.csv' [2023-05-16T07:25:40.635Z] [238997] . 2023-05-16 09:17:17.927 Copying \\fcmcftp\FTP\Usr\Portia\ProxyHoldings\FRO098-20230515.csv to remote directory started. . 2023-05-16 09:17:17.927 Binary transfer mode selected. . 2023-05-16 09:17:17.927 Checking existence of file. > 2023-05-16 09:17:17.927 Type: SSH_FXP_LSTAT, Size: 33, Number: 263 < 2023-05-16 09:17:17.946 Type: SSH_FXP_ATTRS, Size: 62, Number: 263 . 2023-05-16 09:17:17.946 File exists: FRO098-20230515.csv;-;238997;2023-05-16T07:25:40.000Z;4;"" [0];"" [0];rw-rw-rw-;1 . 2023-05-16 09:17:17.946 Checking existence of partially transferred file. > 2023-05-16 09:17:17.946 Type: SSH_FXP_LSTAT, Size: 42, Number: 519 < 2023-05-16 09:17:17.964 Type: SSH_FXP_STATUS, Size: 55, Number: 519 < 2023-05-16 09:17:17.964 Status code: 2 . 2023-05-16 09:17:17.964 Opening remote file. > 2023-05-16 09:17:17.964 Type: SSH_FXP_OPEN, Size: 51, Number: 771 < 2023-05-16 09:17:17.984 Type: SSH_FXP_HANDLE, Size: 47, Number: 771 > 2023-05-16 09:17:17.985 Type: SSH_FXP_WRITE, Size: 16379, Number: 1286 . 2023-05-16 09:17:17.992 14 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets. > 2023-05-16 09:17:17.992 Type: SSH_FXP_CLOSE, Size: 47, Number: 5124 < 2023-05-16 09:17:18.027 Type: SSH_FXP_STATUS, Size: 22, Number: 1286 < 2023-05-16 09:17:18.027 Status code: 0 < 2023-05-16 09:17:18.039 Type: SSH_FXP_STATUS, Size: 22, Number: 1542 < 2023-05-16 09:17:18.039 Status code: 0 < 2023-05-16 09:17:18.044 Type: SSH_FXP_STATUS, Size: 22, Number: 1798 < 2023-05-16 09:17:18.044 Status code: 0 < 2023-05-16 09:17:18.044 Type: SSH_FXP_STATUS, Size: 22, Number: 2054 < 2023-05-16 09:17:18.044 Status code: 0 < 2023-05-16 09:17:18.055 Type: SSH_FXP_STATUS, Size: 22, Number: 2310 < 2023-05-16 09:17:18.055 Status code: 0 < 2023-05-16 09:17:18.055 Type: SSH_FXP_STATUS, Size: 22, Number: 2566 < 2023-05-16 09:17:18.055 Status code: 0 < 2023-05-16 09:17:18.060 Type: SSH_FXP_STATUS, Size: 22, Number: 2822 < 2023-05-16 09:17:18.060 Status code: 0 < 2023-05-16 09:17:18.060 Type: SSH_FXP_STATUS, Size: 22, Number: 3078 < 2023-05-16 09:17:18.060 Status code: 0 < 2023-05-16 09:17:18.060 Type: SSH_FXP_STATUS, Size: 22, Number: 3334 < 2023-05-16 09:17:18.060 Status code: 0 < 2023-05-16 09:17:18.071 Type: SSH_FXP_STATUS, Size: 22, Number: 3590 < 2023-05-16 09:17:18.072 Status code: 0 < 2023-05-16 09:17:18.072 Type: SSH_FXP_STATUS, Size: 22, Number: 3846 < 2023-05-16 09:17:18.072 Status code: 0 < 2023-05-16 09:17:18.072 Type: SSH_FXP_STATUS, Size: 22, Number: 4102 < 2023-05-16 09:17:18.072 Status code: 0 < 2023-05-16 09:17:18.076 Type: SSH_FXP_STATUS, Size: 22, Number: 4358 < 2023-05-16 09:17:18.076 Status code: 0 < 2023-05-16 09:17:18.076 Type: SSH_FXP_STATUS, Size: 22, Number: 4614 < 2023-05-16 09:17:18.076 Status code: 0 < 2023-05-16 09:17:18.076 Type: SSH_FXP_STATUS, Size: 22, Number: 4870 < 2023-05-16 09:17:18.076 Status code: 0 < 2023-05-16 09:17:18.088 Type: SSH_FXP_STATUS, Size: 22, Number: 5124 < 2023-05-16 09:17:18.088 Status code: 0 > 2023-05-16 09:17:18.088 Type: SSH_FXP_REMOVE, Size: 29, Number: 5389 < 2023-05-16 09:17:18.108 Type: SSH_FXP_STATUS, Size: 22, Number: 5389 < 2023-05-16 09:17:18.108 Status code: 0 > 2023-05-16 09:17:18.108 Type: SSH_FXP_RENAME, Size: 66, Number: 5650 < 2023-05-16 09:17:18.198 Type: SSH_FXP_STATUS, Size: 47, Number: 5650 < 2023-05-16 09:17:18.198 Status code: 0 . 2023-05-16 09:17:18.198 Preserving timestamp [2023-05-16T07:25:40.000Z] > 2023-05-16 09:17:18.198 Type: SSH_FXP_SETSTAT, Size: 46, Number: 1033 < 2023-05-16 09:17:18.254 Type: SSH_FXP_STATUS, Size: 22, Number: 1033 < 2023-05-16 09:17:18.254 Status code: 0 . 2023-05-16 09:17:18.254 Transfer done: '\\fcmcftp\FTP\Usr\Portia\ProxyHoldings\FRO098-20230515.csv' => '/FRO098-20230515.csv' [238997] . 2023-05-16 09:17:18.255 Copying finished: Transferred: 238,997, Elapsed: 0:00:00, CPS: 722,045/s > 2023-05-16 09:17:18.255 Script: close . 2023-05-16 09:17:18.255 Closing connection. . 2023-05-16 09:17:18.255 Sending special code: 1 . 2023-05-16 09:17:18.289 Main session channel closed . 2023-05-16 09:17:18.290 All channels closed
winscp.exe /hostkey=ssh-rsa 2048 17LgdjI/nxBPU6ZeYVWnbVWkKPOn11VqmGtNNRmAfzM /log=C:\Automate\Logs\D022_FTP_To_GlassLewis_%date:~-4,4%_%date:~-10,2%_%date:~7,2%.log /loglevel=0 /command "option batch abort" "option confirm off" "open sftp://<ID>:<xyz>@ftp.glasslewis.com" "put \\fcmcftp\FTP\Usr\Portia\ProxyHoldings\FRO098*.csv" close "exit" if %ERRORLEVEL% equ 0 ( echo SUCCESS exit /b 0 ) else ( echo ERROR FTP Problem exit /b 1 ) close "exit"
Any help is appreciated.