• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1542
  • Last Modified:

Error getting ftp file from pc into AS400

I am running a procedure on the AS400 to FTP a file from the pc into the 400.  All of a sudden the command to change the directory is not working.  
The error we get is 550 C:/path: the filename, directory name, or volume syntax is incorrect.  I am able to access the path via cmd on the pc but just cant access on the AS400.

ANY HELPERS???
THANKS!!

0
ststst
Asked:
ststst
  • 11
  • 6
  • 6
  • +1
1 Solution
 
nettek0300Commented:
Are you getting the error when you are browsing for the source file on the PC or when you are trying to browse the destination path on the AS400?  The directory that you are uploading to on the AS400 needs to be created before you can upload the file and proper permissions to the directory need to be set.  If it is on the PC it could also be a permissions issue on the file diirectory.
0
 
stststAuthor Commented:
Hi Nett.
We've been running this procedure for many years... just all of a sudden, i cannot transfer the file.  

There's a member file that shows the log of the procedure.  Here's what it says.
 
              *************** Beginning of data **********************
0001.00       Output redirected to a file.                            
0002.00       Input read from specified override file.                
0003.00       Connecting to remote host XXX.XXX.XXX.XXX using port 21.
0004.00       220 Microsoft FTP Service                              
0005.00       Enter login ID (ssrecap):                              
0006.00       331 Password required for open.                        
0007.00       530 User open cannot log in.                            
0008.00       Enter an FTP subcommand.                                
0009.00       > user USER ****                                        
0010.00       331 Password required for USER.                        
0011.00       230-Connected to REMOTE PC
0012.00       230 User USER logged in.                                
0013.00       Windows_NT                                              
0014.00       Enter an FTP subcommand.                                
0015.00       > ascii                                                
0016.00       200 Type set to A.
0017.00       Enter an FTP subcommand.                                                
0018.00       > cd C:/path/of/remote/pc/directory
0019.00       550 C:/path/of/remote/pc/diredtory: The filename, directory name, or volu
0020.00        syntax is incorrect.                                                  
0021.00       Enter an FTP subcommand.                                                
0022.00       > lcd AS400LIBRARY
0023.00       Local working directory is AS400LIBRARY
0024.00       Enter an FTP subcommand.                                                
0025.00       > get PCFILE (replace                                                  
0026.00       227 Entering Passive Mode (XXX,XXX,XXX,XXX 5,65).                        
0027.00       550 AS400FILE: The system cannot find the file specified.                  
0028.00       Enter an FTP subcommand.                                                
0029.00       > quit                                                                  
0030.00       221                                                                    
              ****************** End of data ****************************************    

   
THANKS!
ST
                           
0
 
nettek0300Commented:
Have there been any changes to the PC recently?  It does seem as though it is not finding the path on the PC (host).  Did you verify that none of the directories were acceidently renamed?  Once connected to the ftp server try typing the following:

send
local file> c:\path\of\source\file
remote file> name of file to appear on AS400

Please note that "local file" and "remote file" will be prompts that you receive from the ftp server.  One other thing I noticed is that you are using the forward slash (/) instead of the back slash (\).  I am not sure what is required from the ftp server, but it would be worth a shot to try the back slash (\).  At most, you will receive an error if it doesn't work.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
stststAuthor Commented:
I do not know of any changes but others do maintain the pc.  i've verified the path - no changes.

when i type send local file> c:\path\of\source\file it says Not enough characters specified.  subcommand not recognized.  a list of possible subcommands folllows.  Recognized synonnyms are deonted by '=>'.  SENDAsv SENDPOrt SENDSite.

BTW... when i try to type LS i should get a list of files but this is what i get:
227 Entering Passive Mode (XXX.XXX.XXX.XXX,8,23).      
125 Data connection already open; Transfer starting.  
226 Transfer complete.                              

Think somethings funny w/the FTP?
 
0
 
nettek0300Commented:
Did you put the extension on the filename (.txt)?  Are you trying to ftp from a command line or are you using an ftp client software?
0
 
nettek0300Commented:
Are you able to copy the file to a different computer and then ftp to the AS400?
0
 
stststAuthor Commented:
yes... that is whats wierd.. i am able to access the same directory\file layout from 2 other servers.  just this one unit.  I just tested ftp'ing from the pc to the AS400 and it worked!!!  cant understand why the 400 cant get the file.  i've even copied the file in the c root directory.

0
 
nettek0300Commented:
It sounds like something on that machine is blocking access to the file.  Is it possible that this machine has a virus or spyware?  At this point I'm at a loss.  Sorry.
0
 
stststAuthor Commented:
Thands nett..   it ran thru the virus scan earlier this morning.  
since i can do the ftp up to the AS400 i'm tryng to wriite a .bat file to ftp but cant get it to go.  got suggesttion on this procedure?
0
 
nettek0300Commented:
You should be able to type out the exact commands you would use from a command line to do the ftp in notepad and then just save it as a bat file.
0
 
lesouefCommented:
I guess the PC acting as FTP server is using the ftp package of IIS, so you should check the rights of the ftp client user on this PC (do you use the same user/passwd from other clients?). Also to be checked are the IP restrictions you may have, but I think it is a simpler reason:
when trying to CD to c:\... etc it assumes the root folder for that user is c:\ which norbody does normally. And even if you do it, you should write the remote path as a unix path starting from the user root folder.
So for instance if the root folder is C:/path/of/remote/, you should use:
cd /pc/directory
so first check you root folder by using:
pwd
should prompt / unless your ftp client issues a CD command in its login sequence (some ftp clients do, but I don't know the as400 one). then issue:
ls
to see the remote files and try to understand where you are, because I think it is simply your root folder which is not the one you think.
and ls should always be accepted, whatever is your root folder. if not, the problem is on server side for sure
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
On the 400, start an interactive FTP session to the Windows FTP server, and log in with the same credentials used in the script.

Turn on debugging in the AS/400 FTP client so that you can view the actual commands being sent:

DEBUG

PWD - What does it say?
CD c:\ - what happens?
CD level1subdir - what happens?
CD level2subdir - what happens?
CD level3subdir - what happens?
etc until you reach the level of the file you wish

Also try skipping the CD step and specify the full pathname in the GET;

GET c:\...\PCFILE (replace

Modify your script to toggle DEBUG on, then run the script and post the results.  I'd really like to see the real pathname.  Is it possible that there is a problem character in the pathname, or a space that requires the path string be quoted?  Remember that the AS/400 FTP client is translating filenames and pathnames from EBCDIC to ASCII.

On your Windows FTP server, verify that logging is enabled:

Control Panel -> Administrative Tools -> Internet Information Services
Navigate to the Properties page of your FTP site, and verify that "Enable Logging is checked", and note (or set) the location of the log files (usually c:\windows\system32\LogFIles\msftpsvc1\)

Open the log file and veview the commands received from the AS.400 FTP client.

I suggest that you post the DEBUG session from the AS/400 FTP client and the relevant portion of the Windows FTP Service log file.

- Gary Patterson
0
 
stststAuthor Commented:
lesouef
the same procdeure is setup to 2 other pc servers w/ no problem.
the same profile has access to all servers.
as mentioned this is what comes up when i type ls or dir.
  227 Entering Passive Mode (XXX.XXX.XXX.XXX,8,23).      
  125 Data connection already open; Transfer starting.  
  226 Transfer complete.      

i get the full directory list when i type it on the other servers
0
 
stststAuthor Commented:
Gary
Step 1 debug:
> user temp                  
  331 Password required for temp.      
  230-Connected to Remote Server
  230 User temp logged in.              
  Windows_NT                            
> debug                                
  DEBUG is on. DEBUG value is 1.        
> ascii                                
  >>> TYPE A                            
  200 Type set to A.                    
> cd c:/usr/acct/rbx/host/gencomm      
  >>> CWD c:/usr/acct/rbx/host/gencomm  
  550 c:/usr/acct/rbx/host/gencomm: The filename, directory name, or volume label syntax is incorrect.          
> cd c:\                                                                                                        
  >>> CWD c:\                                                                                                    
  550 c:\: The filename, directory name, or volume label syntax is incorrect.                                    
> get c:\usr\acct\rbx\host\gencomm\hx99ss retail/hx99ss (replace                                                
  >>> PASV                                                                                                      
  227 Entering Passive Mode (xxx,xx,xxx,xxx,xx,79).                                                              
  >>> RETR c:\usr\acct\rbx\host\gencomm\hx99ss                                                                  
  550 c:\usr\acct\rbx\host\gencomm\hx99ss: The filename, directory name, or volume label syntax is incorrect.    

i'm unsure where to look for the logging option on the IIS.  WHere is that?

Thanks.
0
 
lesouefCommented:
could you juste type pwd, to see where you are, and then ls, with no argument?
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
Enabling logging in IIS 6:  http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/45ff5705-308d-4866-a611-b92bf448e1ae.mspx?mfr=true

Several suggestions:

1) Please run the exact steps that I listed above and post results.  What does PWD show?  What happens when you CD to c:\?
2) Go to the Properties for your FTP site and pritscreenand post each page so we can see your current FTP server config.
3) What IIS / FTP Server version are you running?
4) Repeat the download attempt from a Windows workstation using the Microsoft FTP client.  Make sure and use the same FTP credentials as the ones you use in your AS/400 script.

