Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
RichJ
Contributor III
Contributor III

replica stop with mssql_check_if_file_exists(...) - unsuccessfull

The replica user has sysadmin and db_owner privilege, but still failed with the following errs -

mssql_check_if_file_exists(...) - unsuccessfull SQLExecDirect(...) call. [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot find either column "master" or the user-defined function or aggregate "master.attrep.rtm_check_file_exists", or the name is ambiguous. [20014] (sqlserver_log_utils.c:5199)
00002068: 2023-08-11T05:03:53 [SOURCE_CAPTURE ]E: Failed to check whether alternate backup file '\\backups\Log230810191610.bak' exists [20014] (sqlserver_log_utils.c:5613)
00002068: 2023-08-11T05:04:23 [SOURCE_CAPTURE ]E: mssql_execute_log_lsn_peeper(...) failed upon SQLExecute with LSN parameters '0xNULL,NULL,NULL,NULL,NULL,NULL,NULL,NU','0xNULL,NULL,NULL,NULL,NULL,NULL,NULL,NU' 
 
Btw, the replica task runs fine until lately, and DBA found no DB changes except an index creation.  But when starting from the logs one day after the index creation, the same err occurs.
 
Did anyone encounter the same issue and what is the solution?
Any ideas / suggestions are appreciated.
 
- Richard
9 Replies
sureshkumar
Support
Support

Hello @RichJ 


Will you confirm whether the below backup file exists or not
\\backups\Log230810191610.bak

"mssql_execute_log_lsn_peeper(...) failed upon SQLExecute with LSN parameters"

The above error is because the task was reading the data from the mentioned LSN and before it could complete, the LSN was moved. If we were reading from online logs and it got moved to Backup then in the next iteration it will read it from backup.

Change processing mode (read changes from):Try selecting "Prioritize Online Logs" and check.

https://help.qlik.com/en-US/replicate/May2023/Content/Replicate/Main/SQL%20Server/SQLServerDBSource_...

 

Regards,

Suresh

RichJ
Contributor III
Contributor III
Author

Thanks Suresh for your reply.

\\backups\Log230810191610.bak exists, and we are using "Prioritize Online Logs"

 

 

sureshkumar
Support
Support

Hello @RichJ 

Please open a support ticket with us to analyze further on this.

 

Regards,

Suresh

kevin_e_eckart
Contributor II
Contributor II

Was there any fix to this? I'm facing the same issue in version May 2023 (2023.5.0.413. I have validated that the file exists and has been registered in MSDB.

Dana_Baldwin
Support
Support

Hi @kevin_e_eckart 

Is your source endpoint on premises SQL Server, or a cloud variant where we are not able to access the backup TLOGs?

If on prem, is the source endpoint configured to read from the online logs only?

Thanks,

Dana

kevin_e_eckart
Contributor II
Contributor II

Azure VM running SQL server. Change processing mode is set to "prioritize online logs". The current Replicate server running version November 2022 (2022.11.0.546) is able to read from the backup logs without issue. Newer server running version May 2023 (2023.5.0.413) is having the issue. The newer server also reads the online log without issue. 

kevin_e_eckart
Contributor II
Contributor II

Adding the following function to the master DB fixed the issue 

CREATE FUNCTION [attrep].[rtm_check_file_exists]
(
@filename varchar(260)
) returns int
as
begin
declare @exists int = 0;
exec master.dbo.xp_fileexist @filename, @exists OUT;
return @exists;
end
GO

 which was outlined in this article.  

What's not clear to me is why this is needed when running the newer version of Replicate. The same sysadmin user is running the replicate process on both the old and new server. Also, the source DB connections are identical.

Dana_Baldwin
Support
Support

Hi @kevin_e_eckart 

I'm glad you got it working. Seems like you're using a non-sysadmin user in which case that procedure that you linked is still relevant, but I'm not sure why you didn't need it on version 2022.11, it seems like it would only be relevant at the SQL Server level and not dependent on the version of Replicate.

Please open a support case so we can look into this further, as we may need to involve our internal support team and there is no mechanism for that here in our forums.

Thanks,

Dana

JoshAtBeijer
Contributor II
Contributor II

Hello,

We have a the same issue or similar one.

The soruce is an MSSQL server with prioritized online logs, during maintance slot when the server restart we get issues. 

With default configuration we got this issue:

Spoiler
Could not read from backup. The backup file is either inaccessible or does not exist.

Then we configured the alternate backup folder, where the backup is located on the server but on a different drive. Then we run into the same issue.

Spoiler
00003780: 2025-09-25T12:26:23 [SOURCE_CAPTURE  ]E:  mssql_check_if_file_exists(...) - unsuccessfull  SQLExecDirect(...) call. [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Cannot find either column "master" or the user-defined function or aggregate "master.attrep.rtm_check_file_exists", or the name is ambiguous. [20014]  (sqlserver_log_utils.c:5181)00003780: 2025-09-25T12:26:23 [SOURCE_CAPTURE  ]E:  Failed to check whether alternate backup file

We are currently running Qlik Replicate version 2024.5.0.563 with a sysadmin sql account.


Our questions:

 

  • If the server restarts, is the alternative backup folder a requirement if placed somewhere else? (In this case another drive such as E: instead of the bullet below)?
  • If the server restart, and the backup is in the same folder as the sql server (default location, C:\Program Files\Microsoft SQL Server\MSSQL{version}.MSSQLSERVER\MSSQL\Backup) will it then work out of the box? 
  • Has it been working before without the custom function? My colleague insist it has been working on 2024.5.0.144 or 2022.5.x (
  • Required permissions | Qlik Replicate Help this one tell us to follow step 16-20 but it is missing creating the attrep schema. Step 4. Is it a fault in the documentation?
  • If we use a UNC path, do we still need rtm_check_file_exists? (ChatGPT insist it is working)
  • In the documentation it states that we need to follow 16-20 but if we use a sysadmin account, then we only need do step 4 and 16 and skip 17-20. Is that correct?
  • This documentation state that UCN path is required, is that correct? Is it when only using alternative backup without backup folder username/password?

Setting advanced connection properties #Setting advanced connection properties | Qlik Replicate Help