Showing posts with label proxy. Show all posts
Showing posts with label proxy. Show all posts

Monday, March 26, 2012

Merge Replication using Web Sync - Proxy Auto config problem

Hi

I am trying to setup merge replication using web sync. I keep on getting the message: The Proxy Auto-configuration URL was not found. Yes I have read all the postings telling me to check my internet explorer settings concerning proxy server and auto-detection - I am not using a proxy - auto detection is unchecked.

Does anyone have another clue?

Thanks

Alex

2006-08-16 15:31:09.375 Connecting to Subscriber 'CRAW'
2006-08-16 15:31:09.437 Connecting to Subscriber 'CRAW'
2006-08-16 15:31:09.453 The upload message to be sent to Publisher 'CRAW' is being generated
2006-08-16 15:31:09.453 The merge process is using Exchange ID '20E2BF4F-8812-431F-8BF8-94A44B80C16E' for this web synchronization session.
2006-08-16 15:31:09.500 The Proxy Auto-configuration URL was not found.

After having no clue where to go on I decided to try it again setting it up using RMO.

Worked without even mentioning the proxy auto config

Imports Microsoft.SqlServer.Replication

Imports Microsoft.SqlServer.Management.Common

Public Class Replication

Private subscriberName As String

Private publisherName As String

Private windowsLogin As String

Private windowsPWD As String

Private publicationName As String

Private publicationDbName As String

Private subscriptionDbName As String

Private Hostname As String

Sub New(ByVal EntityID As Guid, ByVal SubscriberHost As String, ByVal PublisherHost As String, ByVal Login As String, ByVal PWD As String, ByVal Publication As String, ByVal PublicationDB As String, ByVal SubscriptionDB As String)

subscriberName = SubscriberHost

publisherName = PublisherHost

'the guid of the entity is passed as hostname to be used for filtering

Hostname = EntityID.ToString.ToUpper

windowsLogin = Login

windowsPWD = PWD

publicationName = Publication

subscriptionDbName = SubscriptionDB

publicationDbName = PublicationDB

End Sub

Sub SetupWebPull()

Dim webSyncUrl As String = "https://myhost/websync/replisapi.dll"

'Create connections to the Publisher and Subscriber.

Dim subscriberConn As ServerConnection = New ServerConnection(subscriberName)

Dim publisherConn As ServerConnection = New ServerConnection(publisherName)

' Create the objects that we need.

Dim publication As MergePublication

Dim subscription As MergePullSubscription

Try

' Connect to the Subscriber.

subscriberConn.Connect()

' Ensure that the publication exists and that

' it supports pull subscriptions and Web synchronization.

publication = New MergePublication()

publication.Name = publicationName

publication.DatabaseName = publicationDbName

publication.ConnectionContext = publisherConn

If publication.LoadProperties() Then

If (publication.Attributes And PublicationAttributes.AllowPull) = 0 Then

publication.Attributes = publication.Attributes _

Or PublicationAttributes.AllowPull

End If

If (publication.Attributes And PublicationAttributes.AllowWebSynchronization) = 0 Then

publication.Attributes = publication.Attributes _

Or PublicationAttributes.AllowWebSynchronization

End If

' Define the pull subscription.

subscription = New MergePullSubscription()

subscription.ConnectionContext = subscriberConn

subscription.PublisherName = publisherName

subscription.PublicationName = publicationName

subscription.PublicationDBName = publicationDbName

subscription.DatabaseName = subscriptionDbName

subscription.HostName = hostname

subscription.CreateSyncAgentByDefault = True

' Specify the Windows login credentials for the Merge Agent job.

subscription.SynchronizationAgentProcessSecurity.Login = windowsLogin

subscription.SynchronizationAgentProcessSecurity.Password = windowsPWD

' Enable Web synchronization.

subscription.UseWebSynchronization = True

subscription.InternetUrl = webSyncUrl

' Specify the same Windows credentials to use when connecting to the

' Web server using HTTPS Basic Authentication.

subscription.InternetSecurityMode = AuthenticationMethod.BasicAuthentication

subscription.InternetLogin = windowsLogin

