Error Accessing NuGet from an Inline Task - visual-studio-2012

In Visual Studio 2012 I made an MsBuild inline task that works, until I uncomment a single line of code. When uncommented it fails with this message:
C:\Build\MyScript.targets(49,5): error MSB4018: The "MyCustomGetPath" task failed unexpectedly.
C:\Build\MyScript.targets(49,5): error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'NuGet, Version=2.7.40906.75, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
C:\Build\MyScript.targets(49,5): error MSB4018: File name: 'NuGet, Version=2.7.40906.75, Culture=neutral, PublicKeyToken=null'
C:\Build\MyScript.targets(49,5): error MSB4018: at InlineCode.GetNuGetRepositoryPath.Execute()
C:\Build\MyScript.targets(49,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
C:\Build\MyScript.targets(49,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
C:\Build\MyScript.targets(49,5): error MSB4018:
C:\Build\MyScript.targets(49,5): error MSB4018: === Pre-bind state information ===
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: User = Biz\baria2
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: DisplayName = NuGet, Version=2.7.40906.75, Culture=neutral, PublicKeyToken=null
C:\Build\MyScript.targets(49,5): error MSB4018: (Fully-specified)
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Appbase = file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Initial PrivatePath = NULL
C:\Build\MyScript.targets(49,5): error MSB4018: Calling assembly : (Unknown).
C:\Build\MyScript.targets(49,5): error MSB4018: ===
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: This bind starts in default load context.
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Using application configuration file: C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe.Config
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Using host configuration file:
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/NuGet.DLL.
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/NuGet/NuGet.DLL.
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/NuGet.EXE.
C:\Build\MyScript.targets(49,5): error MSB4018: LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/NuGet/NuGet.EXE.
C:\Build\MyScript.targets(49,5): error MSB4018:
Done Building Project "C:\Build\MyScript.targets" (default targets) -- FAILED.
The command I am executing is:
C:\Build\>msbuild MyScript.targets
Here is the inline task:
<UsingTask TaskName="MyCustomGetPath" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<config ParameterType="System.String" Required="true" />
<repositoryPath ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Reference Include="$(NuGetExePath)" />
<Using Namespace="NuGet" />
<Using Namespace="System.IO" />
<Code Type="Fragment" Language="cs">
<![CDATA[
ISettings settings = null;
string directoryName = Path.GetDirectoryName(Path.GetFullPath(config));
string fileName = null;
if (File.Exists(config))
{
fileName = Path.GetFileName(config);
}
//var temp = new NullLogger();
//MessageLevel msg = MessageLevel.Warning;
//PhysicalFileSystem physicalFileSystem = new PhysicalFileSystem(directoryName);
repositoryPath = directoryName;
]]>
</Code>
</Task>
</UsingTask>
Yes, this code is referencing the NuGet.exe (version 2.7 in this case). There are three commented lines above; uncommenting any one of them will cause the error. Overall I suspect this is fusion related. That reasonably makes sense, but then what are my options to fix this?
Update
This post seems to be the same problem.

Related

How could I handle the Err of TLS certificate with fabric-sdk-node

I'm trying to build a web front end of a fabric-network, and after I completed the registerAdmin and registerUser, I got err when I was tring to run my js code.
root#oyu-virtual-machine:~/hyperledger-fabric/test/webapp# node get.js
Load privateKey and signedCert
Get History
Assigning transaction_id: 35e9ed932366df66448d789fbf5989e6ba31be555f96eaca3197475a1602749c
E0429 15:09:28.130483373 4413 ssl_transport_security.cc:1245] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
returned from gethistory
Gethistory result count = 1
error from gethistory = Error: 14 UNAVAILABLE: failed to connect to all addresses
at Object.exports.createStatusError (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/common.js:91:15)
at Object.onReceiveStatus (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/client_interceptors.js:1209:28)
at InterceptingListener._callNext (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/client_interceptors.js:568:42)
at InterceptingListener.onReceiveStatus (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/client_interceptors.js:618:8)
at callback (/root/hyperledger-fabric/test/webapp/node_modules/fabric-client/node_modules/grpc/src/client_interceptors.js:847:24) {
code: 14,
metadata: Metadata { _internal_repr: {}, flags: 0 },
details: 'failed to connect to all addresses'
}
Response is Error: 14 UNAVAILABLE: failed to connect to all addresses
In my opinion, the most important message is
E0429 15:09:28.130483373 4413 ssl_transport_security.cc:1245] Handshake failed with fatal error SSL_ERROR_SSL: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed.
It's not generated by my code, but system generated it.
I do hope someone could help me. Thanks in advance.

Vs Test Failing with 3 errors on Azure Dev Ops Running nUnitTest

I'm using VsTest to run my nUnit test on azure dev ops and getting failures. This runs fine on my local machine but not in the Azure DevOps Release. Here is are errors i'm seeing from the log. Its not giving me much to go off of to track what could be wrong. I thought it might be something in my .runsettings file but this is the same file I use locally which is fine. There are to data collectors that is used by my runsettings file that uses code coverage and the video recorder. I dont know if this is what might be causing the test to fail. If i do want to use that and that might be whats causing is is there a way to download these dlls for the server to use or does these get automatically downloaded with vs tool installer?
Here is the current Task
Copy Files to: $(System.DefaultWorkingDirectory) - succeeds
Visual Studio Test Platform Installer - Installs VS 2017 - succeeds
VSTest - I choose test plan - - Fails
- select test platform to - Installed by Tools Installer
- I select path to my .runsettings file
- I give the override test run parameters
- I check Code coveraged enabled
here is the error i received
Unhandled exception : System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
TestExecution encountered unexpected failures System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
Error: The process 'E:\Agent_work_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 3762504530
2021-05-07T14:52:00.1569206Z QueryForTaskIntervalInMilliseconds: 3000
2021-05-07T14:52:00.1570380Z MaxQueryForTaskIntervalInMilliseconds: 10000
2021-05-07T14:52:00.1571576Z QueueNotFoundDelayTimeInMilliseconds: 3000
2021-05-07T14:52:00.1598093Z MaxQueueNotFoundDelayTimeInMilliseconds: 50000
2021-05-07T14:52:00.1606607Z ===========================================
2021-05-07T14:52:01.2928251Z Result Attachments will be stored in LogStore
2021-05-07T14:52:01.3427529Z Run Attachments will be stored in LogStore
2021-05-07T14:52:01.8892467Z TestExecutionHost.Execute: Registered TestAgent : 798 : VS2VST05-VS2VST05i-41
2021-05-07T14:52:01.9062609Z Provided settings file:
2021-05-07T14:52:01.9079246Z <?xml version="1.0" encoding="utf-8"?>
2021-05-07T14:52:01.9079831Z <RunSettings>
2021-05-07T14:52:01.9080157Z <!-- Configurations that affect the Test Framework -->
2021-05-07T14:52:01.9084373Z <RunConfiguration>
2021-05-07T14:52:01.9084552Z <MaxCpuCount>1</MaxCpuCount>
2021-05-07T14:52:01.9084824Z <!-- Path relative to directory that contains .runsettings file-->
2021-05-07T14:52:01.9085105Z <ResultsDirectory>.\TestResults</ResultsDirectory>
2021-05-07T14:52:01.9085266Z
2021-05-07T14:52:01.9085400Z <!-- x86 or x64 -->
2021-05-07T14:52:01.9085703Z <!-- You can also change it from the Test menu; choose "Processor Architecture for AnyCPU Projects" -->
2021-05-07T14:52:01.9086015Z <TargetPlatform>x86</TargetPlatform>
2021-05-07T14:52:01.9086158Z
2021-05-07T14:52:01.9086337Z <!-- Framework35 | [Framework40] | Framework45 -->
2021-05-07T14:52:01.9086627Z <TargetFrameworkVersion>Framework45</TargetFrameworkVersion>
2021-05-07T14:52:01.9087680Z
2021-05-07T14:52:01.9087850Z <!-- Path to Test Adapters -->
2021-05-07T14:52:01.9088095Z <TestAdaptersPaths>%SystemDrive%\Temp\foo;</TestAdaptersPaths>
2021-05-07T14:52:01.9088519Z <!-- TestSessionTimeout was introduced in Visual Studio 2017 version 15.5 -->
2021-05-07T14:52:01.9088858Z <!-- Specify timeout in milliseconds. A valid value should be greater than 0 -->
2021-05-07T14:52:01.9089157Z <TestSessionTimeout>15000000</TestSessionTimeout>
2021-05-07T14:52:01.9089420Z <TreatNoTestsAsError>true</TreatNoTestsAsError>
2021-05-07T14:52:01.9089626Z </RunConfiguration>
2021-05-07T14:52:01.9089822Z <!-- Configurations for data collectors -->
2021-05-07T14:52:01.9090027Z <DataCollectionRunSettings>
2021-05-07T14:52:01.9090210Z <DataCollectors>
2021-05-07T14:52:01.9090804Z <DataCollector friendlyName="Code Coverage" uri="datacollector://Microsoft/CodeCoverage/2.0" assemblyQualifiedName="Microsoft.VisualStudio.Coverage.DynamicCoverageDataCollector, Microsoft.VisualStudio.TraceCollector, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
2021-05-07T14:52:01.9091620Z <Configuration>
2021-05-07T14:52:01.9092022Z <CodeCoverage>
2021-05-07T14:52:01.9092187Z <ModulePaths>
2021-05-07T14:52:01.9092348Z <Exclude>
2021-05-07T14:52:01.9092562Z <ModulePath>.*CPPUnitTestFramework.*</ModulePath>
2021-05-07T14:52:01.9092794Z </Exclude>
2021-05-07T14:52:01.9092955Z </ModulePaths>
2021-05-07T14:52:01.9093227Z <!-- We recommend you do not change the following values: -->
2021-05-07T14:52:01.9093579Z <UseVerifiableInstrumentation>True</UseVerifiableInstrumentation>
2021-05-07T14:52:01.9093914Z <AllowLowIntegrityProcesses>True</AllowLowIntegrityProcesses>
2021-05-07T14:52:01.9094217Z <CollectFromChildProcesses>True</CollectFromChildProcesses>
2021-05-07T14:52:01.9094530Z <CollectAspDotNet>False</CollectAspDotNet>
2021-05-07T14:52:01.9094757Z </CodeCoverage>
2021-05-07T14:52:01.9094927Z </Configuration>
2021-05-07T14:52:01.9095114Z </DataCollector>
2021-05-07T14:52:01.9095793Z <DataCollector uri="datacollector://microsoft/VideoRecorder/1.0" assemblyQualifiedName="Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder.VideoRecorderDataCollector, Microsoft.VisualStudio.TestTools.DataCollection.VideoRecorder, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" friendlyName="Screen and Voice Recorder">
2021-05-07T14:52:01.9096694Z <!--Video data collector was introduced in Visual Studio 2017 version 15.5 -->
2021-05-07T14:52:01.9096989Z <Configuration>
2021-05-07T14:52:01.9097297Z <!-- Set "sendRecordedMediaForPassedTestCase" to "false" to add video attachments to failed tests only -->
2021-05-07T14:52:01.9097917Z <MediaRecorder sendRecordedMediaForPassedTestCase="false" xmlns=""> ​
2021-05-07T14:52:01.9098305Z <ScreenCaptureVideo bitRate="512" frameRate="2" quality="20" />​
2021-05-07T14:52:01.9098560Z </MediaRecorder>​
2021-05-07T14:52:01.9100157Z </Configuration>
2021-05-07T14:52:01.9100322Z </DataCollector>
2021-05-07T14:52:01.9100532Z <DataCollector friendlyName="blame" enabled="True">
2021-05-07T14:52:01.9100746Z </DataCollector>
2021-05-07T14:52:01.9100925Z </DataCollectors>
2021-05-07T14:52:01.9101487Z </DataCollectionRunSettings>
2021-05-07T14:52:01.9101720Z <!-- Parameters used by tests at run time -->
2021-05-07T14:52:01.9101885Z
2021-05-07T14:52:01.9102041Z <!-- MSTest adapter -->
2021-05-07T14:52:01.9102188Z <NUnit>
2021-05-07T14:52:01.9102371Z <InternalTraceLevel>Error</InternalTraceLevel>
2021-05-07T14:52:01.9102554Z </NUnit>
2021-05-07T14:52:01.9102666Z
2021-05-07T14:52:01.9102782Z </RunSettings>
2021-05-07T14:52:01.9393681Z Overriding UseVerifiableInstrumentation field to false in the runsettings file.
2021-05-07T14:52:01.9550200Z IsValidServiceResponse: Received None command..Service Workflow is not active
2021-05-07T14:52:02.0476240Z ##[error]Unhandled exception : System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.0485692Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.0486290Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.0486843Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.0487361Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.0487776Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.0488008Z at System.Threading.Tasks.Task.Execute()
2021-05-07T14:52:02.0488240Z --- End of inner exception stack trace ---
2021-05-07T14:52:02.0488490Z at System.AggregateException.Handle(Func`2 predicate)
2021-05-07T14:52:02.0488905Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.ExecuteCurrentPhase(CancellationToken cancellationToken)
2021-05-07T14:52:02.0489423Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Execute(CancellationToken cancellationToken)
2021-05-07T14:52:02.0489864Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Start()
2021-05-07T14:52:02.0490324Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.InitializeAndStartExecutionHost(Boolean debugLogs)
2021-05-07T14:52:02.0490784Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.Execute(Boolean debugLogs)
2021-05-07T14:52:02.0491382Z ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.0491868Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.0492404Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.0492953Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.0493484Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.0493867Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.0494108Z at System.Threading.Tasks.Task.Execute()<---
2021-05-07T14:52:02.0494260Z
2021-05-07T14:52:02.1579135Z ##[error]TestExecution encountered unexpected failures System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.1581938Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.1583067Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.1584187Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.1585236Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.1587079Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.1587869Z at System.Threading.Tasks.Task.Execute()
2021-05-07T14:52:02.1588636Z --- End of inner exception stack trace ---
2021-05-07T14:52:02.1589413Z at System.AggregateException.Handle(Func`2 predicate)
2021-05-07T14:52:02.1590350Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.ExecuteCurrentPhase(CancellationToken cancellationToken)
2021-05-07T14:52:02.1591492Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Execute(CancellationToken cancellationToken)
2021-05-07T14:52:02.1591974Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Start()
2021-05-07T14:52:02.1593219Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.InitializeAndStartExecutionHost(Boolean debugLogs)
2021-05-07T14:52:02.1594214Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.Execute(Boolean debugLogs)
2021-05-07T14:52:02.1595156Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.Program.Main(String[] args)
2021-05-07T14:52:02.1596244Z ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.1597231Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.1597806Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.1607075Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.1608570Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.1609155Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.1610029Z at System.Threading.Tasks.Task.Execute()<---
2021-05-07T14:52:02.1610221Z
2021-05-07T14:52:02.1612560Z
2021-05-07T14:52:02.1613028Z Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
2021-05-07T14:52:02.1614180Z at Microsoft.VisualStudio.TestService.SettingsManager.DiagnosticsSettingsProcessor.ProcessSettings(XDocument settings)
2021-05-07T14:52:02.1614742Z at Microsoft.VisualStudio.TestService.SettingsManager.CommonSettingsManager.UpdateCommonSettings(InputDataContract inputDataContract, SettingsModifier settingsModifier)
2021-05-07T14:52:02.1620575Z at Microsoft.VisualStudio.TestService.SettingsManager.SettingsManager.UpdateSettingsAsRequired(InputDataContract inputDataContract)
2021-05-07T14:52:02.1621740Z at Microsoft.VisualStudio.TestService.VstestAdapter.SetupPhase.Run(ExecutionStateContext stateModelContext, CancellationToken cancellationToken)
2021-05-07T14:52:02.1622351Z at System.Threading.Tasks.Task`1.InnerInvoke()
2021-05-07T14:52:02.1625627Z at System.Threading.Tasks.Task.Execute()
2021-05-07T14:52:02.1626144Z --- End of inner exception stack trace ---
2021-05-07T14:52:02.1626519Z at System.AggregateException.Handle(Func`2 predicate)
2021-05-07T14:52:02.1627028Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.ExecuteCurrentPhase(CancellationToken cancellationToken)
2021-05-07T14:52:02.1627670Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Execute(CancellationToken cancellationToken)
2021-05-07T14:52:02.1629545Z at Microsoft.VisualStudio.TestService.ExecutionStateModel.DistributedTestExecutionAgent.Start()
2021-05-07T14:52:02.1630375Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.InitializeAndStartExecutionHost(Boolean debugLogs)
2021-05-07T14:52:02.1631959Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.DistributedTestRunHost.Execute(Boolean debugLogs)
2021-05-07T14:52:02.1632811Z at Microsoft.VisualStudio.TestService.AgentExecutionHost.Program.Main(String[] args)
2021-05-07T14:52:02.1866126Z ##[error]Error: The process 'E:\Agent\_work\_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 3762504530
2021-05-07T14:52:02.1874141Z ##[section]Finishing: VsTest - testPlan
Here is the Yaml file
steps:
task: CopyFiles#2
displayName: 'Copy Files to: $(System.DefaultWorkingDirectory)'
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)/_Atlas Automation (Agile) CI 2020/drop/Atlas_Automation_Test/Atlas_Automation_Test/bin/Release'
Contents: |
*.testsettings
*.runsettings
TargetFolder: '$(System.DefaultWorkingDirectory)'
CleanTargetFolder: true
OverWrite: true
flattenFolders: true

Powershell Set-AzDataLakeStoreItemAclEntry Error occured while sending the request

Trying to execute the following command in Powershell ISE
Set-AzDataLakeStoreItemAclEntry -Account "********" -Path "/raw2" -AceType Group -Id "******************" -Permissions All
I only have the Az module installed, no Rm
But I get the following error, any suggestions?
Set-AzDataLakeStoreItemAclEntry : Error in modifying ACL entries group:************:rwx for path /raw2.
Operation: MODIFYACLENTRIES failed with Unknown Error: An error occurred while sending the request. Source: mscorlib StackTrace: at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.DataLake.Store.WebTransport.<MakeSingleCallAsync>d__20.MoveNext().
.
Last encountered exception thrown after 5 tries. [An error occurred while sending the request.,An error occurred while sending the request.,An error occurred while sending the request.,An
error occurred while sending the request.,An error occurred while sending the request.]
[ServerRequestId:]
At line:1 char:1
+ Set-AzDataLakeStoreItemAclEntry -Account "**********" -Path "/raw2 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzDataLakeStoreItemAclEntry], AdlsException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.DataLakeStore.SetAzureDataLakeStoreItemAclEntry

log channel errors multiple stacktrace

Trying to log channel error and using a retry policy, i log two exception stacktrace instead of only one.
Channel configuration :
<bean id="retryInterceptor" class="org.springframework.amqp.rabbit.config.StatelessRetryOperationsInterceptorFactoryBean">
<property name="messageRecoverer" ref="rejectAndDontRequeueRecoverer"/>
<property name="retryOperations" ref="retryTemplate" />
</bean>
<bean id="rejectAndDontRequeueRecoverer" class="org.springframework.amqp.rabbit.retry.RejectAndDontRequeueRecoverer"/>
<!-- Configuration du retry -->
<bean id="retryTemplate" class="org.springframework.retry.support.RetryTemplate">
<property name="backOffPolicy">
<bean class="org.springframework.retry.backoff.ExponentialBackOffPolicy">
<!-- Intervalle de temps en millisecondes entre deux tentatives -->
<property name="initialInterval" value="2000" />
</bean>
</property>
<property name="retryPolicy">
<bean class="org.springframework.retry.policy.SimpleRetryPolicy">
<!-- Nombre de retry max -->
<property name="maxAttempts" value="3" />
</bean>
</property>
</bean>
<bean id="log" class="com.logger.Logger"/>
<!-- Logger -->
<int:channel id="one" ></int:channel>
<int:channel id="error1" ></int:channel>
<int:publish-subscribe-channel id="processChannel1" />
<int:logging-channel-adapter channel="processChannel1" logger-name="log1" level="ERROR" expression="payload.message"/>
<int:service-activator input-channel="processChannel1" ref="log" output-channel="error1" />
<!-- Source -->
<rabbit:connection-factory id="connectionFactory" username="guest" password="guest" addresses="XX.XX.XX.XX:5672" cache-mode="CONNECTION" virtual-host="/" />
<int-amqp:inbound-channel-adapter channel="one" id="inboundChannelAdapter1" queue-names="myqueue" connection-factory="connectionFactory" error-channel="processChannel1" channel-transacted="true" advice-chain="retryInterceptor" />
<!-- Destination -->
<rabbit:connection-factory id="connectionFactoryRmqDest" username="guest" password="guest111" addresses="YY.YY.YY.YY:5672" cache-mode="CONNECTION" connection-cache-size="50" virtual-host="/" />
<rabbit:template id="rabbitTemplateRmqDest" connection-factory="connectionFactoryRmqDest" />
<int-amqp:outbound-channel-adapter channel="one" id="outboundChannelAdapter1" routing-key="keyMyQueue" exchange-name="direct.exchange" amqp-template="rabbitTemplateRmqDest" default-delivery-mode="PERSISTENT"/>
Logger.java
package com.logger;
public class Logger {
public Message<?> log(Message<?> message) {
System.out.println("*************************************");
throw new AmqpException("Error on channel");
}
}
Log file :
2018-03-12 16:34:43.008 [(inner bean)#160e9f2e-1] ERROR log1 - error occurred in message handler [org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0]; nested exception is org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
2018-03-12 16:34:43.021 [(inner bean)#160e9f2e-1] ERROR log1 - Message conversion failed
2018-03-12 16:34:45.181 [(inner bean)#160e9f2e-1] ERROR log1 - error occurred in message handler [org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0]; nested exception is org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
2018-03-12 16:34:45.182 [(inner bean)#160e9f2e-1] ERROR log1 - Message conversion failed
2018-03-12 16:34:49.345 [(inner bean)#160e9f2e-1] ERROR log1 - error occurred in message handler [org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0]; nested exception is org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
2018-03-12 16:34:49.346 [(inner bean)#160e9f2e-1] ERROR log1 - Message conversion failed
Removing the expression attributes, stack traces are (just one attempt on the 3 retries):
2018-03-12 17:24:03.303 [(inner bean)#76e1e924-1] ERROR log1 - org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0]; nested exception is org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile., failedMessage=GenericMessage [payload=byte[20], headers={timestamp=1520871843104, id=7c9f713f-90a1-2720-60e4-a0e33ef98ecb, amqp_receivedRoutingKey=myqueue, amqp_consumerQueue=myqueue, amqp_consumerTag=amq.ctag-ENdQ-j6xD1LRXDxGr_iJuQ, amqp_receivedDeliveryMode=NON_PERSISTENT, amqp_redelivered=false, amqp_deliveryTag=1}]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:139)
at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:148)
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:121)
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:89)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:425)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:375)
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105)
at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:188)
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.access$1100(AmqpInboundChannelAdapter.java:56)
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.processMessage(AmqpInboundChannelAdapter.java:246)
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.onMessage(AmqpInboundChannelAdapter.java:203)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:848)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:771)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:102)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:198)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:74)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:276)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:172)
at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy9.invokeListener(Unknown Source)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1311)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:752)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1254)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1224)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1600(SimpleMessageListenerContainer.java:102)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1470)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
at org.springframework.amqp.rabbit.support.RabbitExceptionTranslator.convertRabbitAccessException(RabbitExceptionTranslator.java:65)
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:368)
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory.createConnection(CachingConnectionFactory.java:603)
at org.springframework.amqp.rabbit.core.RabbitTemplate.doExecute(RabbitTemplate.java:1430)
at org.springframework.amqp.rabbit.core.RabbitTemplate.execute(RabbitTemplate.java:1411)
at org.springframework.amqp.rabbit.core.RabbitTemplate.send(RabbitTemplate.java:712)
at org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint.send(AmqpOutboundEndpoint.java:134)
at org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint.handleRequestMessage(AmqpOutboundEndpoint.java:122)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:109)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127)
... 38 more
Caused by: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile.
at com.rabbitmq.client.impl.AMQConnection.start(AMQConnection.java:342)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:909)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:859)
at com.rabbitmq.client.ConnectionFactory.newConnection(ConnectionFactory.java:799)
at org.springframework.amqp.rabbit.connection.AbstractConnectionFactory.createBareConnection(AbstractConnectionFactory.java:352)
... 46 more
2018-03-12 17:24:03.314 [(inner bean)#76e1e924-1] ERROR log1 - org.springframework.amqp.rabbit.listener.exception.ListenerExecutionFailedException: Message conversion failed
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.onMessage(AmqpInboundChannelAdapter.java:223)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:848)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:771)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$001(SimpleMessageListenerContainer.java:102)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$1.invokeListener(SimpleMessageListenerContainer.java:198)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
at org.springframework.retry.interceptor.RetryOperationsInterceptor$1.doWithRetry(RetryOperationsInterceptor.java:74)
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:276)
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:172)
at org.springframework.retry.interceptor.RetryOperationsInterceptor.invoke(RetryOperationsInterceptor.java:98)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
at com.sun.proxy.$Proxy9.invokeListener(Unknown Source)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.invokeListener(SimpleMessageListenerContainer.java:1311)
at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.executeListener(AbstractMessageListenerContainer.java:752)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doReceiveAndExecute(SimpleMessageListenerContainer.java:1254)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.receiveAndExecute(SimpleMessageListenerContainer.java:1224)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.access$1600(SimpleMessageListenerContainer.java:102)
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1470)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.messaging.MessageHandlingException: nested exception is org.springframework.amqp.AmqpException: Erreur sur le channel, failedMessage=EnhancedErrorMessage [payload=org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.integration.amqp.outbound.AmqpOutboundEndpoint#0]; nested exception is org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN. For details see the broker logfile., failedMessage=GenericMessage [payload=byte[20], headers={timestamp=1520871843104, id=7c9f713f-90a1-2720-60e4-a0e33ef98ecb, amqp_receivedRoutingKey=myqueue, amqp_consumerQueue=myqueue, amqp_consumerTag=amq.ctag-ENdQ-j6xD1LRXDxGr_iJuQ, amqp_receivedDeliveryMode=NON_PERSISTENT, amqp_redelivered=false, amqp_deliveryTag=1}], headers={timestamp=1520871843291, id=dbde6a9f-3c26-086f-53a1-7c98482efcce, amqp_raw_message=(Body:'[B#56360d58(byte[20])' MessageProperties [headers={}, timestamp=null, messageId=null, userId=null, receivedUserId=null, appId=null, clusterId=null, type=null, correlationId=null, correlationIdString=null, replyTo=null, contentType=null, contentEncoding=null, contentLength=0, deliveryMode=null, receivedDeliveryMode=NON_PERSISTENT, expiration=null, priority=null, redelivered=false, receivedExchange=, receivedRoutingKey=myqueue, receivedDelay=null, deliveryTag=1, messageCount=0, consumerTag=amq.ctag-ENdQ-j6xD1LRXDxGr_iJuQ, consumerQueue=myqueue])}] for original GenericMessage [payload=byte[20], headers={timestamp=1520871843104, id=7c9f713f-90a1-2720-60e4-a0e33ef98ecb, amqp_receivedRoutingKey=myqueue, amqp_consumerQueue=myqueue, amqp_consumerTag=amq.ctag-ENdQ-j6xD1LRXDxGr_iJuQ, amqp_receivedDeliveryMode=NON_PERSISTENT, amqp_redelivered=false, amqp_deliveryTag=1}]
at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:96)
at org.springframework.integration.handler.ServiceActivatingHandler.handleRequestMessage(ServiceActivatingHandler.java:89)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:109)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127)
at org.springframework.integration.dispatcher.BroadcastingDispatcher.invokeHandler(BroadcastingDispatcher.java:236)
at org.springframework.integration.dispatcher.BroadcastingDispatcher.dispatch(BroadcastingDispatcher.java:185)
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:89)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:425)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:375)
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105)
at org.springframework.integration.endpoint.MessageProducerSupport.sendErrorMessageIfNecessary(MessageProducerSupport.java:207)
at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:191)
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.access$1100(AmqpInboundChannelAdapter.java:56)
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.processMessage(AmqpInboundChannelAdapter.java:246)
at org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter$Listener.onMessage(AmqpInboundChannelAdapter.java:203)
... 25 more
Caused by: org.springframework.amqp.AmqpException: Erreur sur le channel
at com.logger.Logger.log(Logger.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:117)
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:129)
at org.springframework.expression.spel.ast.MethodReference.access$000(MethodReference.java:49)
at org.springframework.expression.spel.ast.MethodReference$MethodValueRef.getValue(MethodReference.java:347)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:88)
at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:132)
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:360)
at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:169)
at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:319)
at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:155)
at org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:93)
... 41 more
In the log file i have 3 attemps for transfer the message. => Retry is ok
I would like to have only one stacktrace? What the mean of the "Message conversion failed"? How can i prevent it?
Is there a way to test if the cause of an exception is empty or null? I would like to use "payload.cause.message" in the expression?
Thanks for your help,
Regards
Eric
The first log message comes from the <int:logging-channel-adapter> just because you use an error-channel="processChannel1" on the <int-amqp:outbound-channel-adapter>.
The second one comes from the AbstractMessageListenerContainer because your Logger doesn't log message, but does exactly this:
throw new AmqpException("Error on channel");
So, when we do in the AmqpInboundChannelAdapter.Listener this:
getMessagingTemplate().send(getErrorChannel(), buildErrorMessage(null,
new ListenerExecutionFailedException("Message conversion failed", e, message)));
Send error message to the error channel, you just re-throw an exception from the to the top-level AMQP listener and that one logs it one more time.
You should consider do not re-throw an exception from your Logger component, or don't use use one more <int:logging-channel-adapter> subscriber, or just don't use error-channel approach at all!
For the payload.cause.message expression you should use a SpEL ternary operator : payload.cause != null ? payload.cause.message : payload.message
UPDATE
OK. I see what's going on.
We send an exception to the errorChannel during MessageProducerSupport.sendMessage() process:
try {
this.messagingTemplate.send(getOutputChannel(), message);
}
catch (RuntimeException e) {
if (!sendErrorMessageIfNecessary(message, e)) {
throw e;
}
}
And since you have one more subscriber to throw a fresh exception (or just re-throw), that sendErrorMessageIfNecessary() finishes with a bubbled exception.
This one come to the catch (RuntimeException e) { of the AmqpInboundChannelAdapter.Listener.onMessage() like mentioned before. And a new ErrorMessage is sent to the errorChannel. That's how you see that one more logged message. But since the second subscriber re-throws an exception, that's how it comes back to the listener container and initiate retries. And that's how you see a stack trace only once, after all the retry attempts. However I can guess that it is already a wrong stack trace, because you would like to see the real reason of the sending to the AMQP problem.
What I suggest here for you as a solution is like this:
No error-channel on the <int-amqp:inbound-channel-adapter>
No second subscriber to the processChannel1 - the existing <int:logging-channel-adapter> is enough.
You configure ExpressionEvaluatingRequestHandlerAdvice with the failureChannel to the processChannel1 and onFailureExpression to the #this
Use this ExpressionEvaluatingRequestHandlerAdvice as a <request-handler-advice-chain> reference for the <int-amqp:outbound-channel-adapter>
This way you'll get logs on each retry and according the trapException = false, a real exception will be re-thrown to the listener cotnainer for retry.

Azure: Failed to send bytes to XContainer wad-tracefiles

For some reason I get errors while using Diagnostics in Azure. The code of my (WCF) WebRole is:
public override bool OnStart()
{
// To enable the AzureLocalStorageTraceListner, uncomment relevent section in the web.config
DiagnosticMonitorConfiguration diagnosticConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
diagnosticConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
diagnosticConfig.Directories.BufferQuotaInMB = 256;
// Start diagnostics
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfig);
// Write trace line
Trace.WriteLine("CUSTUM TRACE MESSAGE");
// Start instance
return base.OnStart();
}
My Web.config file looks like this:
<?xml version="1.0"?>
<configuration>
<configSections>
</configSections>
<system.diagnostics>
<sharedListeners>
<add name="AzureLocalStorage" type="WCFServiceWebRole1.AzureLocalStorageTraceListener, WCFServiceWebRole1"/>
</sharedListeners>
<sources>
<source name="System.ServiceModel" switchValue="Verbose, ActivityTracing">
<listeners>
<add name="AzureLocalStorage"/>
</listeners>
</source>
<source name="System.ServiceModel.MessageLogging" switchValue="Verbose">
<listeners>
<add name="AzureLocalStorage"/>
</listeners>
</source>
</sources>
<trace autoflush="true">
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
</system.diagnostics>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
In the Compute Emulator I see the following error:
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[MonAgentHost] Error: MA EVENT: 2012-06-06T10:01:20.111Z
[MonAgentHost] Error: 2
[MonAgentHost] Error: 6396
[MonAgentHost] Error: 6624
[MonAgentHost] Error: NetTransport
[MonAgentHost] Error: 0
[MonAgentHost] Error: x:\btsdx\215\services\monitoring\shared\nettransport\src\xblobconnection.cpp
[MonAgentHost] Error: XBlobConnection::PutBytesXBlob
[MonAgentHost] Error: 1621
[MonAgentHost] Error: ffffffff80050023
[MonAgentHost] Error: 0
[MonAgentHost] Error:
[MonAgentHost] Error: Failed to send bytes to XContainer wad-tracefiles
This error repeats several times. The "wad-tracefiles" container is added by the following code in the AzureLocalStorageTraceListener class:
public static DirectoryConfiguration GetLogDirectory()
{
DirectoryConfiguration directory = new DirectoryConfiguration();
directory.Container = "wad-tracefiles";
directory.DirectoryQuotaInMB = 10;
directory.Path = RoleEnvironment.GetLocalResource("WCFServiceWebRole1.svclog").RootPath;
return directory;
}
Why does writing trace messages fails in this scenario? When I look in my Storage with the Azure Storage Explorer the only table I see is the WADDirectoriesTable and not the the WADLogsTable. The "wad-tracefiles" blob does get created but that is not the place where I should find the Trace messages from my code.
Anyone, any idea? Any help is appreciated!
Your first problem is that you haven't used SetCurrentConfiguration() with your GetDefaultInitialConfiguration() to finally save the transfer time and log level. You must use the set of these API as below:
GetDefaultInitialConfiguration()
SetCurrentConfiguration()
OR
GetCurrentConfiguration()
SetCurrentConfiguration()
Because of it the following line based configuration will not be saved in Diagnostics configuration:
diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
Use above suggestion and then see what happens.
I would also suggest to just create a very simple web or worker role hello world sample and add general TRACE Message by enabling Azure Diagnostics to see if that give you any error. This will prove if you have any issue with your SDK installation or Azure Storage Emulator or not as well.
Thank you for your reply! The project I am using is a really simple WebRole with only one trace message so I can not strip any code out.
I tried your suggestion and you are right, I do not get any error messages anymore with the following code:
public override bool OnStart()
{
setDiagnostics();
Trace.WriteLine("CUSTUM TRACE MESSAGE");
// Start instance
return base.OnStart();
}
private void setDiagnostics()
{
// Get diagnostics connectionstring
string wadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(wadConnectionString));
// Get the diagnostics configuration of the deployment and its role instances that are currently running
DeploymentDiagnosticManager deploymentDiagnosticManager = new DeploymentDiagnosticManager(cloudStorageAccount, RoleEnvironment.DeploymentId);
RoleInstanceDiagnosticManager roleInstanceDiagnosticManager = cloudStorageAccount.CreateRoleInstanceDiagnosticManager(
RoleEnvironment.DeploymentId,
RoleEnvironment.CurrentRoleInstance.Role.Name,
RoleEnvironment.CurrentRoleInstance.Id);
// Load diagnostics configuration
DiagnosticMonitorConfiguration diagConfig = roleInstanceDiagnosticManager.GetCurrentConfiguration();
// Get the default value if there is no config yet
if (diagConfig == null)
diagConfig = DiagnosticMonitor.GetDefaultInitialConfiguration();
// Enable EventLogs
diagConfig.WindowsEventLog.DataSources.Add("Application!*");
diagConfig.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1D);
diagConfig.WindowsEventLog.BufferQuotaInMB = 128;
// Failed Request Logs
diagConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());
diagConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1D);
diagConfig.Directories.BufferQuotaInMB = 128;
// Crash Dumps
CrashDumps.EnableCollection(true);
// Set new configuration
roleInstanceDiagnosticManager.SetCurrentConfiguration(diagConfig);
// Start the DiagnosticMonitor
DiagnosticMonitor.Start(wadConnectionString, diagConfig);
}
When I look in which tables are present in the Azure Storage Explorer I only see the "WADDirectoriesTable" and the "WADWindowsEventLogsTable". Trace messages should come in the "WADLogsTable" right? So I see the Trace message in the Compute Emulator but I do not see them in my storage... any ideas why?

Resources