Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./config.sh remove #701

Closed
ozitraveller opened this issue Dec 1, 2016 · 18 comments
Closed

./config.sh remove #701

ozitraveller opened this issue Dec 1, 2016 · 18 comments
Assignees

Comments

@ozitraveller
Copy link

Agent version and platform

Version of your agent? 2.102.0/2.100.1...


OS of the machine running the agent? Linux...

VSTS type and version

On-Prem TFS?


Version 15.105.25910.0


## **What's not working?**

I'm trying remove and re-configure. Remove is failing.

./config.sh remove --unattended --auth Negotiate --username aaa\bbb --password ppp
Removing service
Failed: Removing service
Unconfigure service first according to https://www.visualstudio.com/en-us/docs/build/admin/agents/v2-linux


## **Agent and Worker's diag log** Logs are located at the `_diag` under agent root folder, agent log prefix with `Agent_`, worker log prefix with `Worker_`. all sensitive information should already be masked out, please double check before paste here.

+++++++++++++++++++++++++++++++++++++++++++++++++++
cat Agent_20161130-024010-utc.log
[2016-11-30 02:40:10Z INFO AgentProcess] Agent is built for Linux - rhel.7.2-x64.
[2016-11-30 02:40:10Z INFO AgentProcess] RuntimeInformation: Linux 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016.
[2016-11-30 02:40:11Z INFO AgentProcess] Version: 2.105.7
[2016-11-30 02:40:11Z INFO AgentProcess] Commit: 5f286b1
[2016-11-30 02:40:11Z INFO AgentProcess] Culture: en-AU
[2016-11-30 02:40:11Z INFO AgentProcess] UI Culture: en-AU
[2016-11-30 02:40:11Z INFO HostContext] Well known directory 'Bin': '/home/xxx/myagent/bin'
[2016-11-30 02:40:11Z INFO HostContext] Well known directory 'Root': '/home/xxx/myagent'
[2016-11-30 02:40:11Z INFO AgentProcess] Validating directory permissions for: '/home/xxx/myagent'
[2016-11-30 02:40:11Z INFO CommandLineParser] Parse
[2016-11-30 02:40:11Z INFO CommandLineParser] Parsing 1 args
[2016-11-30 02:40:11Z INFO CommandLineParser] parsing argument
[2016-11-30 02:40:11Z INFO CommandLineParser] HasArgs: False
[2016-11-30 02:40:11Z INFO CommandLineParser] Adding Command: remove
[2016-11-30 02:40:11Z INFO AgentProcess] Arguments parsed
[2016-11-30 02:40:11Z INFO ProxyConfiguration] No proxy setting found.
[2016-11-30 02:40:11Z INFO Agent] ExecuteCommand
[2016-11-30 02:40:11Z INFO ConfigurationStore] currentAssemblyLocation: /home/xxx/myagent/bin/Agent.Listener.dll
[2016-11-30 02:40:11Z INFO ConfigurationStore] binPath: /home/xxx/myagent/bin
[2016-11-30 02:40:11Z INFO ConfigurationStore] RootFolder: /home/xxx/myagent
[2016-11-30 02:40:11Z INFO ConfigurationStore] ConfigFilePath: /home/xxx/myagent/.agent
[2016-11-30 02:40:11Z INFO ConfigurationStore] CredFilePath: /home/xxx/myagent/.credentials
[2016-11-30 02:40:11Z INFO ConfigurationStore] ServiceConfigFilePath: /home/xxx/myagent/.service
[2016-11-30 02:40:11Z INFO CommandSettings] Flag 'help': 'False'
[2016-11-30 02:40:11Z INFO CommandSettings] Flag 'version': 'False'
[2016-11-30 02:40:11Z INFO CommandSettings] Flag 'commit': 'False'
[2016-11-30 02:40:11Z INFO CommandSettings] Command 'configure': 'False'
[2016-11-30 02:40:11Z INFO CommandSettings] Command 'remove': 'True'
[2016-11-30 02:40:11Z INFO Terminal] WRITE LINE: Removing service
[2016-11-30 02:40:11Z INFO ConfigurationStore] IsServiceConfigured()
[2016-11-30 02:40:11Z INFO ConfigurationStore] IsServiceConfigured: False
[2016-11-30 02:40:11Z INFO Terminal] WRITE LINE: Removing agent from the server
[2016-11-30 02:40:11Z INFO ConfigurationStore] IsConfigured()
[2016-11-30 02:40:11Z INFO ConfigurationStore] IsConfigured: True
[2016-11-30 02:40:11Z INFO ConfigurationStore] HasCredentials()
[2016-11-30 02:40:11Z INFO ConfigurationStore] stored True
[2016-11-30 02:40:12Z INFO ConfigurationManager] GetCredentialProvider
[2016-11-30 02:40:12Z INFO CommandSettings] Arg 'auth': ''
[2016-11-30 02:40:12Z INFO CommandSettings] Flag 'unattended': 'False'
[2016-11-30 02:40:12Z INFO PromptManager] ReadValue
[2016-11-30 02:40:12Z INFO Terminal] WRITE: Enter authentication type (press enter for Negotiate) >
[2016-11-30 02:40:12Z INFO Terminal] READ LINE
[2016-11-30 02:40:19Z INFO Terminal] Read value: ''
[2016-11-30 02:40:19Z INFO PromptManager] Falling back to the default: 'Negotiate'
[2016-11-30 02:40:19Z INFO ConfigurationManager] Creating credential for auth: Negotiate
[2016-11-30 02:40:19Z INFO CredentialManager] GetCredentialProvider
[2016-11-30 02:40:19Z INFO CredentialManager] Creating type Negotiate
[2016-11-30 02:40:19Z INFO CredentialManager] Creating credential type: Negotiate
[2016-11-30 02:40:19Z INFO PersonalAccessToken] EnsureCredential
[2016-11-30 02:40:19Z INFO CommandSettings] Arg 'username': ''
[2016-11-30 02:40:19Z INFO CommandSettings] Flag 'unattended': 'False'
[2016-11-30 02:40:19Z INFO PromptManager] ReadValue
[2016-11-30 02:40:19Z INFO Terminal] WRITE: Enter user name >
[2016-11-30 02:40:19Z INFO Terminal] READ LINE
[2016-11-30 02:40:37Z INFO Terminal] Read value: 'a\b'
[2016-11-30 02:40:37Z INFO CommandSettings] Arg 'password': ''
[2016-11-30 02:40:37Z INFO CommandSettings] Flag 'unattended': 'False'
[2016-11-30 02:40:37Z INFO PromptManager] ReadValue
[2016-11-30 02:40:37Z INFO Terminal] WRITE: Enter password >
[2016-11-30 02:40:37Z INFO Terminal] READ SECRET
[2016-11-30 02:40:49Z INFO Terminal] Read value: '********'
[2016-11-30 02:40:49Z INFO NegotiateCredential] GetVssCredentials
[2016-11-30 02:40:49Z INFO NegotiateCredential] User name retrieved.
[2016-11-30 02:40:49Z INFO NegotiateCredential] Password retrieved.
[2016-11-30 02:40:49Z INFO NegotiateCredential] URL retrieved: http://melbnsqltfs:8080/tfs/
[2016-11-30 02:40:49Z INFO ConfigurationManager] cred retrieved
[2016-11-30 02:40:53Z INFO Terminal] WRITE LINE: Failed: Removing agent from the server
[2016-11-30 02:40:53Z ERR Agent] Microsoft.VisualStudio.Services.Common.VssUnauthorizedException: VS30063: You are not authorized to access http://melbnsqltfs.epenau.local:8080.
at Microsoft.VisualStudio.Services.Common.VssHttpMessageHandler.d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.VisualStudio.Services.Common.VssHttpRetryMessageHandler.<SendAsync>d__3.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Net.Http.HttpClient.<FinishSendAsync>d__58.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.d__45.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__421.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult() at Microsoft.VisualStudio.Services.Location.Client.LocationHttpClient.<GetConnectionDataAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.ConfiguredTaskAwaitable1.ConfiguredTaskAwaiter.GetResult()
at Microsoft.VisualStudio.Services.WebApi.Location.VssServerDataProvider.d__41.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.AgentServer.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Listener.Agent.d__9.MoveNext()
[2016-11-30 02:40:53Z ERR Terminal] WRITE ERROR: VS30063: You are not authorized to access http://melbnsqltfs.epenau.local:8080.