- Gary Patterson

0
 
lesouefCommented:
I just tested on my old IIS v5, and cd c:\ is not accepted... the path should be unix like, that is /folder/....
unless the as400 ftp client translates the path, removes the logical drive, converts \ to / ??
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
AS/400 client may flip the slashes, but I am pretty sure it doesn't remove drive letters.
0
 
stststAuthor Commented:
SORRY GANG!  my coworker is trying to figure things out too.

this is what shows on the AS400
> pwd                                                                          
  >>> PWD                                                                      
  257 "/temp" is current directory.                                            
> cd c:\                                                                        
  >>> CWD c:\                                                                  
  550 c:\: The filename, directory name, or volume label syntax is incorrect.  
> cd c:\usr
 550 c:\usr: The filename, directory name, or volume label syntax is incorrect.
> dir                                                                            
  >>> PASV                                                                      
  227 Entering Passive Mode (xxx,xxx,xxx,xxx,xxx,67).                              
>>> LIST                                            
125 Data connection already open; Transfer starting.
226 Transfer complete.                                                                                  

I get pretty much the same on a MS FTP
ftp> pwd
257 "/temp" is current directory
ftp> ls
200 Port command successful
150 Opening ASCII mode data connection for file list
226 Transfer complete
ftp>


We are running IIS 6.0 - here is the IIS log
11:31:16 164.xxx.xxx.xxx[54]USER open 331 0
11:31:16 164.xxx.xxx.xxx[54]PASS - 530 1326
11:31:16 164.xxx.xxx.xxx[54]USER TEMP 331 0
11:31:16 164.xxx.xxx.xxx [54]PASS - 230 0
11:31:16 164.xxx.xxx.xxx [54]CWD C:/usr/acct/rbx/host/gencomm 550 123
11:31:16 164.xxx.xxx.xxx [54]sent /temp/HX99SS 550 2
11:31:16 164.xxx.xxx.xxx [54]QUIT - 550 0            