subscription.InternetPassword = windowsPWD

' Create the pull subscription at the Subscriber.

subscription.Create()

Dim registered As Boolean = False

' Verify that the subscription is not already registered.

For Each existing As MergeSubscription In publication.EnumSubscriptions()

If existing.SubscriberName = subscriberName Then

registered = True

End If

Next

If Not registered Then

' Register the local subscription with the Publisher.

publication.MakePullSubscriptionWellKnown(subscriberName, subscriptionDbName, SubscriptionSyncType.Automatic, MergeSubscriberType.Local, 0)

End If

Else

' Do something here if the publication does not exist.

Throw New ApplicationException(String.Format("The publication '{0}' does not exist on {1}.", publicationName, publisherName))

End If

Catch ex As Exception

' Implement the appropriate error handling here.

Throw New ApplicationException(String.Format("The subscription to {0} could not be created.", publicationName), ex)

Finally

subscriberConn.Disconnect()

publisherConn.Disconnect()

End Try

End Sub

Sub PullMergeReplication()

' Create a connection to the Subscriber.

Dim conn As ServerConnection = New ServerConnection(subscriberName)

Dim subscription As MergePullSubscription

Try

' Connect to the Subscriber.

conn.Connect()

' Define subscription properties.

subscription = New MergePullSubscription()

subscription.ConnectionContext = conn

subscription.DatabaseName = subscriptionDbName

subscription.PublisherName = publisherName

subscription.PublicationDBName = publicationDbName

subscription.PublicationName = publicationName

' If the pull subscription and the job exists, start the agent job.

If subscription.LoadProperties() And Not subscription.AgentJobId Is Nothing Then

subscription.SynchronizeWithJob()

Else

' Do something here if the subscription does not exist.

Throw New ApplicationException(String.Format("A subscription to '{0}' does not exists on {1}", publicationName, subscriberName))

End If

Catch ex As Exception

' Do appropriate error handling here.

Throw New ApplicationException("The subscription could not be synchronized.", ex)

Finally

conn.Disconnect()

End Try

End Sub

End Class

|||?

I ran into a similar problem. It could be related to certificates. How did you generate your certificate?


--
Hilary Cotter

