views:

511

answers:

3

I'm trying to setup replication between two SQL Servers and I'm almost there but stuck on a permission error (it appears). The servers are connected via VPN.

Publisher/Distributer = W2003 + SQL2005 (Domain Controller)

Subscriber = W2008 + SQL2008 (Stand Along Server not on a domain)

I have set it up to Pull rather than push only because that's the way I got past the logins issue.

Current status is that both agents are running and the snapshot has completed but it doesn't start replicating. There error is below which seems to indicate that the Subscriber does not have permissions to the Snapshot folder but I have set Everyone (Full control) just to try and get it working.

I'm thinking is there some issue with trust or something. I can bring up the snapshot share on the Publisher from Subscriber and access files without any permission issues. But SQL seems to be having some kind of issue.

Any thoughts on the next steps here to trouble shoot? Thanks.

This is the end of the log:

2009-07-22 23:34:47.838 Initializing

2009-07-22 23:34:49.263 Snapshot will be applied from the alternate folder '\[MachineName][share]\unc\SYDNEY_MIRRORMIRROR_MIRRORMIRRORPRODUCT\20090722085146\' 2009-07-22 23:34:50.809 Agent message code 20143. The process could not read file '\[MachineName][share]\unc\SYDNEY_MIRRORMIRROR_MIRRORMIRRORPRODUCT\20090722085146\TRProductImages_8.pre' due to OS error 5. 2009-07-22 23:34:51.524 Category:OS Source:
Number: 5 Message: Access is denied.

A: 

Yeah, getting permissions issues worked out when setting up SQL Server replication can be a chore. Accessing a share on the domain controller from a machine outside the domain... hmm. Have you tried setting up the share on the subscriber machine? Not optimal as it puts the publisher at the mercy of network i/o when creating the snapshot... but...

You mention having set up the replication as a pull rather than push because it got you past login issues. Are/have you tried using SQL Server permissions rather than windows?

I guess I should also mention that if it weren't for the domain controller/non-domain machine combination in this situation I would have started by asking/confirming that the logins under which the SQL Server services were running on both machines were the same... as it is I'm not sure it would matter.

codemonkey
+1  A: 

What are your setting's on the Subscriber Subscription Properties for Security --> Distributer and Publisher Connection?

Also, under the Publication Properties --> Publication Access List; Have you double checked that your Subscriber is in there?

Refracted Paladin
On SQL2008 Distributor Connection = DB Authentication. The account is an account on the SQL2005 Publisher.That account is on the Publication Access List on the publisher.Thanks for the tip though I understand the authentication process a little better now.
Ben Jackson
A: 

Ok well as it turns out the Error Message was correct. But not in the way i thought.

I'm setting up replication over a VPN. The basic starting point of most firewalls I suspect is you can send out on most ports but not receive in.

I was able to get pull replication started but not push and the error occurred trying to read the snapshot. The thing that was confusing was that I could open the share from the subscriber machine so why couldn't SQL Server pull the snapshot?

In the end what was happening was that the ports for UNC/File Sharing 137,138,139 and 445 were not open 'into' the subscriber.

I was thinking the Subscriber would pull the snapshot off the distributor but I think it must request them but the Distributor was still pushing them to the subscriber and being blocked on the way in.

I confirmed my suspicions because I could open a share from Subscriber to Distributor but not from distributor to subscriber. Nor could I connect to the Subscriber server using SQLMgmtSutdio from the Distributor machine, all proof the firewall was stopping it in just that one direction.

So somehow even though the ports were blocked SQL was still able to set up the publisher, subscriber and distributor but not start the process until I got them opened.

Its running now.

Hope that long explanation helps someone else struggling with getting this going.

Ben Jackson