MSTest fails with NT AUTHORITY ANONYMOUS LOGON error from SQL Server when running via Jenkins Build Job

Issue

I have MSTest unit test cases which log into a SQL Server to verify information in the database. When I run the test from a command prompt on the Jenkins server, the test runs successfully. When I kick off a build which runs the same test, all test which access the database fail with an ’NT AUTHORITY\ANONYMOUS LOGON error. 

Environment

  • CloudBees Jenkins Enterprise
  • Windows 2008 R2

Resolution

The build job was running on a windows slave machine where Jenkins was not running as a service.

Change the build slave to run Jenkins as a service and set up the service account which Jenkins is running under for the test to execute as expected.

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.