|||it is a problem with CA certificate;
on subscriber:
1. log on as user from which you try to run sync application
(if it is a windows service log on as service account)
2. install CA certificate ("Automatically select certificate store...")
3. test web page in IE (https://site_location/replisapi.dll)
4. In "Internet Options" -> "Connections" -> "Lan Settings" uncheck "Automatically detect settings"
5. run sync app.
6. enjoysql

Merge Replication using Web Sync - Proxy Auto config problem

Hi

I am trying to setup merge replication using web sync. I keep on getting the message: The Proxy Auto-configuration URL was not found. Yes I have read all the postings telling me to check my internet explorer settings concerning proxy server and auto-detection - I am not using a proxy - auto detection is unchecked.

Does anyone have another clue?

Thanks

Alex

2006-08-16 15:31:09.375 Connecting to Subscriber 'CRAW'
2006-08-16 15:31:09.437 Connecting to Subscriber 'CRAW'
2006-08-16 15:31:09.453 The upload message to be sent to Publisher 'CRAW' is being generated
2006-08-16 15:31:09.453 The merge process is using Exchange ID '20E2BF4F-8812-431F-8BF8-94A44B80C16E' for this web synchronization session.
2006-08-16 15:31:09.500 The Proxy Auto-configuration URL was not found.

After having no clue where to go on I decided to try it again setting it up using RMO.

Worked without even mentioning the proxy auto config

Imports Microsoft.SqlServer.Replication

Imports Microsoft.SqlServer.Management.Common

Public Class Replication

Private subscriberName As String

Private publisherName As String

Private windowsLogin As String

Private windowsPWD As String

Private publicationName As String

Private publicationDbName As String

Private subscriptionDbName As String

Private Hostname As String

Sub New(ByVal EntityID As Guid, ByVal SubscriberHost As String, ByVal PublisherHost As String, ByVal Login As String, ByVal PWD As String, ByVal Publication As String, ByVal PublicationDB As String, ByVal SubscriptionDB As String)

subscriberName = SubscriberHost

publisherName = PublisherHost

'the guid of the entity is passed as hostname to be used for filtering

Hostname = EntityID.ToString.ToUpper

windowsLogin = Login

windowsPWD = PWD

publicationName = Publication

subscriptionDbName = SubscriptionDB

publicationDbName = PublicationDB

End Sub

Sub SetupWebPull()

Dim webSyncUrl As String = "https://myhost/websync/replisapi.dll"

'Create connections to the Publisher and Subscriber.

Dim subscriberConn As ServerConnection = New ServerConnection(subscriberName)

Dim publisherConn As ServerConnection = New ServerConnection(publisherName)

' Create the objects that we need.

Dim publication As MergePublication

Dim subscription As MergePullSubscription

Try

' Connect to the Subscriber.

subscriberConn.Connect()

' Ensure that the publication exists and that

' it supports pull subscriptions and Web synchronization.

publication = New MergePublication()

publication.Name = publicationName

publication.DatabaseName = publicationDbName

publication.ConnectionContext = publisherConn

If publication.LoadProperties() Then

If (publication.Attributes And PublicationAttributes.AllowPull) = 0 Then

publication.Attributes = publication.Attributes _

Or PublicationAttributes.AllowPull

End If

If (publication.Attributes And PublicationAttributes.AllowWebSynchronization) = 0 Then

publication.Attributes = publication.Attributes _

Or PublicationAttributes.AllowWebSynchronization

End If

' Define the pull subscription.

subscription = New MergePullSubscription()

subscription.ConnectionContext = subscriberConn

subscription.PublisherName = publisherName

subscription.PublicationName = publicationName

subscription.PublicationDBName = publicationDbName

subscription.DatabaseName = subscriptionDbName

subscription.HostName = hostname

subscription.CreateSyncAgentByDefault = True

' Specify the Windows login credentials for the Merge Agent job.

subscription.SynchronizationAgentProcessSecurity.Login = windowsLogin

subscription.SynchronizationAgentProcessSecurity.Password = windowsPWD

' Enable Web synchronization.

subscription.UseWebSynchronization = True

subscription.InternetUrl = webSyncUrl

' Specify the same Windows credentials to use when connecting to the

' Web server using HTTPS Basic Authentication.

subscription.InternetSecurityMode = AuthenticationMethod.BasicAuthentication

subscription.InternetLogin = windowsLogin

subscription.InternetPassword = windowsPWD

' Create the pull subscription at the Subscriber.

subscription.Create()

Dim registered As Boolean = False

' Verify that the subscription is not already registered.

For Each existing As MergeSubscription In publication.EnumSubscriptions()

If existing.SubscriberName = subscriberName Then

registered = True

End If

Next

If Not registered Then

' Register the local subscription with the Publisher.

publication.MakePullSubscriptionWellKnown(subscriberName, subscriptionDbName, SubscriptionSyncType.Automatic, MergeSubscriberType.Local, 0)

End If

Else

' Do something here if the publication does not exist.

Throw New ApplicationException(String.Format("The publication '{0}' does not exist on {1}.", publicationName, publisherName))

End If

Catch ex As Exception

' Implement the appropriate error handling here.

Throw New ApplicationException(String.Format("The subscription to {0} could not be created.", publicationName), ex)

Finally

subscriberConn.Disconnect()

publisherConn.Disconnect()

End Try

End Sub

Sub PullMergeReplication()

' Create a connection to the Subscriber.

Dim conn As ServerConnection = New ServerConnection(subscriberName)

Dim subscription As MergePullSubscription

Try

' Connect to the Subscriber.

conn.Connect()

' Define subscription properties.

subscription = New MergePullSubscription()

subscription.ConnectionContext = conn

subscription.DatabaseName = subscriptionDbName

subscription.PublisherName = publisherName

subscription.PublicationDBName = publicationDbName

subscription.PublicationName = publicationName

' If the pull subscription and the job exists, start the agent job.

If subscription.LoadProperties() And Not subscription.AgentJobId Is Nothing Then

subscription.SynchronizeWithJob()

Else

' Do something here if the subscription does not exist.

Throw New ApplicationException(String.Format("A subscription to '{0}' does not exists on {1}", publicationName, subscriberName))

End If

Catch ex As Exception

' Do appropriate error handling here.

Throw New ApplicationException("The subscription could not be synchronized.", ex)

Finally

conn.Disconnect()

End Try

End Sub

End Class

|||?

I ran into a similar problem. It could be related to certificates. How did you generate your certificate?


--
Hilary Cotter

|||it is a problem with CA certificate;
on subscriber:
1. log on as user from which you try to run sync application
(if it is a windows service log on as service account)
2. install CA certificate ("Automatically select certificate store...")
3. test web page in IE (https://site_location/replisapi.dll)
4. In "Internet Options" -> "Connections" -> "Lan Settings" uncheck "Automatically detect settings"
5. run sync app.
6. enjoy

Friday, March 23, 2012

Merge replication subscription error with proxy

Ok, perhaps I'm a moron.. believe me, I'd be glad to admit it if I
could just get this fixed.
We're trying to merge replicate data via https, we have installed the
CA certificate and can connect to the replisapi.dll through IE. I used
the following script to generate the subscription:
DECLARE @.publication AS sysname;
DECLARE @.publisher AS sysname;
DECLARE @.publicationDB AS sysname;
DECLARE @.websyncurl AS sysname;
DECLARE @.login AS sysname;
DECLARE @.password AS nvarchar(512);
SET @.publication = N'tables';
SET @.publisher = N'server';
SET @.publicationDB = N'database';
SET @.websyncurl = 'https://webserver/WebSync';
SET @.login = N'websql\user';
Set @.password = N'pass';
USE [LocalDB]
EXEC sp_addmergepullsubscription
@.publisher = @.publisher,
@.publication = @.publication,
@.publisher_db = @.publicationDB,
@.subscriber_type = N'anonymous';
EXEC sp_addmergepullsubscription_agent
@.publisher = @.publisher,
@.publisher_db = @.publicationDB,
@.publication = @.publication,
@.distributor = @.publisher,
@.job_login = @.login,
@.job_password = @.password,
@.use_web_sync = 1,
@.internet_url = @.websyncurl,
@.internet_login = @.login,
@.internet_password = @.password,
@.enabled_for_syncmgr = 'true';
GO
This creates the subscription locally but gives me the error
"websql\user not a valid Windows account". I tried changing the
job_login & job_password to a local account and the subscription was
added without errors. When I go to start the syncronization I get the
error: "The system cannot find the file specified." The underlying
error here is with the proxy. For some reason when it tries to connect
it isn't passing the proper credentials or something.
Anyway, any I'd appreciate any help or direction. If I find out what's
wrong I'll go ahead and post it.
JC
That's because it is creating the agent at the subscriber and when doing so,
you are specifying an account of websql\user which does not exist on the
subscriber. If you change this to a local account and then try to
synchronize, you will get security errors, because the SID of the local
account you set it to does not have a valid scope outside of the local
machine. The job login and password can be a local account and it dosn't
affect anything. However, take a look at the other credential. You are
setting the synchronization context to websql\user and that account, since
it doesn't exist on the local machine can't generate the file which is used
to synch via https. (The more accurate error message would be user doesn't
exist or access denied.)
I don't have a system setup to be able to configure https synchronization
right now. I've done this before and your issue is with the security
context. I just can't remember what I did before to fix this particular
error.
Mike
http://www.solidqualitylearning.com
Disclaimer: This communication is an original work and represents my sole
views on the subject. It does not represent the views of any other person
or entity either by inference or direct reference.
<jbzcooper@.gmail.com> wrote in message
news:1138315588.689076.326990@.g14g2000cwa.googlegr oups.com...
> Ok, perhaps I'm a moron.. believe me, I'd be glad to admit it if I
> could just get this fixed.
> We're trying to merge replicate data via https, we have installed the
> CA certificate and can connect to the replisapi.dll through IE. I used
> the following script to generate the subscription:
> DECLARE @.publication AS sysname;
> DECLARE @.publisher AS sysname;
> DECLARE @.publicationDB AS sysname;
> DECLARE @.websyncurl AS sysname;
> DECLARE @.login AS sysname;
> DECLARE @.password AS nvarchar(512);
> SET @.publication = N'tables';
> SET @.publisher = N'server';
> SET @.publicationDB = N'database';
> SET @.websyncurl = 'https://webserver/WebSync';
> SET @.login = N'websql\user';
> Set @.password = N'pass';
> USE [LocalDB]
> EXEC sp_addmergepullsubscription
> @.publisher = @.publisher,
> @.publication = @.publication,
> @.publisher_db = @.publicationDB,
> @.subscriber_type = N'anonymous';
> EXEC sp_addmergepullsubscription_agent
> @.publisher = @.publisher,
> @.publisher_db = @.publicationDB,
> @.publication = @.publication,
> @.distributor = @.publisher,
> @.job_login = @.login,
> @.job_password = @.password,
> @.use_web_sync = 1,
> @.internet_url = @.websyncurl,
> @.internet_login = @.login,
> @.internet_password = @.password,
> @.enabled_for_syncmgr = 'true';
> GO
> This creates the subscription locally but gives me the error
> "websql\user not a valid Windows account". I tried changing the
> job_login & job_password to a local account and the subscription was
> added without errors. When I go to start the syncronization I get the
> error: "The system cannot find the file specified." The underlying
> error here is with the proxy. For some reason when it tries to connect
> it isn't passing the proper credentials or something.
> Anyway, any I'd appreciate any help or direction. If I find out what's
> wrong I'll go ahead and post it.
> JC
>
|||Mike,
Appreciate the reply and you are correct. I split the credentials into
two, one for the machine and one for the web. This brought up a second
error which I pondered for some time until a colleage suggested I look
at the security permissions for the login. I tried several things but
this is what I was doing when I got it to work:
0. Ensure that windows account SQL run under has proper authority to
execute job
1. Log into windows using the windows account SQL is using
2. Log into SQL using Windows Authentication
3. Execute the above script (after adding a second set of credentials
for the job)
4. Run replication
Some of the above steps may not be necessary.. it just worked for me.
HTH someone else.. man, I was in a bad spot.
JC

Monday, March 12, 2012

Merge replication issue - The subscription to publication is invalid

I am trying to configure a merge replication of publication with 151 table-articles over 128 kbps line via proxy (Win XP, WinProxy), which is used for connection to internet as well.
The whole snapshot runs well, all the data are pumped to the subscriber and all dri, trg etc. scripts are executed without problem, but instead of the message "No data needed to be merged" comes out this error message:

Last Command: {call sp_MSgetreplicainfo(?,?,?,?,?,?,?)}

The subscription to publication 'Katalog' is invalid.
(Source: Merge Replication Provider (Agent); Error number: -2147201019)
--------------------------
General network error. Check your network documentation.
(Source: FANTOM (Data source); Error number: 11)
--------------------------

When I try to replicate the small Northwind database, everything works fine, no errors. When I try to replicate only a few tables from my big database, everything works fine.

Thank you very much for any ideas.The problem is probably in WinProxy. When comunicating without Proxy everything goes OK.|||Hi,

I had seen your psting and asking your help.

How do I use the FTP option in Merge Replication

I am using Merge Replication on SqlServer 2000 with SP2 and MDAC2.7 loaded on my system.
My database version is 8.00.534 on Windows2000 Advancedserver.

Both Publisher and Subscriber are running with same versions.

I created a publication and I created a pull subscription using internet.
I want the subscriber machine to access the Publisher
machine via ftp and get the Snapshot and do
Synchronization.

I had setup the following parameters at the Publisher side
for the publication.

1.Generate snapshots in the following location as

\\myservername\D$\Microsoft SQL Server\MSSQL\REPLDATA\ftp which is UNC shared with full access.

2.Checked - Subscribers can access this folder using FTP

ftpservername -myservername
port-21

Login-Anonymous, no password

3.At subscriber side I had setup SnapshotLocation property as
Download the folder using File Transfer Protocol - checked

I get the following errors at Synchronization time
After configuring subscriber for merge replication i am getting staus as succeeded at the subscriber.

when performing data modifications I am getting following errors during synchronisation time.

Errors

Category:NULL
Source: Merge Replication Provider
Number: -2147201001
Message: The schema script '' could not be propagated to the subscriber.

Category:AGENT
Source: SRVH
Number: 0
Message: The process could not connect to FTP site 'HERITAGEAMERICA' using port 21.

Category:OS
Source:
Number: 12007
Message: The server name or address could not be resolved

The schema script '' could not be propagated to the subscriber. The step failed.

Microsoft conformed this is a bug and that details are
Question number is Q318592.
BUG #: 356652 (SHILOH_BUGS) BUG #: 356652 (SHILOH_BUGS)

Microsoft confirmed that this is a bug when we use different versions check with the Question in microsoft site in fixes.

I am getting same error for same versions also.

Can anyone help me on how to use FTP for accessing
Snapshots?

Thanks|||Hello,

I have not any experience with using FTP for merge replication over internet, we are using VPN connection to the server on port 1433.
But as far as I understood, you do not get the error message when transferring a snapshot but at the moment, when the distributor needs to propagate data changes between publisher and subscriber.
I suppose it is important when do you get the error message: whether on the very beginning of applying the snapshot or at the end.
Also would be useful to check, whether the FTP connection is reliable (proxies, switches etc.).

Caruso|||Hi

May be you can help me wit a minor problem in Merge replication. I am trying to perform merge replication on two SQL Server 2000 databases on Windows Nt 4.0 platform using TCP/IP and FTp. Have set everything in Publication and Subscriber for FTp and the subscriber can connect to publisher.

I am getting the followiing error message afetr running replmerg.exe withh all required parameters for FTP.

Microsoft SQL Server Merge Agent 8.00.194
Copyright (c) 2000 Microsoft Corporation

Connecting to Subscriber 'RAJ'
Connecting to Distributor 'VTPL'
Initializing
Connecting to Publisher 'VTPL'
Retrieving publication information
Retrieving subscription information
Snapshot files will be downloaded via ftp
Connecting to ftp site 'VTPL'
The subscription has been marked for reinitialization. Reinitialization will occur the next time you synchronize this subscription.
The schema script '\\VTPL\C$\Program Files\Microsoft SQL Server\MSSQL\ReplData\ftp\VTPL_Caryaire_F2\2003010 7120306\RightMain_1.sch' could not be propagated to the subscriber.
Category:NULL
Source: Merge Replication Provider
Number: -2147201001
Message: The schema script '\\VTPL\C$\Program Files\Microsoft SQL Server\MSSQL\ReplData\ftp\VTPL_Caryaire_F2\2003010 7120306\RightMain_1.sch' could not be propagated to the subscriber.
Category:AGENT
Source: VTPL
Number: 0
Message: The process could not retrieve file 'VTPL_Caryaire_F2\20030107120306\RightMain_1.sch' from the FTP site 'VTPL'.
Category:OS
Source:
Number: 12003
Message: 200 Type set to I.
200 PORT command successful.
550 VTPL_Caryaire_F2\20030107120306\RightMain_1.sch: The system cannot find the path specified.
550 VTPL_Caryaire_F2\20030107120306\RightMain_1.sch: The system cannot find the path specified.

The process finished. Use CTRL+C to close this window.

I am desparately in need of a solution. Can anyone help me out?

Thanks and regards,
Anamika|||Hi,

Anamika, first thing I would like you to do is check the verison of SQL server 2000. Merge Replication module has some problems. It have been fixed in the SQL server SP3. It is essential to apply this pack on SQL server.

Secondly you need to check ftp settings. your ftp service or root directory of ftp is not configured properly. Due to this you are getting "The process could not retrieve file 'VTPL_Caryaire_F2\20030107120306\RightMain_1.sch' from the FTP site 'VTPL'. "VTPL_Caryaire_F2" parent folder should be root of ftp site.
Details are available in windows or in IIS about ftp configuration.