MSSQL replication snapshot agent fails on Linux

iRakic 0 Reputation points
2023-03-22T02:20:36.1566667+00:00

I'm using MS SQL server 2019 on Linux. I'm trying to create a transactional replication. The problem is that when I create a publication, the snapshot agent can not start. Basically, I'm getting this message:

sql-publication-snapshot-agent-not-running

When I check under SQL agent server jobs, I see the following messages:

2023-03-22 01:55:25.724 Status: 0, code: 20015, text: 'Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication.'.
2023-03-22 01:55:25.724 Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication.

And also this:

2023-03-22 01:50:32.33 Connecting to Distributor 'TEST-DB1.MYDOMAIN.COM'
2023-03-22 01:50:32.81 The replication agent had encountered an exception.
2023-03-22 01:50:32.81 Source: Replication
2023-03-22 01:50:32.81 Exception Type: Microsoft.SqlServer.Replication.ConnectionFailureException
2023-03-22 01:50:32.81 Exception Message: Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication.
2023-03-22 01:50:32.81 Message Code: 18452

Here is the publication SQL in case it's needed:

use [testdb]
exec sp_replicationdboption @dbname = N'testdb', @optname = N'publish', @value = N'true'
GO
-- Adding the transactional publication
use [testdb]
exec sp_addpublication @publication = N'testdb-publication', @description = N'Transactional publication of database ''testdb'' from Publisher ''test-db1.mydomain.com''.', @sync_method = N'concurrent', @retention = 0, @allow_push = N'true', @allow_pull = N'true', @allow_anonymous = N'true', @enabled_for_internet = N'false', @snapshot_in_defaultfolder = N'true', @compress_snapshot = N'false', @ftp_port = 21, @ftp_login = N'anonymous', @allow_subscription_copy = N'false', @add_to_active_directory = N'false', @repl_freq = N'continuous', @status = N'active', @independent_agent = N'true', @immediate_sync = N'true', @allow_sync_tran = N'false', @autogen_sync_procs = N'false', @allow_queued_tran = N'false', @allow_dts = N'false', @replicate_ddl = 1, @allow_initialize_from_backup = N'false', @enabled_for_p2p = N'false', @enabled_for_het_sub = N'false'
GO


exec sp_addpublication_snapshot @publication = N'testdb-publication', @frequency_type = 1, @frequency_interval = 0, @frequency_relative_interval = 0, @frequency_recurrence_factor = 0, @frequency_subday = 0, @frequency_subday_interval = 0, @active_start_time_of_day = 0, @active_end_time_of_day = 235959, @active_start_date = 0, @active_end_date = 0, @job_login = null, @job_password = null, @publisher_security_mode = 1


use [testdb]
exec sp_addarticle @publication = N'testdb-publication', @article = N'users', @source_owner = N'dbo', @source_object = N'users', @type = N'logbased', @description = null, @creation_script = null, @pre_creation_cmd = N'drop', @schema_option = 0x000000000803509F, @identityrangemanagementoption = N'manual', @destination_table = N'users', @destination_owner = N'dbo', @vertical_partition = N'false', @ins_cmd = N'CALL sp_MSins_dbousers', @del_cmd = N'CALL sp_MSdel_dbousers', @upd_cmd = N'SCALL sp_MSupd_dbousers'
GO

Is this some kind of bug, or am I missing something?

I would really appreciate your help!

SQL Server Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. LiHongMSFT-4306 31,566 Reputation points
    2023-03-22T08:22:28.22+00:00

    Hi @iRakic

    If you are trying to connect using SQL Server Authentication, verify that the SQL Server login exists and SQL Server is configured in Mixed Authentication Mode.

    If your client program is running with a Local system or Network service, the account has been successfully recognized on the SQL Server side, but it does not have permission to log in to SQL Server. The solution is to add a "domain\machinename$" account to the SQL Server login. Machinename is the machine name of the client.

    Best regards,

    Cosmog Hong


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Olaf Helper 47,436 Reputation points
    2023-03-22T11:03:49.68+00:00

    The login is from an untrusted domain and cannot be used with Integrated authentication.

    Seems you use Windows authentication, but the Linux machine isn't joined to the domain; then you can use Win auth.

    Use a SQL login instead.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.