Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an FTP Script I'm using to automate a file transfer. The transfer works fine on my PC (XP SP2), but when I try and run it on a VM on my PC (XP SP2), the "put" commands gives off:

504 Command not implemented for that parameter.

FTP File:

open [ftp site]
[username]
[password]
cd [directory on FTP server]
binary
hash
put ..\[subfolder1]\[Subfolder2]\[subfolder3]\[filename]
bye

The FTP site/server is around the world, and not under my control.

From what I understand of a 504, that means the command should NEVER work, but since the same script DOES work on my PC (hosting the VM), that eliminates syntax, file naming, etc.

The put command when triggered from the VM, actually creates a 0 length file on the target FTP server, but doesn't populate the file.

share|improve this question
1  
Might want to take this over to serverfault.com. –  squillman Jul 21 '09 at 23:45
    
I'm not well versed in the area of FTP scripting, but could it have anything to do with using backslashes for the path? –  jtbandes Jul 22 '09 at 4:51
    
How is the VM connected to your host network? Is it behind NAT? –  heavyd Aug 5 '09 at 14:10
    
It's not the backslashes, I've moved to the source directory. FTP -v yields: Cannot connect to [ftp server IP address]:52933 - Unknown error: 0. FTP -d yields: ---> PORT [virtual PC IP address separated by commas],19,129 504 Command not implemented for that parameter. ---> STOR [Filename] 550 Cannot connect to [ftp server IP address]:52934 - Unknown error: 0. The VM is using Shared Networking (NAT) which I'm thinking is the problem at the moment... –  BrianH Aug 6 '09 at 17:31
    
yikes... carriage returns are nuked in comments, sorry! –  BrianH Aug 6 '09 at 17:33
add comment

3 Answers

It really looks to me like it's linked to a networking issue.

Shouldn't a firewall on your host PC be opened for traffic from the VM software. Looks to me like all the FTP commands are allowed (port 20) but when you start an actual data transfer, it cannot open the data channel (on port 21).

Do you have the same error with other commands that transfer data? Like "LIST" for instance.

Try passive mode (command "PASV") as it will not open a different channel for data.

share|improve this answer
add comment

The machine hosting the VM is different from the VM itself.
If the command works on the base OS of the machine, that FTP server is allowing it.
When the command does not work on the VM OS, that FTP server (a different one) is not allowing it.

Am I missing something else in this question?
Ok, Are you saying that the FTP server is the same one and
you are not able to FTP-PUT from a VM client where-as it works from your base OS ftp client?

If that is the case, It might be worthwhile to take a packet capture of the two FTP sessions.
If the failing session is operating differently, that part may not be supported by your FTP server.
Check FTP Active/Passive mode differences for example (may not be your problem, but something like this).

You can take captures with Wireshark or tcpdump filtered for the server TCP-port.


Update based on your comment.
i'd still say you should take a capture to see what is failing.
However, there is another thing you can do, ftp -v will give all the control communications as they happen. You could use that to see how the two FTP Clients behave differently to identify the problem. Oops, thats not the right option... there was something that traced the command exchange, can't get it now. Maybe, someone here remembers.

share|improve this answer
    
I just clarified the question, sorry for the confusion. The VM and the host PC are both WinXP SP2, and the target FTP server is the same. –  BrianH Jul 22 '09 at 13:06
add comment

From my research, 504 may have other meanings than Command not implemented for that parameter. It may also be:

504: timed out waiting for gateway
504: unknown security mechanism

I hope that helps. The first one is especially suggestive.

Questions:
What happens when you enter the put by hand?
Have you tried using a protocol sniffer to find the exact difference between communication from the PC and VM?

EDIT

Is it possible that the remote FTP server has some security mechanism that allows your computer but not the VM?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.