+++++++++++++++++++++++++++++++++++++++++++++++++++
cat Agent_20161201-023407-utc.log
[2016-12-01 02:34:07Z INFO AgentProcess] Agent is built for Linux - rhel.7.2-x64.
[2016-12-01 02:34:07Z INFO AgentProcess] RuntimeInformation: Linux 3.10.0-327.36.3.el7.x86_64 #1 SMP Mon Oct 24 16:09:20 UTC 2016.
[2016-12-01 02:34:08Z INFO AgentProcess] Version: 2.105.7
[2016-12-01 02:34:08Z INFO AgentProcess] Commit: 5f286b1
[2016-12-01 02:34:08Z INFO AgentProcess] Culture: en-AU
[2016-12-01 02:34:08Z INFO AgentProcess] UI Culture: en-AU
[2016-12-01 02:34:08Z INFO HostContext] Well known directory 'Bin': '/home/gillsi/myagent/bin'
[2016-12-01 02:34:08Z INFO HostContext] Well known directory 'Root': '/home/gillsi/myagent'
[2016-12-01 02:34:08Z INFO AgentProcess] Validating directory permissions for: '/home/gillsi/myagent'
[2016-12-01 02:34:08Z INFO CommandLineParser] Parse
[2016-12-01 02:34:08Z INFO CommandLineParser] Parsing 1 args
[2016-12-01 02:34:08Z INFO CommandLineParser] parsing argument
[2016-12-01 02:34:08Z INFO CommandLineParser] HasArgs: False
[2016-12-01 02:34:08Z INFO CommandLineParser] Adding Command: configure
[2016-12-01 02:34:08Z INFO AgentProcess] Arguments parsed
[2016-12-01 02:34:08Z INFO ProxyConfiguration] No proxy setting found.
[2016-12-01 02:34:08Z INFO Agent] ExecuteCommand
[2016-12-01 02:34:08Z INFO ConfigurationStore] currentAssemblyLocation: /home/gillsi/myagent/bin/Agent.Listener.dll
[2016-12-01 02:34:08Z INFO ConfigurationStore] binPath: /home/gillsi/myagent/bin
[2016-12-01 02:34:08Z INFO ConfigurationStore] RootFolder: /home/gillsi/myagent
[2016-12-01 02:34:08Z INFO ConfigurationStore] ConfigFilePath: /home/gillsi/myagent/.agent
[2016-12-01 02:34:08Z INFO ConfigurationStore] CredFilePath: /home/gillsi/myagent/.credentials
[2016-12-01 02:34:08Z INFO ConfigurationStore] ServiceConfigFilePath: /home/gillsi/myagent/.service
[2016-12-01 02:34:08Z INFO CommandSettings] Flag 'help': 'False'
[2016-12-01 02:34:08Z INFO CommandSettings] Flag 'version': 'False'
[2016-12-01 02:34:08Z INFO CommandSettings] Flag 'commit': 'False'
[2016-12-01 02:34:08Z INFO CommandSettings] Command 'configure': 'True'
[2016-12-01 02:34:08Z INFO ConfigurationManager] ConfigureAsync
[2016-12-01 02:34:08Z INFO ConfigurationStore] IsConfigured()
[2016-12-01 02:34:08Z INFO ConfigurationStore] IsConfigured: True
[2016-12-01 02:34:08Z INFO ConfigurationManager] Is configured: True
[2016-12-01 02:34:09Z ERR Agent] System.InvalidOperationException: Cannot configure the agent because it is already configured. To reconfigure the agent, run 'config.cmd remove' or './config.sh remove' first.
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.Services.Agent.Listener.Agent.d__9.MoveNext()
[2016-12-01 02:34:09Z ERR Terminal] WRITE ERROR: Cannot configure the agent because it is already configured. To reconfigure the agent, run 'config.cmd remove' or './config.sh remove' first.

