build.xml: exec returned: 1

Okay. I'm really confused. I had a build working fine and suddenly it stopped working and gives the error in the subject of this msg. The build works fine on the command line on the build agent. But the build fails every time it is run through TeamCity.

The problem seemed to me to be that the "p4" command could not be found.

Some info:
TeamCity (2.1.1) Server is a Red Hat EL3 box.
The only build agent that runs the problem build is a Windows XP desktop.
Perforce 2005.2 is the SCM.
The build does not automatically do a checkout.
The ant build.xml runs a p4sync task before the build.

The full error is:
: exec (<1s)
: exec returned: 1
: The following error occurred while executing this line: C:\workspaces\services\build\build.xml:374: exec returned: 1


The build target that seems to fail is this:
]]>
<arg value="$"/>
]]>

BTW, another oddity that started happening was that the Perforce user it wants to use is "SYSTEM" which doesn't exist rather than the user logged into the build agent which does exist as a Perforce user.

Any help would be welcome.

-Dave

5 comments

Hello Dave,

Could you please check the user account is used to run your server. By
default
TeamCity Build agent is set up under SYSTEM account. Some application may
requre
more concrete account to work under. Does p4 compatible with that account?
Cound you please try to run agent under some other (domain) account.

Thanks!

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

Okay. I'm really confused. I had a build working fine and suddenly it
stopped working and gives the error in the subject of this msg. The
build works fine on the command line on the build agent. But the build
fails every time it is run through TeamCity.

The problem seemed to me to be that the "p4" command could not be
found.

Some info:
TeamCity (2.1.1) Server is a Red Hat EL3 box.
The only build agent that runs the problem build is a Windows XP
desktop.
Perforce 2005.2 is the SCM.
The build does not automatically do a checkout.
The ant build.xml runs a p4sync task before the build.
The full error is:
: exec (<1s)
: exec returned: 1
: The following error occurred while executing this
line: C:\workspaces\services\build\build.xml:374: exec returned: 1
The build target that seems to fail is this:
<!--
Set properties that describe whether the DDS zip file exists in
Perforce,
and whether it is currently checked out.
-->
<target name="_check-spec-status">
<exec executable="p4" searchpath="true" failonerror="true"
outputproperty="p4.output-text" errorproperty="p4.error-text">
<arg value="-d"/>
<arg value="$"/>
<arg value="fstat"/>
<arg value="${dialog.archive}"/>
</exec>
<condition property="p4.file-exists" value="true">
<not>
<contains string="${p4.error-text}" substring="no such file"/>
</not>
</condition>
<condition property="p4.file-open" value="true">
<contains string="${p4.output-text}" substring="action edit"/>
</condition>
<available property="DDS.spec-exists"
file="${service.specs}/${service.name}.ats"/>
</target>
BTW, another oddity that started happening was that the Perforce user
it wants to use is "SYSTEM" which doesn't exist rather than the user
logged into the build agent which does exist as a Perforce user.

Any help would be welcome.

-Dave



0

Eugene,

Could you please check the user account is used to
run your server. By default TeamCity Build agent is
set up under SYSTEM account. Some application may
requre more concrete account to work under. Does p4
compatible with that account?
Cound you please try to run agent under some other
(domain) account.


I came up with a workaround for this and now understand
the cause of the problem. Yesterday, maintenance was done
in Perforce to clean up old users and make it more secure.
There was a SYSTEM Perforce user that was deleted. The
security that was added to Perforce means that only admins
can create new Perforce accounts.

So, the workaround was to recreate the Perforce SYSTEM account
and add it to one of the Perforce groups so that it can execute the p4 fstat
command. But, this requires that we use a Perforce license for this
user and we are low on licenses (which is why the SYSTEM user was
deleted in the first place).

Is there a way to set the build agent user to a specific user account
on the build agent?

Thanks,
-Dave

0

Hello Dave,

Yes.

First of all it is possible to change user of the service by the 'Services'
applet of windows.
The second way is to use Build agent .exe installer. It should suggest you
an option to install windows service upder user accound or under SYSTEM account.
Actually you will have to reistall build agent for that way.

Please note, TeamCity Build agent uses Java Service Wrapper to run as windows
service.


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

Eugene,

>> Could you please check the user account is used to
>> run your server. By default TeamCity Build agent is
>> set up under SYSTEM account. Some application may
>> requre more concrete account to work under. Does p4
>> compatible with that account?
>> Cound you please try to run agent under some other
>> (domain) account.

I came up with a workaround for this and now understand the cause of
the problem. Yesterday, maintenance was done in Perforce to clean up
old users and make it more secure. There was a SYSTEM Perforce user
that was deleted. The security that was added to Perforce means that
only admins can create new Perforce accounts.

So, the workaround was to recreate the Perforce SYSTEM account
and add it to one of the Perforce groups so that it can execute the p4
fstat
command. But, this requires that we use a Perforce license for this
user and we are low on licenses (which is why the SYSTEM user was
deleted in the first place).
Is there a way to set the build agent user to a specific user account
on the build agent?

Thanks,
-Dave



0

Eugene,

First of all it is possible to change user of the service by the 'Services'
applet of windows.


This solution worked on our Windows build agent. Thanks.

However, all my builds on our Linux build agent (which is the same machine as the
TeamCity server) are now failing with: Java returned: 1

There have been no code changes for any of these builds (they build nightly regardless
of changes) and they all built successfully 2 days ago. The server is started as the
"build" user (who owns the files in the sandbox). So, I assume that the default build agent
is started as the same user. Is that the case?

Thanks,
-Dave

0

However, all my builds on our Linux build agent
(which is the same machine as the
TeamCity server) are now failing with: Java returned: 1


Never mind about this. Bouncing the TeamCity server/default build agent
fixed the ejbc compile errors.

Thanks for your help, Eugene.

-Dave

0

Please sign in to leave a comment.