NT Credentials problem in TeamCity 1.2

Hi-
I am trying to run a nant build using TeamCity 1.2 and one of the
targets runs osql to initialize a database. The osql command uses the
current running process's NT credentials to authenticate but this
authentication is failing with the following error:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

I have tried running both the TeamCity service and the agentd under
credentials that would authenticate with SQL, but I continue to get the
same error. I also can not find any configuration options that would
affect this.

I can get osql to work if I provide the username and password in the
command line, but this is not a permanent solution since our database
should be setup to accept NT authentication only.

What do I need to do to get this to work properly? Or is there no other
option?

-Mark Madsen
mark.madsen@parlano.com

7 comments
Comment actions Permalink

Hello Mark,

What version of (MS)SQL server/osql do you use? Under what os agentd is
running?

Could you please try as a workaround to set user account for agentd to work
with osql, reboot computer,
and try running you build.


Thanks!
--
Eugene Petrenko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi-
I am trying to run a nant build using TeamCity 1.2 and one of the
targets runs osql to initialize a database. The osql command uses the
current running process's NT credentials to authenticate but this
authentication is failing with the following error:

Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'.

I have tried running both the TeamCity service and the agentd under
credentials that would authenticate with SQL, but I continue to get
the same error. I also can not find any configuration options that
would affect this.

I can get osql to work if I provide the username and password in the
command line, but this is not a permanent solution since our database
should be setup to accept NT authentication only.

What do I need to do to get this to work properly? Or is there no
other option?

-Mark Madsen
mark.madsen@parlano.com



0
Comment actions Permalink

Hi Eugene-
I am using SQL2005 and osql version 2000.80.760.0
agentd is running on XP Pro.

When I modify the nant script to exec osql with "-U username -P
password" it works just fine, but when I exec it with "-E" it will not
work. I get the error that I posted.

I have tried to set the agentd service to run with the credentials that
I know work with osql and SQL and that did not make any difference. It
seems that agentd is starting off another process of some sort that is
not using the domain account that agentd was started with.

Thanks,
Mark Madsen

Eugene Petrenko wrote:

Hello Mark,

What version of (MS)SQL server/osql do you use? Under what os agentd is
running?

Could you please try as a workaround to set user account for agentd to
work with osql, reboot computer,
and try running you build.


Thanks!

0
Comment actions Permalink

Hello Mark,

As for workaround, could you please try to start buildagent from console.
Please, stop agentd service. Login to system with osql-aware account,
start ]]>\bin\agent.bat to run agent in console mode under
current user.

Agent Service is a java process, that is starts agent - parent java process
of service and
agent starts new child process to run build.

--
Eugene Petrenko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi Eugene-
I am using SQL2005 and osql version 2000.80.760.0
agentd is running on XP Pro.
When I modify the nant script to exec osql with "-U username -P
password" it works just fine, but when I exec it with "-E" it will not
work. I get the error that I posted.

I have tried to set the agentd service to run with the credentials
that I know work with osql and SQL and that did not make any
difference. It seems that agentd is starting off another process of
some sort that is not using the domain account that agentd was started
with.

Thanks,
Mark Madsen
Eugene Petrenko wrote:

>> Hello Mark,
>>
>> What version of (MS)SQL server/osql do you use? Under what os agentd
>> is running?
>>
>> Could you please try as a workaround to set user account for agentd
>> to
>> work with osql, reboot computer,
>> and try running you build.
>> Thanks!
>>


0
Comment actions Permalink

Hi-
Running the agent from the console cleared up the problem.

-Mark

Eugene Petrenko wrote:

Hello Mark,

As for workaround, could you please try to start buildagent from console.
Please, stop agentd service. Login to system with osql-aware account,
start <agent>\bin\agent.bat to run agent in console mode under current
user.

Agent Service is a java process, that is starts agent - parent java
process of service and
agent starts new child process to run build.

0
Comment actions Permalink

Hi-
I don't really consider this problem resolved. Is there (or will
there be) a solution to this. Running the agent from the console is not
an option for us. This problem is not confined to osql. All of our DB
connections within our code base depend on NT auth. Many of our
automated tests fail because of this.

-Mark Madsen

Mark Madsen wrote:

Hi-
Running the agent from the console cleared up the problem.

-Mark

Eugene Petrenko wrote:

>> Hello Mark,
>>
>> As for workaround, could you please try to start buildagent from console.
>> Please, stop agentd service. Login to system with osql-aware account,
>> start \bin\agent.bat to run agent in console mode under current >> user. >> >> Agent Service is a java process, that is starts agent - parent java >> process of service and >> agent starts new child process to run build. >>]]>

0
Comment actions Permalink

Hello Mark,

We have tryed to reproduce the problem with SQL server NT Domain authentification
and
to reproduce the problem with the folder access without any result.

Could you please describe you SQL server configuration and options for
us to
reproduce the problem.

Please check the user name under which NAnt process is started by the agentd.exe
windows service and agentd.exe process itself
(Sysinternals ProcessExplorer can be used to perfom that action).

Could you please try to check if it is that possible for NAnt build to
get access
to some folder (nework share) with allowed access rights only form NT Domain
user with MSSQL rights.

Thanks!
--
Eugene Petrenko
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi-
I don't really consider this problem resolved. Is there (or will
there be) a solution to this. Running the agent from the console is
not
an option for us. This problem is not confined to osql. All of our DB
connections within our code base depend on NT auth. Many of our
automated tests fail because of this.

-Mark Madsen

Mark Madsen wrote:

>> Hi-
>> Running the agent from the console cleared up the problem.
>> -Mark
>>
>> Eugene Petrenko wrote:
>>
>>> Hello Mark,
>>>
>>> As for workaround, could you please try to start buildagent from
>>> console. Please, stop agentd service. Login to system with
>>> osql-aware account, start \bin\agent.bat to run agent in >>> console mode under current user. >>> >>> Agent Service is a java process, that is starts agent - parent java >>> process of service and >>>]]> agent starts new child process to run build.


0
Comment actions Permalink

Hi-
I have since re-installed the server and build agent on different
machines and the problem has cleared up. Originally, I had the agent and
the server installed on the same machine. Not sure if this would have
caused the original problem. Either way, I am happy with the way it is
working now.
I have also checked out the 2.0 EAP, and that has no problem at all with
both the agent and the server on the same server.

Thanks for the help.

-Mark

Eugene Petrenko wrote:

Hello Mark,

We have tryed to reproduce the problem with SQL server NT Domain
authentification and to reproduce the problem with the folder access
without any result.

Could you please describe you SQL server configuration and options for
us to reproduce the problem.

Please check the user name under which NAnt process is started by the
agentd.exe windows service and agentd.exe process itself
(Sysinternals ProcessExplorer can be used to perfom that action).

Could you please try to check if it is that possible for NAnt build to
get access to some folder (nework share) with allowed access rights
only form NT Domain user with MSSQL rights.

Thanks!

0

Please sign in to leave a comment.