Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Merge Replication error: You do not have permission to run 'SP_TRACE_GENERATEEVENT'

I have setup a merge replication. Server DUCKDUCK1-1 is distributor and publisher. Server DUCKDUCK-2 is subscriber.

I have only one small table replicated (this is a test).

The table is being replicated (but it's empty on the subscriber).

The error shown says:

Error messages:
You do not have permission to run 'SP_TRACE_GENERATEEVENT'. (Source: MSSQLServer, Error number: 8189)
Get help: http://help/8189
The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write. (Source: MSSQL_REPL, Error number: MSSQL_REPL-2147201001)
Get help: http://help/MSSQL_REPL-2147201001

The verbose log says the following:

2018-05-18 14:41:34.856 Microsoft SQL Server Merge Agent 11.0.5058.0
2018-05-18 14:41:34.866 Copyright (c) 2008 Microsoft Corporation
2018-05-18 14:41:34.870 Microsoft SQL Server Replication Agent: replmerg
2018-05-18 14:41:34.874 
2018-05-18 14:41:34.877 The timestamps prepended to the output lines are expressed in terms of UTC time.
2018-05-18 14:41:34.879 User-specified agent parameter values:
            -Publisher DUCKDUCK-1-1
            -PublisherDB mydatabase
            -Publication Replication2018
            -Subscriber DUCKDUCK-2
            -SubscriberDB mydatabase
            -Distributor DUCKDUCK-1-1
            -DistributorSecurityMode 1
            -Continuous
            -OutputVerboseLevel 2
            -Output \\DUCKDUCK-1-1\snapshot_replicacion\salida.txt
            -XJOBID 0x307666C42266374F956FDBF68CA326E6
            -XJOBNAME DUCKDUCK-1-1-mydatabase-Replication2018-DUCKDUCK-2-1
            -XSTEPID 2
            -XSUBSYSTEM Merge
            -XSERVER DUCKDUCK-1-1
            -XCMDLINE 0
            -XCancelEventHandle 0000058C
            -XParentProcessHandle 00000614
2018-05-18 14:41:34.922 Percent Complete: 0
2018-05-18 14:41:34.926 Connecting to Distributor 'DUCKDUCK-1-1'
2018-05-18 14:41:34.929 Connecting to OLE DB Distributor at datasource: 'DUCKDUCK-1-1', location: '', catalog: '', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:34.965 OLE DB Distributor: DUCKDUCK-1-1
            DBMS: Microsoft SQL Server
            Version: 11.00.5058
            catalog name: 
            user name: dbo
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:34.969 OLE DB Distributor 'DUCKDUCK-1-1': select SERVERPROPERTY ('ProductVersion') 
2018-05-18 14:41:34.972 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_helpdistpublisher (N'DUCKDUCK-1-1') }
2018-05-18 14:41:34.977 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_MShelp_repl_agent (N'DUCKDUCK-1-1', N'mydatabase', N'Replication2018', N'DUCKDUCK-2', N'mydatabase', 1)}
2018-05-18 14:41:34.983 OLE DB Distributor 'DUCKDUCK-1-1': select datasource, srvid from master..sysservers where upper(srvname) = upper(N'DUCKDUCK-1-1')
2018-05-18 14:41:34.987 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_MShelp_merge_agentid (0,N'mydatabase',N'Replication2018',null,N'mydatabase',90,N'DUCKDUCK-2')}
2018-05-18 14:41:34.992 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_MShelp_profile (1, 4, N'')}
2018-05-18 14:41:34.995 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_get_redirected_publisher(N'DUCKDUCK-1-1',N'mydatabase',0)}
2018-05-18 14:41:34.999 Percent Complete: 0
2018-05-18 14:41:34.999 Connecting to OLE DB Publisher at datasource: 'DUCKDUCK-1-1', location: '', catalog: 'mydatabase', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:35.002 Initializing
2018-05-18 14:41:35.008 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.010 OLE DB Publisher: DUCKDUCK-1-1
            DBMS: Microsoft SQL Server
            Version: 11.00.5058
            catalog name: mydatabase
            user name: dbo
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.014 Percent Complete: 0
2018-05-18 14:41:35.014 OLE DB Publisher 'DUCKDUCK-1-1': set nocount on declare @dbname sysname select @dbname = db_name() declare @collation nvarchar(255) select @collation = convert(nvarchar(255), databasepropertyex(@dbname, N'COLLATION')) select collationproperty(@collation, N'CODEPAGE') as 'CodePage', collationproperty(@collation, N'LCID') as 'LCID', collationproperty(@collation, N'COMPARISONSTYLE') as 'ComparisonStyle',cast(case when convert (int,databasepropertyex (@dbname,'comparisonstyle')) & 0x1 = 0x1 then 0 else 1 end as bit) as DB_CaseSensitive,cast(case when convert (int,serverproperty ('comparisonstyle')) & 0x1 = 0x1 then 0 else 1 end as bit) as Server_CaseSensitive set nocount off
2018-05-18 14:41:35.017 Validating publisher
2018-05-18 14:41:35.021 OLE DB Publisher 'DUCKDUCK-1-1': select SERVERPROPERTY ('ProductVersion') 
2018-05-18 14:41:35.024 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.028 Connecting to OLE DB Publisher at datasource: 'DUCKDUCK-1-1', location: '', catalog: 'mydatabase', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:35.031 Percent Complete: 0
2018-05-18 14:41:35.034 Connecting to Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.036 OLE DB Publisher: DUCKDUCK-1-1
            DBMS: Microsoft SQL Server
            Version: 11.00.5058
            catalog name: mydatabase
            user name: dbo
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.037 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.051 OLE DB Distributor 'DUCKDUCK-1-1': {call sp_MShelp_repl_agent (N'DUCKDUCK-1-1', N'mydatabase', N'Replication2018', N'DUCKDUCK-2', N'mydatabase', 1)}
2018-05-18 14:41:35.055 Connecting to OLE DB Subscriber at datasource: 'DUCKDUCK-2', location: '', catalog: 'mydatabase', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:35.072 OLE DB Subscriber: DUCKDUCK-2
            DBMS: Microsoft SQL Server
            Version: 11.00.6020
            catalog name: mydatabase
            user name: clientes
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.077 OLE DB Subscriber 'DUCKDUCK-2': select SERVERPROPERTY ('ProductVersion') 
2018-05-18 14:41:35.081 OLE DB Subscriber 'DUCKDUCK-2': set nocount on declare @dbname sysname select @dbname = db_name() declare @collation nvarchar(255) select @collation = convert(nvarchar(255), databasepropertyex(@dbname, N'COLLATION')) select collationproperty(@collation, N'CODEPAGE') as 'CodePage', collationproperty(@collation, N'LCID') as 'LCID', collationproperty(@collation, N'COMPARISONSTYLE') as 'ComparisonStyle',cast(case when convert (int,databasepropertyex (@dbname,'comparisonstyle')) & 0x1 = 0x1 then 0 else 1 end as bit) as DB_CaseSensitive,cast(case when convert (int,serverproperty ('comparisonstyle')) & 0x1 = 0x1 then 0 else 1 end as bit) as Server_CaseSensitive set nocount off
2018-05-18 14:41:35.085 Percent Complete: 0
2018-05-18 14:41:35.085 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.088 Connecting to Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.093 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.094 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.099 Percent Complete: 0
2018-05-18 14:41:35.102 Retrieving publication information
2018-05-18 14:41:35.104 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.110 Percent Complete: 0
2018-05-18 14:41:35.113 Retrieving subscription information.
2018-05-18 14:41:35.114 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.115 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.123 Percent Complete: 0
2018-05-18 14:41:35.127 Applying the snapshot to the Subscriber
2018-05-18 14:41:35.129 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.190 OLE DB Distributor 'DUCKDUCK-1-1': select datasource, srvid from master..sysservers where upper(srvname) = upper(N'DUCKDUCK-1-1')
2018-05-18 14:41:35.193 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_mergesubentry_indistdb (0,N'DUCKDUCK-1-1',N'mydatabase',N'Replication2018',N'DUCKDUCK-2',N'mydatabase',0,1,0,N'',?,90)}
2018-05-18 14:41:35.201 Connecting to OLE DB Subscriber at datasource: 'DUCKDUCK-2', location: '', catalog: 'mydatabase', providerstring: '' using provider 'SQLNCLI11'
2018-05-18 14:41:35.209 OLE DB Subscriber: DUCKDUCK-2
            DBMS: Microsoft SQL Server
            Version: 11.00.6020
            catalog name: mydatabase
            user name: clientes
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.213 OLE DB Subscriber: DUCKDUCK-2
            DBMS: Microsoft SQL Server
            Version: 11.00.6020
            catalog name: mydatabase
            user name: clientes
            API conformance: 0
            SQL conformance: 0
            transaction capable: 1
            read only: F
            identifier quote char: "
            non_nullable_columns: 0
            owner usage: 15
            max table name len: 128
            max column name len: 128
            need long data len: 
            max columns in table: 1000
            max columns in index: 16
            max char literal len: 131072
            max statement len: 131072
            max row size: 131072
2018-05-18 14:41:35.220 OLE DB Subscriber 'DUCKDUCK-2': sp_MSacquiresnapshotdeliverysessionlock
2018-05-18 14:41:35.223 OLE DB Subscriber 'DUCKDUCK-2': sp_MStrypurgingoldsnapshotdeliveryprogress
2018-05-18 14:41:35.231 OLE DB Subscriber 'DUCKDUCK-2': sp_MSissnapshotitemapplied @snapshot_session_token = N'\\DUCKDUCK-1-1\snapshot_replicacion\unc\DUCKDUCK-1-1_mydatabase_Replication2018\20180518112431\', @snapshot_progress_token = N'\\DUCKDUCK-1-1\snapshot_replicacion\unc\DUCKDUCK-1-1_mydatabase_Replication2018\20180518112431\provincias_2.sch'
2018-05-18 14:41:35.235 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.252 [18%] OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
  Ƶ 騰Ā  ꌸƵ硦燠ꍜƵὀ Ἷ 姸gꍜƵPercent Complete: 18
2018-05-18 14:41:35.258 Skipping file 'provincias_2.sch' because it has already been delivered for a previous article or by a previously interrupted snapshot.
2018-05-18 14:41:35.261 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.270 The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.[18%] 
  Ƶ 騰Ā  ꌸƵ硦燠ꍜƵὀ Ἷ 姸gꍜƵPercent Complete: 18
