Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP doesn't PUT the file

Stephen Daddona
Frequent Advisor

SFTP doesn't PUT the file

I'm trying to test "batch" mode SFTP between twp VMS systems. (I'll eventually want to PUT a file to a Linux system, but that's another episode.) I've referenced a couple of threads already that enabled me to get past a couple of problems, but I'm now having a problem where the file doesn't get "PUT". (The file doesn't get sent.) Here's the batch file contents:

setext txt
put sys$login:test.txt

I've tried the following in the PUT command:

put test.txt
put /sys$login/test.txt

TEST.TXT is a one-line file:
this is a test

The SFTP command looks thusly:
sftp -v "-B" test.cmd "csmalley@sysdev"

I've changed the batch file to Stream-LF format with the 'set file/attr=(rfm:stmlf)' command. I've set up host-based authentication. And, lastly, here's the last few lines from the SFTP -v output:

Sftp2/SFTP2.C:3206: buffer: 'AUTHENTICATED YES
'

debug: ssh_sigchld_real_callback
SshFileXferClient/SSHFILEXFERC.C:1368: ssh_file_client_receive_proc: coming in with extension data, OpenVMS host
SshFileCopy/SSHFILECOPY.C:939: Connection to remote host 'csmalley@sysdev', ready to serve requests.
sftp> setext txt
Ascii extensions are : txt
sftp> put sys$login:test.txt
SshFCRecurse/SSHFC_RECURSE.C:280: File is "raw", and it needs to be parsed.
SshFCTransfer/SSHFC_TRANSFER.C:2051: File list has 2 files.
SshFCTransfer/SSHFC_TRANSFER.C:462: Next source file is /sys$login:test.txt .
SshFCTransfer/SSHFC_TRANSFER.C:145: Received error `syserr: I/O stream empty, file: ./sys$login:test.txt' (4).
open: ./sys$login:test.txt (dst): unspecified failure (server msg: 'syserr: I/O stream empty, file: ./sys$login:test.txt')
ssh_pipe_stream_destroy
SshReadLine/SSHREADLINE.C:3717: Uninitializing ReadLine...

Any suggestions are welcome! Thanks in advance!
8 REPLIES
Steven Schweda
Honored Contributor

Re: SFTP doesn't PUT the file

alp $ dire sftp.test
%DIRECT-W-NOFILES, no files found

alp $ dire [.sftp]

Directory ALP$DKA0:[SMS.SFTP]

SFTP.TEST;2

Total of 1 file.

alp $ type sftp.bat
put sftp/sftp.test

alp $ sftp "-B" sftp.bat sms@alp
sftp> put sftp/sftp.test
sftp.test | 38B | 0.0 kB/s | TOC: 00:00:01 | 100%

alp $ dire sftp.test

Directory ALP$DKA0:[SMS]

SFTP.TEST;1

Total of 1 file.

alp $ diff sftp.test [.sftp]
Number of difference sections found: 0
Number of difference records found: 0

DIFFERENCES /IGNORE=()/MERGED=1-
ALP$DKA0:[SMS]SFTP.TEST;1-
ALP$DKA0:[SMS.SFTP]SFTP.TEST;2
alp $

What could go wrong?

alp $ tcpip show version

HP TCP/IP Services for OpenVMS Alpha Version V5.4 - ECO 6
on a COMPAQ Professional Workstation XP1000 running OpenVMS V7.3-2

alp $ sftp "-V"
alp$dka0:[sys0.syscommon.][sysexe]tcpip$ssh_sftp2.exe: SSH Secure Shell OpenVMS
(V5.5) 3.2.0 on COMPAQ Professional Workstation - VMS V7.3-2


Of course, "/sys$login:test.txt" does not
look like any of what you said was in your
batch file.
Stephen Daddona
Frequent Advisor

Re: SFTP doesn't PUT the file

Just for fun (!), I tried "/sys$login:test.txt" with the same results.

Dumb question: I'm entering the SFTP command (sftp -v "-B" test.cmd "csmalley@sysdev") at the system prompt. I don't need to have in a VMS batch job, do I?
Steven Schweda
Honored Contributor

Re: SFTP doesn't PUT the file

> I don't need to have in a VMS batch job,
> do I?

I didn't, did I? (I thought that a big advantage of providing a transcript was
obviating questions like that.)

Around here, with "-v":

[...]
SshFileXferClient/SSHFILEXFERC.C:1441: ssh_file_client_receive_proc: coming in w
ith extension data, OpenVMS host
SshFileXferClient/SSHFILEXFERC.C:1487: vms_plus_sftp_version = 2
SshFileCopy/SSHFILECOPY.C:1019: Connection to remote host 'sms@alp', ready to se
rve requests.
sftp> put sftp/sftp.test
SshFCRecurse/SSHFC_RECURSE.C:368: File is "raw", and it needs to be parsed.
Ssh2SftpServer/SSHFILEXFERS.C:2780: Received SSH_FXP_STAT
Ssh2SftpServer/SSHFILEXFERS.C:2804: Statting file `sftp/sftp.test'
SshFCTransfer/SSHFC_TRANSFER.C:2321: File list has 2 files.
SshFCTransfer/SSHFC_TRANSFER.C:575: Next source file is sftp/sftp.test .
SshFCTransfer/SSHFC_TRANSFER.C:206: Received error `syserr: no such file or dire
ctory, file: ./sftp.test' (2).
Ssh2SftpServer/SSHFILEXFERS.C:1907: Received SSH_FXP_OPEN
Ssh2SftpServer/SSHFILEXFERS.C:2001: Downloading `sftp/sftp.test'
[...]

Note that _my_ "Next source file" name agrees
with what's in _my_ batch file.

> Just for fun (!), I tried
> "/sys$login:test.txt" with the same
> results.

So far as I can tell, you're _always_ using
that colon. Are you sure that you know which batch file you're using?

For the record, adding "setext txt" to my
batch file had no significant effect.
Stephen Daddona
Frequent Advisor

Re: SFTP doesn't PUT the file

I tried /sys$login/test.txt (see my original submission)

I also put it (and the others in double-quotes - no difference.

I'll keep trying!
Steven Schweda
Honored Contributor

Re: SFTP doesn't PUT the file

> I tried /sys$login/test.txt (see my
> original submission)

You mean the original submission where it
says this?:

SshFCTransfer/SSHFC_TRANSFER.C:462: Next source file is /sys$login:test.txt .

I see a colon there. I don't see one in my
transcript.

Of course, I also don't know any of your
software versions. (I showed you mine, ...)
Thomas Ritter
Respected Contributor

Re: SFTP doesn't PUT the file

Graig, try the process interactively and report the complete results. Verbose will give us the software version of client and server.

$ sftp -v "csmalley@sysdev"
>ls *.* !test to see if dir lookups work.
>put test.txt

Changing to stream_lf is best performed with FDL.

$ convert/fdl=sys$input input output
record; format stream_lf


Ian Miller.
Honored Contributor

Re: SFTP doesn't PUT the file

If you are using HP TCPIP for VMS then you have to be up to date to have any chance of this working.
____________________
Purely Personal Opinion
Thomas Ritter
Respected Contributor

Re: SFTP doesn't PUT the file

Craig, has the problem been solved ?