Bamboo Windows Build Agent change user

Hi,

I need to change the Bamboo Build Agent user on a Windows Server 2012 R2 system from "SYSTEM" user to a local admin user. I followed the tutorial here https://confluence.atlassian.com/bamboo/running-bamboo-as-a-windows-service-as-the-local-user-416580754.html but after every build jobs fails after changing the user.

The git gets checked out, but the first powershell script to execute failes with -1. No error message or what so ever. This happens with all build jobs. If I change back to the SYSTEM user it works fine.

Any ideas how to fix it?

 

Kind regards, 

 secana

1 answer

This widget could not be displayed.

Had this myself today, for me the solution was to copy the user path env variable into the system path env variable. I had nodejs installed so my circumstances exactly matched the SO question/answer below which fixed it.

http://stackoverflow.com/a/30184185/191877 

Hope that helps.

Hi, unfortunately this does not work. The agent finds the powershell scripts but they all fail for an unknown reason. Even inline scripts don't run.

Example:

Failing task since return code of [powershell -ExecutionPolicy bypass -Command C:\Users\BambooAgent\bamboo-agent-home\xml-data\build-dir\XYZ-MS-JOB1\K-Build\pre-build.ps1 C:\Users\BambooAgent\bamboo-agent-home\xml-data\build-dir\XYZ-MS-JOB1\K-Build] was -1 while expected 0

Can you logon as the BambooAgent and run powershell scripts ok?


Also, obvious but have you followed https://confluence.atlassian.com/bamboo/running-bamboo-as-a-windows-service-as-the-local-user-416580754.html and restarted the remote agent service?

Also check the agent logs on the machine, mine showed that the reason for my -1 error code was that powershell was not a recognised command (because it wasn't included in the user path which was being read instead of system path)

Also worth checking that the bamboo agent service has sufficient permissions to run I guess. 

Can't think of much else to try, sorry.

Yes, that's the tutorial I followed. I restarted the service and the server, too. I see the remote agent running with the correct user but all build jobs fail with the error above.

I can logon to the server with the user I want to use for the agent and run all PS scripts. 

Anything in the remote agent logs?

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

124 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you