Replication via ftp fails with 500 Invalid PORT Command

  • Someone please help me before I either run out of hair to pull out or I have to build a new wall to hit my head against!

    I have a publication created on a server in a non-trusted domain (distribution is run on this server). I have configured ftp on this server and the publication is delivered to the ftp share. No probs here.

    I then have my subscription server, where I am trying to create a pull subscription.

    Now because of our security protocols here I need to be fairly restrictive in terms of what holes I can poke in our firewall. Therefore I have set up TCP/IP communications on ports 1433 (for SQL Server), and 20 and 21 (for FTP). In addition I have also specified a narrow range of ports (above 5000) to be opened for TCP/IP traffic for the ftp data transfer. I have configured the PassivePortRange on both ftp instances to this effect.

    Now if I use an FTP client I can transfer files between the two machines without a hitch (as long as I'm using passive mode - active mode fails with a 500 Invalid PORT Command).

    So when I create my subscription I can connect to the Publisher, see the publication and create the subscription. However the transfer fails with the following message:

    -pollinginterval 5000

    -querytimeout 1800

    -skiperrors

    -transactionsperhistory 100

    2010-07-06 13:58:15.951 Initializing

    2010-07-06 13:58:16.013 Snapshot files will be downloaded via ftp

    2010-07-06 13:58:16.013 Connecting to ftp site '######MAN01'

    2010-07-06 13:58:16.044 Agent message code 20033. The process could not retrieve file '######MAN01_CUSTOMER SURVEY_TEST PUBLICATION/20100706144313/England_2.pre' from the FTP site '######MAN01'.

    2010-07-06 13:58:16.060 Category:OS

    Source:

    Number: 12003

    Message: 200 Type set to I.

    500 Invalid PORT Command.

    500 'LPRT 6,16,0,0,0,0,0,0,0,0,0,128,0,0,0,0,0,0,2,10,110': command not understood

    2010-07-06 13:58:16.060 Category:COMMAND

    Source: Failed Command

    Number:

    Message: if @@trancount > 0 rollback tran

    2010-07-06 13:58:16.060 Category:AGENT

    Source: AGENT

    Number:

    Message: The process could not retrieve file '######MAN01_CUSTOMER SURVEY_TEST PUBLICATION/20100706144313/England_2.pre' from the FTP site '######MAN01'.

    Can anybody please shed some light on this. I feel I am tantalisingly close to solving this and just need a bit more help to get over this final hurdle.

    Many thanks,

    Phil

  • Well I couldn't get the FTP side of things to work so I had to go for an alternative. If anyone's interested (or is suffering with similar problems) I decided to use WebDav instead of FTP to transfer the snapshot (as we already had port 80 open between the servers).

    From that point it was relatively simple to generate the snapshot on the publication database, map to the remote snapshot directory on the distribution server from the subscription database server once webdav had been enabled, write an xcopy or robocopy script to transfer the snapshot to the subscription database server, initialise the snapshot and there we have it.

    Thanks to everyone who took the time to look at this post. If anyone is genuinely interested in how I've managed to do this I could always put together an article because this one has taken me ages to figure out and many, many google searches. There's nothing straightforward about this so I'm happy to take the time to try and put down what I've learned from this in the hope that it might save some of you out there the headaches I've had.

  • thanks phil finally i have succeed it but there is some security issues there, will it be controllable

    Every rule in a world of bits and bytes, can be bend or eventually be broken
    MyBlog About Common dialog control
    A Visualizer for viewing SqlCommand object script [/url]

  • The security issues are that you have to poke a hole in your firewall for ports 1433 (default for SQL Server) and port 80 (default for HTTP). Both of these are obvious ports for these services, but both of these are also configurable. You can make SQL Server listen on another port other than 1433 and you can set up your website in IIS to listen on a port other than 80 to disguise things if you wish.

  • Hello,

    I have very similar set up like you and have a similar problem.

    I can setup a pull subscription to the remote server through vpn, the ports 21 and 1433 are open. The ftp client works to download files. Snapshots created at the publisher, but a subscription agent cannot retrieve a file.

    Do you have a new solution for this, or have you created an article about the solution you had a couple years ago?

    Any help would be much appreciated.

    Best regards,

    Fritz

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply