Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

"Access Denied" When trying to run 3rd party .exe through a batch file. #28

orgas002 ·

The error that I get:

15:03:47,104 INFO - Running step...
15:03:47,107 DEBUG - Executing command: call "C:\TestComplete\blah_Testcomplete\runtest.bat"
15:03:47,107 DEBUG - Command working directory: C:\Quickbuild_Agent\buildagent\workspace\Root\blah_200_Checkin_Build
15:03:47,136 INFO -
15:03:47,136 INFO - C:\Quickbuild_Agent\buildagent\workspace\Root\blah_200_Checkin_Build>call "C:\TestComplete\blah_Testcomplete\runtest.bat"
15:03:47,182 WARN - Access is denied.
15:03:47,184 INFO - There are warnings
15:03:47,190 INFO - Executing post-execute action...
15:03:47,190 ERROR - Step 'master>TestComplete UI Test' is failed: Failed to run command: call "C:\TestComplete\blah_Testcomplete\runtest.bat"
Command return code: 1
Command error output: Access is denied.
15:03:47,289 INFO - Executing post-execute action...
15:03:47,289 ERROR - Step 'master' is failed: Composite step 'master' failed due to unsatisfied success condition.

This is the error that I get. It shouldn't be an issue with admins/permissions as I'm able to run the bat file with no issue if I open up a CMD prompt and try and run this.
Another thing to note is removing the 'call' inside the .bat file changes the error code from '1' to '5'.

Any suggestions would be helpful as we're trying to integrate Quickbuild w/ UI automation with the current tool that we already have.

It shouldn't be an issue with admins/permissions as I'm able to run the bat file with no issue if I open up a CMD prompt and try and run this.
Another thing to note is removing the 'call' inside the .bat file changes the error code from '1' to '5'.

Any suggestions would be helpful as we're trying to integrate Quickbuild w/ UI automation with the current tool that we already have (TestComplete/TestExecute)

  • solved #9
  • replies 8
  • views 2488
  • stars 1
robinshen ADMIN ·

Probably the OS user running QB process does not have permission to run this command. To verify, please run QB server or agent (depending on where you are running this step) in console mode from the command prompt where you can successfully run the command, and try the build again to see if it works.

orgas002 ·

Hi Robin,

Doing so makes my previous build.bat for VStudio fail. Access is denied to the path of the workspace for light.exe

orgas002 ·

Here is the following error:

light.exe : error LGHT0001: Access to the path 'C:\Quickbuild_Agent\buildagent\workspace\Root\blah_200_Checkin_Build\dummy\main\dev\Installer\bin\x64\Release\blah.msi' is denied. [C:\Quickbuild_Agent\buildagent\workspace\Root\blah_200_Checkin_Build\dummy\main\dev\Installer\Installer.wixproj]
09:36:03,545 INFO -
09:36:03,545 INFO - Exception Type: System.UnauthorizedAccessException
09:36:03,545 INFO -
09:36:03,545 INFO - Stack Trace:
09:36:03,545 INFO - at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
09:36:03,546 INFO - at System.IO.File.SetAttributes(String path, FileAttributes fileAttributes)
09:36:03,546 INFO - at Microsoft.Tools.WindowsInstallerXml.WixBinder.LayoutMedia(ArrayList fileTransfers, Boolean suppressAclReset)
09:36:03,546 INFO - at Microsoft.Tools.WindowsInstallerXml.Binder.BindDatabase(Output output, String databaseFile)
09:36:03,546 INFO - at Microsoft.Tools.WindowsInstallerXml.Binder.Bind(Output output, String file)
09:36:03,547 INFO - at Microsoft.Tools.WindowsInstallerXml.Tools.Light.Run(String[] args)
09:36:03,560 INFO - 168>Done Building Project "C:\Quickbuild_Agent\buildagent\workspace\Root\blah_200_Checkin_Build\dummy\main\dev\Installer\Installer.wixproj" (default targets) -- FAILED.
09:36:03,561 INFO - 9>Done Building Project "C:\Quickbuild_Agent\buildagent\workspace\Root\blah_200_Checkin_Build\dummy\main\dev\Installer\Installer.wixproj.metaproj" (default targets) -- FAILED.
09:36:03,562 INFO - 1>Done Building Project "C:\Quickbuild_Agent\buildagent\workspace\Root\blah_200_Checkin_Build\dummy\main\dev\blah.sln" (Build target(s)) -- FAILED.
09:36:03,579 INFO -
09:36:03,579 INFO - Build FAILED.

This step is prior to me launching the 3rd party application for UI testing.
This issue only happens when agent.bat console is used to start for agent builds. When switching over to agent.bat start, no issue occurs accept for the launching of the 3rd party application for UI Testing.
Another thing to note is that I am able to launch the 3rd party application UI Testing when using agent.bat console, however, building the project and solution fails.

Any help would be great.

robinshen ADMIN ·

So the testing works now, but another command does not work. This should be an environmental issue. What I am suggesting:

  1. Check NT service control panel to see under which OS user QB agent is running with, and make sure the OS user has appropriate permission over the tools you are using
  2. Check environment differences (you may add a step to run command "set" to print all env variables in QB) between console mode and service mode
orgas002 ·

Hi Robin,

Do you mind walking me through the step of seeing which OS User QB Agent is running with? Currently I have the Quickbuild Server and Quickbuild Agent running on the machine for current testing to see if we can implement this on multiple machines. The only difference would be server and agent nodes would be on different machines.

I don't know if this is an environmental issue since they're both running on the same machine, my machine which is an admin user.

Any suggestions would be great.

Thanks.

robinshen ADMIN ·

I guess you are starting QB as NT service. If so, you may open "control panel/administration tools/Services" and open details of service "Quickbuild Build Agent" to check the OS user of service is running as.

orgas002 ·

Hi Robin,

OS User of Service for both QB Server and QB Agent is set under: Local System Account, with Allow Service to interact w/ Desktop checked off.
Tried to work around by login in as other user and still no avail.

What could be a solution to this?

Thanks.

orgas002 ·

Solution is: Server and Quickbuild Agent cannot be on the same machine or else it will run into access denied issues.

Thanks.