SO looks like it defaults to the temp folder and unable to change out of there.
0
 
stststAuthor Commented:
ok guys.
Definately something quirky w/this server.
We were able to access the dirctory by typing CD .. THEN we were able to CD c:\usr\.....

trying to figure out why we must do this on this server vs the others.

GARY... i edited the procedure in  PDM / QCLSRC but when i try to compile, it says "The Compile option is not allowed with member type ."
According to the member type there is no CLP like other procedures.
0
 
Gary PattersonVP Technology / Senior Consultant Commented:
OK, now what happens when you CD / and then LS?  How about CD /usr/acct/rbx/host/gencomm and then LS?

Now post those screen snaps from your FTP configuration in IIS.

- Gary Patterson

0
 
Gary PattersonVP Technology / Senior Consultant Commented:
This is an FTP script - it is just a text member and is not compiled.  Some program in your system does an OVRDBF from the file INPUT to this file/member before running the FTP command.  This causes the program to get the input from your script file instead of the standard INPUT file (which is a console session screen).

Basically, this means you just edit the source member, like you already did, and the next time the program runs it should pick up the new script.

- Gary Patterson
0
 
stststAuthor Commented:
HEY!!! that worked!  i was able to list!!  i cant get a pic yet cause my coworker is trying to see what's the problem too... someohow cant get it to go to the c:\ default...
i'll try to get some when he has a break.
ST
0
 
lesouefCommented:
weird thing... you have to go back to / to be able to access the target folder?
anyway, your login folder is /temp and is empty obviously.
what is returned in debug mode is the real PC path, not the virtual one to be used by the ftp client.
and I insist on not using drive letter in ftp commands.
if /temp is empty, go to the parent folder cd .. then ls again: is the file there?
0
 
stststAuthor Commented:
Apparently someone had created a folder on the D drive that is the same as the logon profile used to FTP.  That was why the default went to the /temp folder!!!! Once my co-worker deleted it, we are able to cd down to that folder\file.

THANK YOU ALL for trying to diagnose this problem!
ST
0
 
lesouefCommented:
I don't buy that, creating a folder with the same name on D: does not alter the FTP setup as far as I know.
Looks like somebody has changed the setup or deleted the original root folder of the account for me... tssss....
0
 
stststAuthor Commented:
original root folder of what account?
my coworker didnt understand either but as soon as he deleted that folder, we were able to cd and ls right off the bat  after logging in.  He mentioned the transfer worked for any other authorized person but the temp logon.  i did not test w/my own logon so i could not say.
0
 
lesouefCommented:
side effect? maybe there was no access for this account in the temp folder? and when you delete it, the ftp server defaults somewhere else?? anyway, you should clean up this ftp server, as we say here it broke up! but you don't really know why...
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 11
  • 6
  • 6
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now