@bryanmacfarlane
Copy link
Contributor

There were issues with this back in the preview of the agent. (2.100.1 ...). Setup a later agent (2.109.0 or later).

@TingluoHuang
Copy link
Contributor

@ozitraveller
according to the Doc you referenced, you need stop the service and uninstall the service before you unconfigure the agent.

sudo ./svc.sh stop
sudo ./svc.sh uninstall

@ozitraveller
Copy link
Author

Thanks I got the latest version. If I delete the agent folder, will that allow me to start again?

@bryanmacfarlane
Copy link
Contributor

Yeah, you can just wack the whole folder. You can also go the web UI to delete the agent registration (red X).

The only thing to check is if you ran it as a svc before, there may still be a svc config file (what Ting's point above was). I think there's a .service file in the root of the agent telling you where that file is if you want to do it manually (will need to sudo). All svc.sh does is gen a per OS svc config file

@ozitraveller
Copy link
Author

ozitraveller commented Dec 1, 2016 via email

@bryanmacfarlane
Copy link
Contributor

yeah, around that periond (100.x), the unconfig and remove stuff was just coming online and changing alot.

Let us know how a new fresh 109+ agent goes.

@ozitraveller
Copy link
Author

Hi Bryan

I'm using vsts-agent-rhel.7.2-x64-2.110.0.tar.gz and all seems to be setup and running ok.

I'm getting errors when I do a build in tfs though, see rhe screenie.

image

@TingluoHuang
Copy link
Contributor

@ozitraveller Can you share your agent and worker's _diag log with us?

@ericsciple
Copy link
Contributor

@ozitraveller and can you run a build with a variable system.debug set to true and send the build logs (download from build summary page after the build completes) along with the zipped _diag logs. can send to ersciple (at microsoft dot com)

@ozitraveller
Copy link
Author

Sure can do.

@ericsciple
Copy link
Contributor

@ozitraveller sorry this blended in with other emails that i ignored. i've got the logs now.

@ericsciple ericsciple self-assigned this Dec 5, 2016
@ericsciple
Copy link
Contributor

@ozitraveller i briefly looked. it looks like git is not in your PATH. is that correct?

@ozitraveller
Copy link
Author

@ericsciple
It could well be. On the tfs build server?

@ozitraveller
Copy link
Author

Ok I found it. name : _gitpath

@ericsciple
Copy link
Contributor

if you are running the agent interactively from the cmdprompt then you need to make sure git can be located from your PATH env var - i.e. which git from the cmdline should resolve the location to git

if you are running the agent as a service then iirc there is a .PATH file you can add it to

@ericsciple
Copy link
Contributor

ericsciple commented Dec 5, 2016

PR #710

@ozitraveller
Copy link
Author

I'm installing git on the linux box.

@ozitraveller
Copy link
Author

Get sources
The build is now doing a dotnet restore/build.
Build successful!

Excellent !

@ericsciple Thank you! Appreciate your help! :)

prebansa pushed a commit to prebansa/azure-pipelines-agent that referenced this issue Aug 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants