I am trying to register the agent in server to create Deployment Groups for Azure DevOps Release pipeline using the provided PowerShell script(Azure DevOps Portal). Script is able to download the azagent, but throwing the below error while configuring the agent:
Error:
Microsoft.TeamFoundation.DistributedTask.WebApi.TaskAgentPoolNotFoundException: No agent pool found with identifier 13.
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable1 queryParameters, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.DeploymentGroupAgentConfigProvider.AddAgentAsync(AgentSettings agentSettings, TaskAgent agent, CommandSettings command)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.ConfigureAsync(CommandSettings command)
Please refer to this doc:
You're a member of a project and you want to use a set of machines owned by your team for running build and deployment jobs. First, make sure you're a member of a group in All Pools with the Administrator role.
Based on the error message, it seems that the agent pool couldn't be found. So you could check your permission for the target Deployment Group pool in Collection Settings -> Deployment Pools-> Security.
You could grant the Administrator permission for your account. Then you could check if it could work.
Here is a ticket with the similar issue, you could refer to it.
Related
I am dockerizing an ASP.NET Core 6 application step by step as follows:
I have set up WSL2 in Windows 10 and installed Racher Desktop. This allows running docker commands as if run in the WSL2 guest
I have run a Postgresql container and it is accessible to both host (Windows) pgAdmin and for the ASP.NET Core when run from Visual Studio:
docker run -d -v pgdata:/var/lib/postgresql/data -e POSTGRES_PASSWORD=postgres -p 5433:5432 postgres
(port 5432 was hijacked by some service before installing the Postgres and I had to use another port).
When running from Visual Studio, the application uses the following connection string:
Host=localhost:5433; Database=foo-next; Username=postgres; Password=postgres; Timeout=300; CommandTimeout=300
I have created a Dockerfile and a docker image for the application. When running I receive the following error:
Unhandled exception. System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000005, 0xFFFDFFFF): Name does not resolve
at System.Net.Dns.GetHostEntryOrAddressesCore(String hostName, Boolean justAddresses, AddressFamily addressFamily, ValueStopwatch stopwatch)
at System.Net.Dns.<>c.<GetHostEntryOrAddressesCoreAsync>b__33_0(Object s, ValueStopwatch stopwatch)
at System.Net.Dns.<>c__DisplayClass39_0`1.<RunAsync>b__0(Task <p0>, Object <p1>)
at System.Threading.Tasks.ContinuationResultTaskFromTask`1.InnerInvoke()
at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj)
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location ---
at Npgsql.TaskExtensions.ExecuteWithTimeout[TResult](Func`2 func, NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.TaskExtensions.WithCancellation[T](Task`1 task, CancellationToken cancellationToken)
at Npgsql.TaskExtensions.WithTimeout[T](Task`1 task, NpgsqlTimeout timeout)
at Npgsql.Internal.NpgsqlConnector.ConnectAsync(NpgsqlTimeout timeout, CancellationToken cancellationToken)
at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
at Npgsql.Internal.NpgsqlConnector.<Open>g__OpenCore|191_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.UnpooledConnectorSource.Get(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlConnection.<Open>g__OpenAsync|45_0(Boolean async, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternalAsync(Boolean errorsExpected, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenAsync(CancellationToken cancellationToken, Boolean errorsExpected)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.ExistsAsync(CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
I interpret this as the application not being able to resolve postgres hostname. I have checked if Postgres containers and the .NET Core one run in the same network and they seem they do, but some attributes are missing for my app network metadata:
Wehn running in the container, the application uses the following connection string:
Host=postgres:5433; Database=foo-next-docker; Username=postgres; Password=postgres; Timeout=300; CommandTimeout=300
docker inspect postgres -f "{{json .NetworkSettings.Networks }}"
{"bridge":{"IPAMConfig":null,"Links":null,"Aliases":null,"NetworkID":"343ece236719b94d53df0afe1ab0d405a19102002f67ea60a1914016d4e4f96b","EndpointID":"9c3740b300caaf50f86731f00530dce62b386b56ccc2fe3da96c4cb677dcb42d","Gateway":"172.17.0.1","IPAddress":"172.17.0.3","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:11:00:03","DriverOpts":null}}
docker inspect foonextapp -f "{{json .NetworkSettings.Networks }}"
{"bridge":{"IPAMConfig":null,"Links":null,"Aliases":null,"NetworkID":"343ece236719b94d53df0afe1ab0d405a19102002f67ea60a1914016d4e4f96b","EndpointID":"","Gateway":"","IPAddress":"","IPPrefixLen":0,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"","DriverOpts":null}}
The same result I get when explicitly running the container attached to the bridge network:
docker run -p 8080:80 --name fooapp fooapp --network=bridge
Not sure if it provides more information, but the whole docker network list is the following:
docker network ls
NETWORK ID NAME DRIVER SCOPE
343ece236719 bridge bridge local
df0c354db7cf host host local
6efb481fc02b minikube bridge local
23bdb658109a none null local
Any suggestions about what to try next in order to make the app running in local container resolve the database container name?
Note: all commands were run in Windows.
You need to specify a network-alias, because a container’s hostname defaults to be the container’s ID.
In PowerShell:
docker network create app
docker run -dp 5433:5432 `
-v pgdata:/var/lib/postgresql/data `
-e POSTGRES_PASSWORD=postgres `
--network app --network-alias postgres `
postgres
docker run -dp 8080:80 --network app fooapp
We have this issue that has been plaguing our engineering group for over a year and we cannot make any progress on the resolution. This question on Stack Overflow is eerily similar to what we experience.
We have several pipelines that use the "Visual Studio Test" task to run a set of NUnit tests from a single assembly. There are 1400-1500 unit tests in the project and it takes The NUnit Test Adapter is deployed via the NuGet task (install NUnit3TestAdapter). This test assembly is built with the following settings:
MSBuild Architecture=x86
Platform=AnyCPU
Configuration=Release
Strong Name Signed
Across multiple pipelines, this step randomly yet consistently ends early with zero error message or trace of why the process ended. Running a subsequent build of the pull request will often result in a success but occasionally another failure. In this case we have coined this a "flaky build" where given the same exact code inputs, the build can fail and then subsequently pass.
This is the only error message we received from the pipeline:
##[error]Exit code 1 returned from process: file name 'REDACTED\externals\node\bin\node.exe', arguments '"REDACTED_work_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\runvstest.js"'.
Finishing: Integration Tests
These tests are our "integration tests" that perform many setup steps to create a functional version of our system including creating a web server via Kestrel to host our API, connect to (localdb) running on the build server to restore a database .bak file and apply a database project (dacpac) as well as connect to Redis (also installed locally on the build server).
We are struggling to determine next steps so I am reaching out to the community to see if anyone else has suffered through this issue, has ideas for how to debug the issue or perhaps even a solution!
edit on 2020-11-10
Yesterday I set the pipeline variable system.debug to true and this is the output it captured during one of our flaky builds.
##[error\]Exit code 1 returned from process: file name 'E:\\servername\\externals\\node\\bin\\node.exe', arguments '"E:\\servername\\\_work\\\_tasks\\VSTest\_ef087383-ee5e-42c7-9a53-ab56c98420f9\\2.170.1\\runvstest.js"'.
##[debug\]Microsoft.VisualStudio.Services.Agent.Util.ProcessExitCodeException: Exit code 1 returned from process: file name 'E:\\servername\\externals\\node\\bin\\node.exe', arguments '"E:\\servername\\\_work\\\_tasks\\VSTest\_ef087383-ee5e-42c7-9a53-ab56c98420f9\\2.170.1\\runvstest.js"'.
at Microsoft.VisualStudio.Services.Agent.Util.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary\`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, InputQueue\`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary\`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, InputQueue\`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Worker.Handlers.DefaultStepHost.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary\`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Boolean inheritConsoleHandler, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Worker.Handlers.NodeHandler.RunAsync()
at Microsoft.VisualStudio.Services.Agent.Worker.TaskRunner.RunAsync()
at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)
I have been trying to add an environment resource to our pipeline in azure devops but every time i install it with the powershell script they provide it asks me for tags. If i don't want to input tags it errors. If i choose to put in tags it errors. Either way it starts over every time and it will never successfully install. Anyone know if this is something on my end or on their end? I looked through the diagnostic file and the exceptions it is logging look like it's something that i can't fix but i have been having issues with this for over a week and thinking it was something that Microsoft would realize and patch. Now i'm wondering if there is something else i can do?
[2020-05-22 13:01:48Z ERR VisualStudioServices] POST request to https://DEVOPS_URL/24cca667-60da-4ba2-a323-4e05c46f3309/_apis/pipelines/environments/3/providers/virtualmachines failed. HTTP Status: InternalServerError, AFD Ref: Ref A: 56C7161B437D41698EBBDE7ACBF4CAA2 Ref B: ATAEDGE0918 Ref C: 2020-05-22T13:01:48Z
[2020-05-22 13:01:48Z INFO CommandSettings] Flag 'unattended': 'False'
[2020-05-22 13:01:48Z ERR Terminal] WRITE ERROR (exception):
[2020-05-22 13:01:48Z ERR Terminal] Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: TF400898: An Internal Error Occurred. Activity Id: acb8a36a-e602-4988-b3f7-8fbeecd729e0.
---> System.NullReferenceException: TF400898: An Internal Error Occurred. Activity Id: acb8a36a-e602-4988-b3f7-8fbeecd729e0.
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.HandleResponseAsync(HttpResponseMessage response, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync(HttpRequestMessage message, HttpCompletionOption completionOption, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpRequestMessage message, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable1 queryParameters, Object userState, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.EnvironmentVMResourceConfigProvider.AddAgentAsync(AgentSettings agentSettings, TaskAgent agent, CommandSettings command)
at Microsoft.VisualStudio.Services.Agent.Listener.Configuration.ConfigurationManager.ConfigureAsync(CommandSettings command)
I was experiencing a similar error "Failed to add virtual machine resource. Linked environment pool is null."
Answer from Kevin Ross here: https://developercommunity.visualstudio.com/t/addition-of-resource-to-environment-fails-for-user/1048111
I resolved my error by following the below steps:
Get the deployment pool ID from the environment URL
Find the deployment pool settings in the organization settings and navigate to the correct pool based on ID from step 1
From the deployment pool settings, go to security and add the required user to administrator role or whatever role is required
I'm using the OpsHub Visual Studio Online Migration tool to migrate a TFS2010 project (source code only) to Visual Studio online. On the user mapping screen, I made my mappings (most to anonymous, but a few key users with mappings) and off it went. After a while I got the following:
249/410 Changeset(s)/Label(s) passed
1/410 Changeset(s)/Label(s) pending for retry
When I view the errors, I see this:
OH-SCM-009: Error occurred while sync. TF14045: The identity XYZ, Bruce (USHQ) is not a recognized identity.
Bruce is one of the users I mapped. I went back in to update the migration to see what I can do.
I tried removing the "XYZ, Bruce (USHQ) -- XYZ, Bruce (USHQ)" mapping and re-adding it and then retrying. Same error.
I then tried removing the mapping and mapping to anonymous. It seemed to accept this, but got the same error on retry. I noticed then that the mapping was back to "XYZ, Bruce (USHQ) -- XYZ, Bruce (USHQ)" and I can't seem to make it anonymous. This is true for any users that appear in both lists (TFS Users and VSO users).
Other users are mapping correctly from what I can tell.
My best case would be to correctly map this user. Next would be to map it to anonymous.
Any advice would be appreciated.
Below is the error in the log:
2015-06-09 07:51:56,022 [3] ERROR Error occured in thread of CheckinAll:TF14045: The identity XYZ, Bruce (USHQ) is not a recognized identity.
at Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.HandleReply(TfsClientOperation operation, TfsMessage message, Object[]& outputs)
at Microsoft.TeamFoundation.VersionControl.Client.Repository5.CheckIn(String workspaceName, String ownerName, String[] serverItems, Changeset info, CheckinNotificationInfo checkinNotificationInfo, Int32 checkinOptions, Failure[]& conflicts, Failure[]& failures, Boolean deferCheckIn, Int32 checkInTicket, Int32 maxClientPathLength)
at Microsoft.TeamFoundation.VersionControl.Client.WebServiceLayerLocalWorkspaces.CheckIn(String workspaceName, String ownerName, String[] serverItems, Changeset info, CheckinNotificationInfo checkinNotificationInfo, Int32 checkinOptions, UploadedBaselinesCollection uploadedBaselinesCollection, Failure[]& conflicts, Failure[]& failures, Boolean deferCheckIn, Int32 checkInTicket)
at Microsoft.TeamFoundation.VersionControl.Client.Workspace.PagedCheckin(IEnumerable`1 changes, Boolean changesIsAllPendingChanges, Changeset changeset, CheckinNotificationInfo checkinNotificationInfo, CheckInOptions2 checkinOptions, UploadedBaselinesCollection uploadedBaselinesCollection, Failure[]& conflictsArray, Failure[]& failuresArray)
at Microsoft.TeamFoundation.VersionControl.Client.Workspace.CheckInInternal(WorkspaceCheckInParameters parameters, Int32 operationId)
at Microsoft.TeamFoundation.VersionControl.Client.Workspace.CheckIn(WorkspaceCheckInParameters checkinParameters)
at Service.Adapters.TFSCheckinWorkspaceContext.checkin(String comment, WorkItemCheckinInfo[] workItemChanges, List`1 otherCheckInProperties, String checkinUser) in e:\5.7Checkout\VSMUOpsHubV2\TFSWCFServiceSource\Service\Service\TFSVersionControl\AdapterComponents\TFSCheckinWorkspaceContext.cs:line 2579
at Service.Adapters.TFSVCAdapter.checkIn(List`1 checkinItems, String checkinComment, String checkinUser, List`1 workitemId, List`1 otherCheckInProperties) in e:\5.7Checkout\VSMUOpsHubV2\TFSWCFServiceSource\Service\Service\TFSVersionControl\AdapterComponents\TFSVCAdapter.cs:line 125
at com.opshub.tfs.test.TFSWebService.<>c__DisplayClass2.<CheckInAll>b__0() in e:\5.7Checkout\VSMUOpsHubV2\TFSWCFServiceSource\Service\Service\TFSWebService.cs:line 760
2015-06-09 07:51:56,024 [3] ERROR Error : TF14045: The identity XYZ, Bruce (USHQ) is not a recognized identity.
I have a problem with a running build machine, where the agent suddenly does not want to start. It's been a part of a remote controller and for trouble shooting this issue, if started a local controller. The symptoms are, at the agent(s) initializes correct (says 'Ready'), but has the stopped icon and in the status area says 'BuildController has not been started in 1 minutes. The AD account running the build service works on another build machine (seperate controller + build agents). I've tried the following
Reinstall the build service
running with machine name, fully qualified domain name and IP address for endpoint address
un- and re-registered build service
rebooted
cleaned up build agent registrations with script
If I change the service account running the build service to my own AD account, it works. However, running under our dedicated build user failes on this particular machine, but not the other. Any suggestions what to do? Here's the error from the event log:
Service 'Default Agent - tfs2010build1' had an exception:
Exception Message: There was no endpoint listening at http://tfs2010build1:9191/Build/v3.0/Services/Controller/31 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. (type EndpointNotFoundException)
Exception Stack Trace:
Server stack trace:
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.TeamFoundation.Build.Machine.IBuildControllerService.TestConnectionFromController(String agentUri)
at Microsoft.TeamFoundation.Build.Machine.ServiceProxies.ServiceProxy`1.<>c__DisplayClass3.<Do>b__2(T channel)
at Microsoft.TeamFoundation.Build.Machine.ServiceProxies.ServiceProxy`1.Do[TResult](Func`2 action)
at Microsoft.TeamFoundation.Build.Machine.BuildAgentService.<>c__DisplayClass12.<TestConnection>b__11(Object )
Inner Exception Details:
Exception Message: Unable to connect to the remote server (type WebException)
Exception Stack Trace: at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
Inner Exception Details:
Exception Message: No connection could be made because the target machine actively refused it 127.0.0.1:38742 (type SocketException)
Exception Stack Trace: at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
Found the problem. Proxy server was enabled under IE options. Not sure why the build service worked under my AD user account and not the dedicated build user, but it solved the problem.
---->>>>>Update!
So we have 2 machines (B1 & B2), each with 2 agents. B1 had the initial problem and was solved by disabling the proxy settings under IE. Yesterday B2 suddenly started showing the same symptons and error messages on the 2 agents. Proxy setting is NOT enabled. While it did fix B1, it's not the universal solution for this particular problem.
It's hard work keeping these build agents running :( - Miss TeamCity...
---->>>>Update again!
So yesterday when I looked at the proxy configuration, it wasn't set. However this morning the checkbox was checked. Disabled the proxy and the agents went online. Very strange behavior! Wonder if Windows Update changes these settings...
I often get this same issue with the proxy when I am forced to manually stop a build. I have not been able to find any decent resolutions for this.