2018-05-18 14:41:35.276 OLE DB Subscriber 'DUCKDUCK-2': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.279 Preparing table 'provincias' for merge replication
2018-05-18 14:41:35.285 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.292 Percent Complete: 18
2018-05-18 14:41:35.295 You do not have permission to run 'SP_TRACE_GENERATEEVENT'.
2018-05-18 14:41:35.297 OLE DB Distributor 'DUCKDUCK-1-1': {call sys.sp_MSadd_merge_history90 (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)}
2018-05-18 14:41:35.342 Percent Complete: 0
2018-05-18 14:41:35.345 Category:SQLSERVER
Source:  DUCKDUCK-2
Number:  8189
Message: You do not have permission to run 'SP_TRACE_GENERATEEVENT'.
2018-05-18 14:41:35.351 Percent Complete: 0
2018-05-18 14:41:35.354 Category:NULL
Source:  Merge Replication Provider
Number:  -2147201001
Message: The merge process was unable to deliver the snapshot to the Subscriber. If using Web synchronization, the merge process may have been unable to create or write to the message file. When troubleshooting, restart the synchronization with verbose history logging and specify an output file to which to write.
2018-05-18 14:41:35.357 Disconnecting from OLE DB Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.360 Disconnecting from OLE DB Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.363 Disconnecting from OLE DB Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.365 Disconnecting from OLE DB Subscriber 'DUCKDUCK-2'
2018-05-18 14:41:35.368 Disconnecting from OLE DB Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.372 Disconnecting from OLE DB Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.375 Disconnecting from OLE DB Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.378 Disconnecting from OLE DB Publisher 'DUCKDUCK-1-1'
2018-05-18 14:41:35.380 Disconnecting from OLE DB Distributor 'DUCKDUCK-1-1'
2018-05-18 14:41:35.383 Disconnecting from OLE DB Distributor 'DUCKDUCK-1-1'
2018-05-18 14:41:35.386 The merge process will restart after waiting 30 second(s)...

Can't figure out what's going on.

like image 722
Stephen H. Anderson Avatar asked May 18 '18 14:05

Stephen H. Anderson


1 Answers

As per Microsoft documentation:

COM object initialization failed for an XML Subscriber. Some reasons why merge replication did not apply schema changes to the Subscriber include the following:

  • A failure to create a directory to write the temporary snapshot files.

  • A failure to enumerate schema articles.

  • For SQL Server Compact Subscribers, a failure to reinitialize the subscription.

  • If the object is message based, a failure to write to the message file.

Have you allocated enough memory to SQL Server and is anything filling up, such as transaction logs or disks?

Source: https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2012/dd581610(v=sql.110)

like image 172
NotoriousPyro Avatar answered Nov 15 '22 23:11

NotoriousPyro