SQL Agent job step fails to run SQL Data Compare Exe with UnauthorizedAccessException
MMMm
Posts: 3 New member
Running SQL Data Compare exe in command prompt and power-shell under service account context works, and able to sync data. This is a scenario of syncing data from database backup file to local database. However, the same fails when done via SQL job step with below exception:
The service account has have necessary permission to run SQL data compare exe, and access the backup file. The service account has been provisioned to use professional license.
********* Error when running via SQL job step *******
The service account has have necessary permission to run SQL data compare exe, and access the backup file. The service account has been provisioned to use professional license.
********* Error when running via SQL job step *******
Exception: System.UnauthorizedAccessException: Access to the path is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Pipes.NamedPipeClientStream.Connect(Int32 timeout)
at RedGate.Ipc.NamedPipes.NamedPipeEndpointClient.Connect(Int32 timeoutMs)
at RedGate.Ipc.Rpc.RpcConnectionProvider.TryGetConnection(TimeSpan timeout)
at RedGate.Ipc.ReconnectingConnectionProvider.ReconnectionWorker()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()Error: Database updated failed. See the above errors. Process Exit Code 0. The step succeeded.
********* No error when running SQL data compare using powershell or command prompt *******
********* No error when running SQL data compare using powershell or command prompt *******
Redgate SQL Data Compare Command Line Utility V13.4.5.6953
=================================================================
Copyright c 1999 - 2018 Redgate Software Ltd
SQL Data Compare: activated, edition professional, serial number:
Registering databases
Mapping
Comparing databases
Generating SQL scripts
Deploying databases
Finished
Tagged:
Answers
Can you double check the account running the SQL job have permissions and the job "run as user" has the permission?
Can you kill any sqldatacompare.exe and try again?
Tianjiao Li | Redgate Software
Have you visited our Help Center?
Any idea what is happening here? What could be the "maybeFullPath" it is trying to access?
the path seam good become log show "SQL Compare Command Line V13.6.1.7928"
It is after SQL Compare was launch that the error happened.
No error happened when the powerscript is launch manually . Does sqlcompare need elevation rights maybe ? or workdir are different when launching directly or with sql agent ?
Do you think it will need to have elevated privileges to call program in the c:\program files(x86) ?
My problem, in that case, when i don't use a sql agent proxy account, the sql agent account (that is a named account) is used and in this case i have a licence error (which is normal...).
Unfortunatly the account used for launching sql agent or sql server does not have enought privileges to login as a normal user for security reason... so i can't define a serial for this named account.
May be you know a method to give a valid serial number to this kind of users/accounts ?