MassTransit Azure - Receiver from Topic error - masstransit

I have subscribers to a topic in Azure Service Bus. I am frequently seeing intermittent errors being returned as follows:
MassTransit.Azure.ServiceBus.Core.Transport.ReceiveTransport Error: 0 : ReceiveTransport Faulted: sb://###, System.AggregateException: One or more errors occurred. (One or more errors occurred. (Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime)) ---> System.AggregateException: One or more errors occurred. (Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime) ---> System.ArgumentOutOfRangeException: Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime
I cannot see how/where to set the dueTime in order to prevent this happening. Subscribers are processing messages most of the time.
Is there a way to set dueTime with MassTransit?
Publisher:
await _busControl.Publish(new ConfigurationReloaded(),
context => context.TimeToLive = new TimeSpan(0, 0, 10, 0), cancellationToken);
Publish Error:
System.AggregateException: One or more errors occurred. (Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime) ---> System.ArgumentOutOfRangeException: Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime
at Microsoft.Azure.ServiceBus.Core.MessageSender.OnSendAsync(IList`1 messageList)
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.Core.MessageSender.SendAsync(IList`1 messageList)
at MassTransit.Azure.ServiceBus.Core.Transport.ServiceBusSendTransport.SendClientPipe`1.Send(SendEndpointContext clientContext)
at MassTransit.Azure.ServiceBus.Core.Transport.ServiceBusSendTransport.SendClientPipe`1.Send(SendEndpointContext clientContext)
at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
at MassTransit.Transports.PublishEndpoint.Publish[T](CancellationToken cancellationToken, T message, PublishEndpointPipeAdapter`1 adapter)
at MassTransit.Transports.PublishEndpoint.Publish[T](CancellationToken cancellationToken, T message, PublishEndpointPipeAdapter`1 adapter)
at Services.ConfigurationUpdatedHostedService.StartAsync(CancellationToken cancellationToken) in /src/ConfigurationService/Services/ConfigurationUpdatedHostedService.cs:line 32
at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.ExecuteAsync(Func`2 callback)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.ExecuteAsync(Func`2 callback)
at Microsoft.AspNetCore.Hosting.Internal.HostedServiceExecutor.StartAsync(CancellationToken token)
---> (Inner Exception #0) System.ArgumentOutOfRangeException: Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime
Receiver:
serviceBusHost.ConnectSubscriptionEndpoint<ConfigurationReloaded>($"{_serviceBusOptions.SubscriberName}_{_myUniqueSubscriberName}", x =>
{
x.AutoDeleteOnIdle = _serviceBusOptions.TimeToRemoveOnIdle;
x.Handler<ConfigurationReloaded>(context =>
{
this.Load();
return Task.CompletedTask;
});
});
Full Stack Trace:
MassTransit.Azure.ServiceBus.Core.Transport.ReceiveTransport Error: 0 : ReceiveTransport Faulted: sb://###, System.AggregateException: One or more errors occurred. (One or more errors occurred. (Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime)) ---> System.AggregateException: One or more errors occurred. (Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime) ---> System.ArgumentOutOfRangeException: Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.OnReceiveAsync(Int32 maxMessageCount, TimeSpan serverWaitTime)
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.<>c__DisplayClass64_0.<<ReceiveAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.ReceiveAsync(Int32 maxMessageCount, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.ReceiveAsync(TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.MessageReceivePump.MessagePumpTaskAsync()
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at MassTransit.Azure.ServiceBus.Core.Pipeline.MessageReceiverFilter.GreenPipes.IFilter<MassTransit.Azure.ServiceBus.Core.ClientContext>.Send(ClientContext context, IPipe`1 next)
at MassTransit.Azure.ServiceBus.Core.Pipeline.MessageReceiverFilter.GreenPipes.IFilter<MassTransit.Azure.ServiceBus.Core.ClientContext>.Send(ClientContext context, IPipe`1 next)
at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
at GreenPipes.Agents.PipeContextSupervisor`1.GreenPipes.IPipeContextSource<TContext>.Send(IPipe`1 pipe, CancellationToken cancellationToken)
at MassTransit.Azure.ServiceBus.Core.Transport.ReceiveTransport.<Receiver>b__13_0()
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. (Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime) ---> System.ArgumentOutOfRangeException: Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.OnReceiveAsync(Int32 maxMessageCount, TimeSpan serverWaitTime)
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.<>c__DisplayClass64_0.<<ReceiveAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.ReceiveAsync(Int32 maxMessageCount, TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.ReceiveAsync(TimeSpan operationTimeout)
at Microsoft.Azure.ServiceBus.MessageReceivePump.MessagePumpTaskAsync()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ArgumentOutOfRangeException: Number must be either non-negative and less than or equal to Int32.MaxValue or -1.
Parameter name: dueTime
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.OnReceiveAsync(Int32 maxMessageCount, TimeSpan serverWaitTime)
at Microsoft.Azure.ServiceBus.Core.MessageReceiver.<>c__DisplayClass64_0.<<ReceiveAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.ServiceBus.RetryPolicy.RunOperation(Func`1 operation, TimeSpan operationTimeout)
Service Collection Extension to add Mass Transit:
public static IServiceCollection AddMassTransit(
this IServiceCollection collection, string serviceBusHost, string serviceBusKeyName, string serviceBusSharedAccessKey)
{
collection.AddSingleton(Bus.Factory.CreateUsingAzureServiceBus(cfg =>
{
var host = cfg.Host(
serviceBusHost,
h =>
{
h.SharedAccessSignature(s =>
{
s.KeyName = serviceBusKeyName;
s.SharedAccessKey = serviceBusSharedAccessKey;
});
});
collection.AddSingleton(host);
}
));
collection.AddSingleton<IHostedService, BusService>();
return collection;
}

I've been suffering from this issue too. After debugging I think I found the issue. There is a default value in the .net core service bus library that is too low.
In the ShareAccessSignature config method setting TokenTimeToLive to a reasonable value seemed to solve.
sbcfg.SharedAccessSignature(sas =>
{
sas.TokenTimeToLive = TimeSpan.FromMinutes(20);
sas.KeyName = Configuration.GetValue<string>("ServiceBus:KeyName");
sas.SharedAccessKey = Configuration.GetValue<string>("ServiceBus:AccessKey");
});
For info these are the related (open) issues in github related to this default behaviour.
https://github.com/Azure/azure-service-bus-dotnet/issues/672
https://github.com/Azure/azure-sdk-for-net/issues/6312

Related

Filebeat multiline filter doesn't work with txt file

I use the filebeat to collect data from .txt file.I'm trying to use Filebeat multiline capabilities to combine log lines into one entry using the following Filebeat configuration:
filebeat.inputs:
- type: filestream
enabled: true
multiline.pattern: '^[0-9]{2}\/[0-9]{2}\/[0-9]{4}'
multiline.negate: true
multiline.match: after
paths:
- .\My.log
output.logstash:
hosts: ["localhost:5044"]
This is an example of logs. I want to merge stack trace logs.
18/11/2021 19:17:25,717 [96] ERROR B2XPPA.Web.UI.Utilities.GlobalExceptionFilter -
System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at B2X.AddressRestfulAPIClient.RestfulWebAPIClient.GetDetails(String url)
at B2X.AddressValidation.AddressValidation.GetEircodeAddress(String Eircodeid)
at B2XPPA.Web.UI.Services.DropdownsPPAService.GetEircodeAddress(String eirCodeId)
at B2XPPA.Web.UI.Models.Populators.PPADetailsPopulator.Populate(IViewModel viewModel, Quote quote)
at B2X.Services.ApplicationService.Application`1.PopulateDetailsView(DetailsViewModel viewModel, String referenceNumberInController, Quote quote)
at B2XPPA.Web.UI.Controllers.QuoteController.Create(QuoteDetailsViewModel viewModel)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
However, all the logs in Kibana continue to be separated at each new line, and no multiline formatting is happening at all. Can anyone help me out with this?
I've found out what was the problem. I used filestream as a filebeat input. multiline doesn't work with filestream. I've changed the type to log then everything works fine.
filebeat.inputs:
multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
multiline.negate: true
multiline.match: after
- type: log
enabled: true
paths:
- .\My.log
output.logstash:
hosts: ["localhost:5044"]
Your multiline pattern is not matching anything.
The pattern ^[0-9]{4}-[0-9]{2}-[0-9]{2} expects that your line to start with dddd-dd-dd, where d is a digit between 0 and 9, this is normally used when your date is something like 2022-01-22
But your line starts with the following pattern dd/dd/dddd, so you would need to change your multiline pattern to match the start of your lines.
This pattern ^[0-9]{2}\/[0-9]{2}\/[0-9]{4} would match lines starting with dates like the one you have, for example 18/11/2021.

The "error_marshaling_enabled" setting seems to be always enabled

When I run this code:
$client->evaluate('
box.session.settings.error_marshaling_enabled = false
box.error{code = 42, reason = "Foobar", type = "MyError"}
');
regardless of the value of error_marshaling_enabled I always get a response with a new (extended) error format:
[
49 => 'Foobar',
82 => [
0 => [
0 => [
0 => 'CustomError',
2 => 3,
1 => 'eval',
3 => 'Foobar',
4 => 0,
5 => 42,
6 => [
'custom_type' => 'MyError',
],
],
],
],
],
Why is that?
Short answer.
error_marshaling_enabled option affects only how error objects are encoded in response body (48, IPROTO_DATA). It does not affect how they are returned as exceptions, in the response header (82, IPROTO_ERROR).
Long answer.
In Tarantool an error object can be returned in 2 ways: as an exception and as an object. For example, this is how to throw an error as exception:
function throw_error()
box.error({code = 1000, reason = "Error message"})
-- Or
error('Some error string')
end
This is how to return it as an object:
function return_error()
return box.error.new({code = 1000, reason = "Error message"})
end
If the function was called remotely, using IPROTO protocol via a connector like netbox, or PHP connector, or any other one, the error return way affects how it is encoded into MessagePack response packet. When the function throws, and the error reaches the top stack frame without being caught, it is encoded as IPROTO_ERROR (82) and IPROTO_ERROR_24 (49).
When the error object is returned as a regular value, not as an exception, it is encoded also as a regular value, inside IPROTO_DATA (48). Just like a string, a number, a tuple, etc.
With encoding as IPROTO_ERROR/IPROTO_ERROR_24 there is no much of a configuration space. Format of these values can't be changed. IPROTO_ERROR is always returned as a MessagePack map, with a stack of errors in it. IPROTO_ERROR_24 is always an error message. The IPROTO_ERROR_24 field is kept for compatibility with connectors to Tarantool versions < 2.4.1.
With encoding as a part of IPROTO_DATA you can choose serialization way using error_marshaling_enabled option. When it is true, errors are encoded as MessagePack extension type MP_EXT, and contain the whole error stack, encoded exactly like IPROTO_ERROR value. When the option is false (default behaviour in 2.4.1), the error is encoded as a string, MP_STR, which is the error's message. If there is a stack of errors, only the newest error is encoded.
error_marshaling_enabled option exists for backward compatibility, in case your application on Tarantool wants to be compatible with old connectors, which don't support MP_EXT encoded errors.
In Tarantool < 2.4.1 errors were encoded into result MessagePack as a string with error message, and error stacks didn't exist at all. So when the new format and the error stacks feature were introduced, making the new format default would be a too radical change breaking the old connectors.
Consider these examples of how error marshaling affects results. I use Tarantool 2.4.1 console here, and built-in netbox connector. The code below can be copy pasted into the console.
First instance:
box.cfg{listen = 3313}
box.schema.user.grant('guest', 'super')
function throw_error()
box.error({code = 1000, reason = "Error message"})
end
function return_error()
return box.error.new({code = 1000, reason = "Error message"})
end
Second instance:
netbox = require('net.box')
c = netbox.connect(3313)
Now I try to call the function on the second instance:
tarantool> c:call('throw_error')
---
- error: Error message
...
The c:call('throw_error') threw an exception. If I catch it using pcall() Lua function, I will see the error object.
tarantool> ok, err = pcall(c.call, c, 'throw_error')
tarantool> err:unpack()
---
- code: 1000
base_type: ClientError
type: ClientError
message: Error message
trace:
- file: '[string "function throw_error()..."]'
line: 2
...
As you can see, I didn't set error_marshaling_enabled, but got the full error. Now I will call the other function, without exceptions. But the error object won't be full.
tarantool> err = c:call('return_error')
tarantool> err
---
- Error message
...
tarantool> err:unpack()
---
- error: '[string "return err:unpack()"]:1: attempt to call method ''unpack'' (a nil
value)'
...
The error was returned as a mere string, error message. Not as an error object. Now I will turn on the marshaling:
tarantool> c:eval('box.session.settings.error_marshaling_enabled = true')
---
...
tarantool> err = c:call('return_error')
---
...
tarantool> err:unpack()
---
- code: 1000
base_type: ClientError
type: ClientError
message: Error message
trace:
- file: '[C]'
line: 4294967295
...
Now the same function returned the error in the new format, more featured.
On the summary: error_marshaling_enabled affects only returned errors. Not thrown errors.

I am getting exception on a post request logged in stackify but not able to find cause of the error

Following is the exception stackify shows me on dashboard:
ERROR The string was not recognized as a valid DateTime. There is an unknown word starting at index 0.
System.FormatException: The string was not recognized as a valid DateTime. There is an unknown word starting at index 0. ---> System.FormatException: null is not a valid value for DateTime.
at System.DateTimeParse.Parse
at System.ComponentModel.DateTimeConverter.ConvertFrom
--- End of inner exception stack trace ---
at System.ComponentModel.DateTimeConverter.ConvertFrom
at System.ComponentModel.NullableConverter.ConvertFrom
at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.SimpleTypeModelBinder.BindModelAsync
I am not able to understand which field of the viewmodel causes the issue like this. How can I catch this exception on my local code?

Coded UI - The playback failed to find the control with the given search properties

I am trying to run recorded test cases and its giving me this error :(
I am not able to understand this.
Please help.
Test Name: CodedUITestMethod1
Test FullName: CanopusCodedUITestProject.CodedUITest1.CodedUITestMethod1
Test Source: d:\CanopusDev\Main\Source\Solutions\CanopusCodedUITestProject\CodedUITest1.cs : line 30
Test Outcome: Failed
Test Duration: 0:00:23.5295373
Result Message:
Test method CanopusCodedUITestProject.CodedUITest1.CodedUITestMethod1 threw exception:
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
TechnologyName: 'UIA'
FrameworkId: 'Wpf'
ControlType: 'Window'
Name: 'C5K Setup'
ClassName: 'HwndWrapper'
---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
Result StackTrace:
at Microsoft.VisualStudio.TestTools.UITest.Playback.Engine.IRPFPlayback.FindAllScreenElements(IScreenElement pScreenElementStart, String bstrQueryId, Object& pvarResKeys, Int32 cResKeys, Int32 nMaxDepth, Object[]& foundDescendants)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindTopLevelWindowHelper(String queryId)
at Microsoft.VisualStudio.TestTools.UITest.Playback.ScreenElement.FindFromPartialQueryId(String queryId, Boolean resetSkipStep)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl..ctor(String queryId)
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapControlNotFoundException(COMException ex, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowComException(COMException innerException, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, IPlaybackContext context)
at Microsoft.VisualStudio.TestTools.UITesting.Playback.MapAndThrowException(SystemException exception, String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl..ctor(String queryId)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.SearchTopLevelWindow(ISearchArgument topLevelSearchArg, String topLevelElementQueryId)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetTitleUpdatedTopLevelWindow(ISearchArgument topLevelSearchArg, String queryId, IList`1 windowTitles)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetTopLevelElement(Boolean useCache, Boolean useCacheOnly, ISearchArgument searchArg, IList`1 windowTitles, Int32& timeLeft)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.GetElement(Boolean useCache, ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.SearchHelper.Search(ISearchArgument searchArg)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.FindInternal()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<Find>b__3a()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.Find()
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetPropertyPrivate(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.<>c__DisplayClass3e.<GetProperty>b__3d()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.UITestControl.GetProperty(String propertyName)
at Microsoft.VisualStudio.TestTools.UITesting.ALUtility.GetTechElementFromUITestControl(UITestControl uiTestControl)
at Microsoft.VisualStudio.TestTools.UITesting.ActionExecutorManager.GetActionExecutor(UITestControl uiControl)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.ClickImplementation(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.<>c__DisplayClass6.<Click>b__5()
at Microsoft.VisualStudio.TestTools.UITesting.CodedUITestMethodInvoker.InvokeMethod[T](Func`1 function, UITestControl control, Boolean firePlaybackErrorEvent, Boolean logAsAction)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, MouseButtons button, ModifierKeys modifierKeys, Point relativeCoordinate)
at Microsoft.VisualStudio.TestTools.UITesting.Mouse.Click(UITestControl control, Point relativeCoordinate)
at CanopusCodedUITestProject.UIMap.CreateConfiguration() in d:\CanopusDev\Main\Source\Solutions\CanopusCodedUITestProject\UIMap.Designer.cs:line 280
at CanopusCodedUITestProject.CodedUITest1.CodedUITestMethod1() in d:\CanopusDev\Main\Source\Solutions\CanopusCodedUITestProject\CodedUITest1.cs:line 32
Looks like the properties of the UI Component on which you recorded has changed and so it is not able to perform your recorded actions. Verify if the search properties of the component is still the same as when you recorded.
Please look at the line shown below in your stack trace:
Microsoft.VisualStudio.TestTools.UITesting.Mouse.
Click(UITestControl control, Point relativeCoordinate)
This means that the CodedUI is trying to click on a control using a specific point on the screen.
For some reason it is unable to find the control it wants to click. Maybe no button exists on this specific point.
Most probably, the screen resolution of your current display device is different from the screen resolution of the display device you used to record these tests.

Error when deploying web application using TFS Release Managment

I am currently setting up TFS release management using vNext template at work and running into an error when I re-deploying the application. If I remove the application from the server, it deploys without any error.
After a bit of investigation, I have narrowed it down to the xWebApplication that is causing it but I am unable to fix the issue.
I have simplified my deployment script to just copy the file and creating web application:
Configuration AddressServiceWebsite
{
Import-DscResource -Module xWebAdministration
Import-DscResource -ModuleName xReleaseManagement
Node $AllNodes.NodeName
{
File CopyDeploymentBits
{
Ensure = "Present"
Type = "Directory"
Recurse = $true
SourcePath = $applicationPath
DestinationPath = $Node.DeploymentPath
}
xWebApplication WebApplication {
Website = $Node.WebsiteName
Name = $Node.ApplicationName
WebAppPool = $Node.ApplicationPool
PhysicalPath = $Node.DeploymentPath
Ensure = "Present"
}
}
}
AddressServiceWebsite -ConfigurationData $ConfigData -Verbose -Force
and am getting the following error:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> Microsoft.TeamFoundation.Release.Common.Helpers.OperationFailedException: Copying recursively from \\whds001\tfs\Builds\Direct\SOA\AddressService\PR000081 to C:\Windows\DtlDownloads\AddressService succeeded.
System.AggregateException: Failed to apply configuration in the DSC script to the computer. Consult the Logs below for details of the error.
Destination element already exists, please use "force" parameter to override.
CategoryInfo :InvalidArgument: (:) [], CimException
FullyQualifiedErrorId :Destination element already exists, please use "force" parameter to override.,Microsoft.IIs.PowerShell.Provider.NewWebApplicationCommand
The PowerShell provider MSFT_xWebApplication threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.
CategoryInfo :InvalidOperation: (:) [], CimException
FullyQualifiedErrorId :NonTerminatingErrorFromProvider
The SendConfigurationApply function did not succeed.
CategoryInfo :NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
FullyQualifiedErrorId :MI RESULT 1
---> Microsoft.Management.Infrastructure.CimException: Destination element already exists, please use "force" parameter to override.
--- End of inner exception stack trace ---
at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.PowershellExecutor.Invoke(String errorContextMessage, Boolean writeResultToLog, Boolean isCancellable)
at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Utilities.RetryExecutor.Execute(Action action)
at Microsoft.VisualStudio.Services.DevTestLabs.RemoteDeployer.Deployment.DeploymentService.RunPowerShellScripts(DeploymentMachineSpecification deploymentMachine, ScriptSpecification scriptSpecification, ScriptSpecification initializationScriptSpecification, String applicationPath, IPowerShell powerShellSession)
---> (Inner Exception #0) Microsoft.Management.Infrastructure.CimException: Destination element already exists, please use "force" parameter to override.<---
---> (Inner Exception #1) Microsoft.Management.Infrastructure.CimException: The PowerShell provider MSFT_xWebApplication threw one or more non-terminating errors while running the Set-TargetResource functionality. These errors are logged to the ETW channel called Microsoft-Windows-DSC/Operational. Refer to this channel for more details.<---
---> (Inner Exception #2) Microsoft.Management.Infrastructure.CimException: The SendConfigurationApply function did not succeed.
at Microsoft.Management.Infrastructure.Internal.Operations.CimAsyncObserverProxyBase`1.ProcessNativeCallback(OperationCallbackProcessingContext callbackProcessingContext, T currentItem, Boolean moreResults, MiResult operationResult, String errorMessage, InstanceHandle errorDetailsHandle)<---
Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
An LCM method call arrived from computer WHWA041 with user sid S-1-5-21-12480674-1100442233-928725530-45419.
[WHWA041]: LCM: [ Start Set ]
[WHWA041]: LCM: [ Start Resource ] [[File]CopyDeploymentBits]
[WHWA041]: LCM: [ Start Test ] [[File]CopyDeploymentBits]
[WHWA041]: [[File]CopyDeploymentBits] Building file list from cache.
[WHWA041]: LCM: [ End Test ] [[File]CopyDeploymentBits] in 0.0460 seconds.
[WHWA041]: LCM: [ Start Set ] [[File]CopyDeploymentBits]
[WHWA041]: [[File]CopyDeploymentBits] Building file list from cache.
[WHWA041]: [[File]CopyDeploymentBits] The destination object was found and no action is required.
[WHWA041]: LCM: [ End Set ] [[File]CopyDeploymentBits] in 0.0470 seconds.
[WHWA041]: LCM: [ End Resource ] [[File]CopyDeploymentBits]
[WHWA041]: LCM: [ Start Resource ] [[xWebApplication]WebApplication]
[WHWA041]: LCM: [ Start Test ] [[xWebApplication]WebApplication]
[WHWA041]: [[xWebApplication]WebApplication] Checking whether WebAdministration is there in the machine or not.
[WHWA041]: LCM: [ End Test ] [[xWebApplication]WebApplication] in 0.9980 seconds.
[WHWA041]: LCM: [ Start Set ] [[xWebApplication]WebApplication]
[WHWA041]: [[xWebApplication]WebApplication] Checking whether WebAdministration is there in the machine or not.
[WHWA041]: LCM: [ End Set ] [[xWebApplication]WebApplication] in 0.9990 seconds.
[WHWA041]: LCM: [ End Set ]
Operation 'Invoke CimMethod' complete.
Time taken for configuration job to complete is 2.292 seconds
at Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.ReadDeploymentResponse(DeploymentResponse response)
at Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.<RunPowerShellScript>d__9.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.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.<RunScript>d__0.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at Microsoft.TeamFoundation.Release.MonitorServices.Dsc.OnPrem.OnPremDeploymentActions.InvokePlatform(String activityId, MachineSpecification machineSpecification, StorageSpecification storageSpecification, String scriptPath, String configurationPath, Dictionary`2 configurationVariables)
at Microsoft.TeamFoundation.Release.MonitorServices.Dsc.OnPrem.OnPremDeploymentActions.RunScript(DscComponent dscComponentParameters, String serverName, String userName, String password, String componentName, String scriptPath, String configurationPath, String useCredSecuritySupportProvider, String useHttps, String skipCACheck)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.Dsc.DscComponentInstaller.InvokeMethodByReflection(String methodArguments)
You will not be able to deploy over the top with xWebApplication as It tries to create the same web application. You should delete the web application, even if you leave the files, before you try to deploy again.

Resources