microsoft / vso-agent

Visual Studio Team Services and TFS agent for Mac OSX and Linux
MIT License
131 stars 57 forks source link

On-prem TFS / OSX Build. Run as a daemon failed with 401or 403 #136

Closed insanity13 closed 8 years ago

insanity13 commented 8 years ago

When agent start interactively it work fine. But when I try to start it as daemon it fails with 401. stdout.log shows that env vars set right. How to set authentification for deamon correctly? I'm could not find anything in docs.

bryanmacfarlane commented 8 years ago

Can you add details on how you ran it as a daemon. Do you mean a launch daemon? Can you provide other details? Are you connecting to an on-prem server?

insanity13 commented 8 years ago

Sorry for a long silence. Yes, it's a on-premise server. Today update agent to 0.3.13 but it does not helps.

output

output2

insanity13 commented 8 years ago

Any ideas?

bryanmacfarlane commented 8 years ago

check out the read me for updated instructions for on-premise (use preview version).

However that's not what you're hitting. 401 means bad creds.

So, first, let's interactive (not daemon). Does that work? Second, look in the plist that's referenced. What creds are in it?

insanity13 commented 8 years ago

/So, first, let's interactive (not daemon). Does that work?/ Yes, I've said it in my previous message.

bryanmacfarlane commented 8 years ago

Second, look in the plist that's referenced. What creds are in it?

I wonder if it's a quoting/escaping issue in that file?? Also, you will need to append the flag to force basic (let me look that up). Just realized that will be needed.

insanity13 commented 8 years ago

So I've updated agent to "0.4" version, node to 4.2.3 Removes old agent, reconfigure, set force-basic, and now got 403 at interactive mode: 403

this user in "Agent Pool Service Account" and "Agent Pool Administrators"

insanity13 commented 8 years ago

Got it! Added user to "Project Collection Service" group.

insanity13 commented 8 years ago

Daemon still fails 401

bryanmacfarlane commented 8 years ago

adding scott

Just to confirm, you got it to work interactively by adding to the Project Collection Service group (we should figure out why - wasn't expecting).

But, you're still having an issue with the service? (note the plist is just telling it to run what you did interactively). Try interactively with -u and -p args (what the plist does)

insanity13 commented 8 years ago

401_2 I've got a minus character in my password

bryanmacfarlane commented 8 years ago

Ha!

I wonder if it's a quoting/escaping issue in that file??

:) Looks like we need to fix that.

Does quoting it work?

insanity13 commented 8 years ago

I've tried -u "user.name" -p "password", but it does not helps.

bryanmacfarlane commented 8 years ago

I updated the README.md to have specific on-prem instructions link. There were additional permissions needed (now doc'd) and a couple of fixes.

I would recommend getting a new agent via the latest instructions