How to avoid Cache restore time outs - caching

I do a cache of the maven repository using Cache#2 to prevent additional downloads especially since Maven Central may yield zero byte files.
However, I am getting events such as this on my build log and when it occurs it significantly slows down the build step.
2020-02-14T03:24:14.9261543Z Information, Downloaded 340.2 MB out of 447.6 MB (76%).
2020-02-14T03:24:18.3130567Z Warning, [https://37bvsblobprodcus311.blob.core.windows.net/db184fb09aee8f4ae39869ebeab81ab1ad/7FE2B04FAB9DCB08C78F137CCA2FDA2D5E37B05B5DBCA1D7EDD23F7DB5D580B301?sv=2017-04-17&sr=b&sig=mZZ1kK00Gc2cg5m6dyRB3XUYVB40dxJkvBMbXW4D3cM%3D&spr=https&se=2020-02-15T03%3A29%3A57Z&sp=r&rscl=x-e2eid-c561122c-76784a8c-be2cb59f-c79091dc-session-eacd1913-b0014305-a33f0081-46cabc28] Try 1/5, non-retryable exception caught. Throwing. Details:
2020-02-14T03:24:18.3131821Z Task was requested to be canceled. System.Threading.Tasks.TaskCanceledException: A task was canceled.
2020-02-14T03:24:18.3132112Z at System.IO.Stream.CopyToAsyncInternal(Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
2020-02-14T03:24:18.3132355Z at System.Net.Http.NoWriteNoSeekStreamContent.<>c.<SerializeToStreamAsync>b__4_0(Task t, Object s)
2020-02-14T03:24:18.3132630Z at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
2020-02-14T03:24:18.3133177Z --- End of stack trace from previous location where exception was thrown ---
2020-02-14T03:24:18.3133445Z at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
2020-02-14T03:24:18.3133903Z --- End of stack trace from previous location where exception was thrown ---
2020-02-14T03:24:18.3134179Z at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
2020-02-14T03:24:18.3134413Z at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
2020-02-14T03:24:18.3134691Z at Microsoft.VisualStudio.Services.Common.TaskCancellationExtensions.EnforceCancellation[TResult](Task`1 task, CancellationToken cancellationToken, Func`1 makeMessage, String file, String member, Int32 line)
2020-02-14T03:24:18.3134970Z at Microsoft.VisualStudio.Services.BlobStore.WebApi.DedupStoreHttpClient.<>c__DisplayClass57_0.<<GetRedirectResponseAsync>b__0>d.MoveNext()
2020-02-14T03:24:18.3135439Z --- End of stack trace from previous location where exception was thrown ---
2020-02-14T03:24:18.3135708Z at Microsoft.VisualStudio.Services.Content.Common.AsyncHttpRetryHelper`1.InvokeAsync(CancellationToken cancellationToken)
2020-02-14T03:24:18.3150625Z Warning, [https://37bvsblobprodcus311.blob.core.windows.net/db184fb09aee8f4ae39869ebeab81ab1ad/7FE2B04FAB9DCB08C78F137CCA2FDA2D5E37B05B5DBCA1D7EDD23F7DB5D580B301?sv=2017-04-17&sr=b&sig=mZZ1kK00Gc2cg5m6dyRB3XUYVB40dxJkvBMbXW4D3cM%3D&spr=https&se=2020-02-15T03%3A29%3A57Z&sp=r&rscl=x-e2eid-c561122c-76784a8c-be2cb59f-c79091dc-session-eacd1913-b0014305-a33f0081-46cabc28] Try 1/5, retryable exception caught. Retrying in 00:00:01. System.Threading.Tasks.TaskCanceledException: A task was canceled.
2020-02-14T03:24:18.3151412Z at System.IO.Stream.CopyToAsyncInternal(Stream destination, Int32 bufferSize, CancellationToken cancellationToken)
2020-02-14T03:24:18.3151697Z at System.Net.Http.NoWriteNoSeekStreamContent.<>c.<SerializeToStreamAsync>b__4_0(Task t, Object s)
2020-02-14T03:24:18.3151962Z at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
2020-02-14T03:24:18.3152497Z --- End of stack trace from previous location where exception was thrown ---
2020-02-14T03:24:18.3152771Z at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
2020-02-14T03:24:18.3153248Z --- End of stack trace from previous location where exception was thrown ---
2020-02-14T03:24:18.3153496Z at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
2020-02-14T03:24:18.3153749Z at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
2020-02-14T03:24:18.3154100Z at Microsoft.VisualStudio.Services.Common.TaskCancellationExtensions.EnforceCancellation[TResult](Task`1 task, CancellationToken cancellationToken, Func`1 makeMessage, String file, String member, Int32 line)
2020-02-14T03:24:18.3154606Z at Microsoft.VisualStudio.Services.BlobStore.WebApi.DedupStoreHttpClient.<>c__DisplayClass57_0.<<GetRedirectResponseAsync>b__0>d.MoveNext()
2020-02-14T03:24:18.3155603Z --- End of stack trace from previous location where exception was thrown ---
2020-02-14T03:24:18.3155739Z at Microsoft.VisualStudio.Services.Content.Common.AsyncHttpRetryHelper`1.InvokeAsync(CancellationToken cancellationToken)
2020-02-14T03:24:18.3155929Z at Microsoft.VisualStudio.Services.BlobStore.WebApi.DedupStoreHttpClient.<>c__DisplayClass60_0.<<HandleRedirectAsync>b__0>d.MoveNext()
2020-02-14T03:24:18.3159451Z --- End of stack trace from previous location where exception was thrown ---
2020-02-14T03:24:18.3159789Z at Microsoft.VisualStudio.Services.Content.Common.AsyncHttpRetryHelper`1.InvokeAsync(CancellationToken cancellationToken)
2020-02-14T03:24:19.9319176Z Information, Downloaded 340.2 MB out of 447.6 MB (76%).
2020-02-14T03:24:24.9323050Z Information, Downloaded 352.6 MB out of 447.6 MB (79%).
Is there any way of avoiding that? I have also checked https://status.dev.azure.com/ and there is no indication of any issues with it. These are with the paid Azure Devops agent pool not a private agent pool.

There is a similar issue that has been open here. You can join in the discussion of this thread or open new issue for above case.
you can try the workaround of using continueOnError: true on the cache task to prevent it from failing the build.
- task: Cache#2
inputs:
key: 'npm | "$(Agent.OS)" | package-lock.json'
restoreKeys: |
npm | "$(Agent.OS)"
npm
path: $(npm_config_cache)
displayName: Cache npm
continueOnError: true

Related

dotnet restore: An error occurred while retrieving package... metadata Root element is missing

I have a nuget/docker build issue that I’ve spent a couple of days debugging and am running out of ideas: Do you know why I am getting the below error?
The issue is with one asp.net core solution (others that are very similar are unaffected): Although I can build the affected solution in visual studio 2019 using the docker compose file, it will not work using the dockerfile and so the docker build command can’t be run.
If I run the dockerfile by doing a build as below in command prompt:
docker build -f MStoreBosGateway/MStoreBosGatewayApi/Dockerfile --pull --no-cache -t mstorebosgateway:0.041 .
then I get the following error:
Step 11/26 : RUN dotnet restore "MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj"
> ---> Running in 30819cb5db4f
> /usr/share/dotnet/sdk/2.2.402/NuGet.targets(123,5): error : An error
> occurred while retrieving package metadata for
> 'System.Text.Encodings.Web.4.5.0' from source
> '/usr/share/dotnet/sdk/NuGetFallbackFolder'.
> [/src/MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj]
> /usr/share/dotnet/sdk/2.2.402/NuGet.targets(123,5): error : Root
> element is missing.
> [/src/MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj]
> The command '/bin/sh -c dotnet restore
> "MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj"'
> returned a non-zero code: 1
I’ve put RUN echo commands after each line in the dockerfile so it looks like it is the dotnet restore that is causing this issue. If I run the dotnet restore command by itself it runs ok.
To try to resolve this I’ve done quite a few things e.g.
-Deleted the obj and bin folders from this solution and projects,
-Uninstalled and reinstalled nuget,
-Deleted the nuget caches to force the packages to be redownloaded,
-uninstalled and reinstalled the dotnet core sdks,
-Removed the package mentioned in the error message ('System.Text.Encodings.Web.4.5.0) from the project file (this did
not cause any errors so must have been redundant anyway). That did
not affect this error and it restores this package so there must be
something else saying to use this package or possibly system packages
are all included by default anyway.
My colleague can build this project and has sent me a copy of it that he can build; I get the same issue building his copy so assume it’s something external to the project.
I have added below the output if I add ‘ –verbosity detailed’ to the dotnet restore command in the docker file.
GET https://api.nuget.org/v3-flatcontainer/microsoft.extensions.dependencyinjection.abstractions/index.json
OK https://api.nuget.org/v3-flatcontainer/aspnet.security.oauth.validation/index.json 342ms
GET https://api.nuget.org/v3-flatcontainer/aspnet.security.oauth.validation/2.0.0/aspnet.security.oauth.validation.2.0.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/aspnet.security.oauth.validation/2.0.0/aspnet.security.oauth.validation.2.0.0.nupkg 52ms
GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.authentication/index.json
GET https://api.nuget.org/v3-flatcontainer/newtonsoft.json/10.0.2/newtonsoft.json.10.0.2.nupkg
1>/usr/share/dotnet/sdk/2.2.402/NuGet.targets(123,5): error : An error occurred while retrieving package metadata for 'System.Text.Encodings.Web.4.5.0' from source '/usr/share/dotnet/sdk/NuGetFallbackFolder'. [/src/MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj]
/usr/share/dotnet/sdk/2.2.402/NuGet.targets(123,5): error : Root element is missing. [/src/MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj]
OK https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggergen/index.json 156ms
GET https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggergen/4.0.1/swashbuckle.aspnetcore.swaggergen.4.0.1.nupkg
OK https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggerui/index.json 160ms
GET https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggerui/4.0.1/swashbuckle.aspnetcore.swaggerui.4.0.1.nupkg
OK https://api.nuget.org/v3-flatcontainer/automapper/index.json 155ms
GET https://api.nuget.org/v3-flatcontainer/automapper/8.0.0/automapper.8.0.0.nupkg
OK https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggergen/4.0.1/swashbuckle.aspnetcore.swaggergen.4.0.1.nupkg 44ms
OK https://api.nuget.org/v3-flatcontainer/swashbuckle.aspnetcore.swaggerui/4.0.1/swashbuckle.aspnetcore.swaggerui.4.0.1.nupkg 49ms
GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.apiexplorer/index.json
GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.core/index.json
GET https://api.nuget.org/v3-flatcontainer/microsoft.aspnetcore.mvc.dataannotations/index.json
NuGet.Protocol.Core.Types.FatalProtocolException: An error occurred while retrieving package metadata for 'System.Text.Encodings.Web.4.5.0' from source '/usr/share/dotnet/sdk/NuGetFallbackFolder'. ---> NuGet.Packaging.Core.PackagingException: An error occurred while retrieving package metadata for 'System.Text.Encodings.Web.4.5.0' from source '/usr/share/dotnet/sdk/NuGetFallbackFolder'. ---> System.Xml.XmlException: Root element is missing.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at NuGet.Packaging.Core.NuspecCoreReaderBase.LoadXml(Stream stream, Boolean leaveStreamOpen)
at NuGet.Packaging.Core.NuspecCoreReaderBase..ctor(Stream stream, Boolean leaveStreamOpen)
at NuGet.Packaging.NuspecReader..ctor(Stream stream)
at NuGet.Protocol.LocalPackageFileCache.GetNuspec(String manifestPath, String expandedPath)
at NuGet.Protocol.LocalPackageFileCache.<>c__DisplayClass6_1.<GetOrAddNuspec>b__1()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at NuGet.Protocol.LocalV3FindPackageByIdResource.ProcessNuspecReader[T](String id, NuGetVersion version, Func`2 process)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at NuGet.Protocol.LocalV3FindPackageByIdResource.ProcessNuspecReader[T](String id, NuGetVersion version, Func`2 process)
at NuGet.Protocol.LocalV3FindPackageByIdResource.GetDependencyInfoAsync(String id, NuGetVersion version, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.Commands.SourceRepositoryDependencyProvider.GetDependenciesCoreAsync(LibraryIdentity match, NuGetFramework targetFramework, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.Commands.SourceRepositoryDependencyProvider.<>c__DisplayClass21_0.<<GetDependenciesAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at NuGet.Commands.SourceRepositoryDependencyProvider.GetDependenciesAsync(LibraryIdentity libraryIdentity, NuGetFramework targetFramework, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.DependencyResolver.ResolverUtility.CreateGraphItemAsync(RemoteMatch match, NuGetFramework framework, SourceCacheContext cacheContext, ILogger logger, CancellationToken cancellationToken)
at NuGet.DependencyResolver.ResolverUtility.FindLibraryEntryAsync(LibraryRange libraryRange, NuGetFramework framework, String runtimeIdentifier, RemoteWalkContext context, CancellationToken cancellationToken)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge)
at NuGet.DependencyResolver.RemoteDependencyWalker.CreateGraphNode(LibraryRange libraryRange, NuGetFramework framework, String runtimeName, RuntimeGraph runtimeGraph, Func`2 predicate, GraphEdge`1 outerEdge)
at NuGet.Commands.ProjectRestoreCommand.WalkDependenciesAsync(LibraryRange projectRange, NuGetFramework framework, String runtimeIdentifier, RuntimeGraph runtimeGraph, RemoteDependencyWalker walker, RemoteWalkContext context, CancellationToken token)
at NuGet.Commands.ProjectRestoreCommand.TryRestoreAsync(LibraryRange projectRange, IEnumerable`1 frameworkRuntimePairs, NuGetv3LocalRepository userPackageFolder, IReadOnlyList`1 fallbackPackageFolders, RemoteDependencyWalker remoteWalker, RemoteWalkContext context, Boolean forceRuntimeGraphCreation, CancellationToken token, TelemetryActivity telemetryActivity)
at NuGet.Commands.RestoreCommand.ExecuteRestoreAsync(NuGetv3LocalRepository userPackageFolder, IReadOnlyList`1 fallbackPackageFolders, RemoteWalkContext context, CancellationToken token, TelemetryActivity telemetryActivity)
at NuGet.Commands.RestoreCommand.ExecuteAsync(CancellationToken token)
at NuGet.Commands.RestoreRunner.ExecuteAsync(RestoreSummaryRequest summaryRequest, CancellationToken token)
at NuGet.Commands.RestoreRunner.ExecuteAndCommitAsync(RestoreSummaryRequest summaryRequest, CancellationToken token)
at NuGet.Commands.RestoreRunner.CompleteTaskAsync(List`1 restoreTasks)
at NuGet.Commands.RestoreRunner.RunAsync(IEnumerable`1 restoreRequests, RestoreArgs restoreContext, CancellationToken token)
at NuGet.Commands.RestoreRunner.RunAsync(RestoreArgs restoreContext, CancellationToken token)
at NuGet.Build.Tasks.RestoreTask.ExecuteAsync(ILogger log)
Done executing task "RestoreTask" -- FAILED.
1>Done building target "Restore" in project "MStoreBOSGatewayApi.csproj" -- FAILED.
1>Done Building Project "/src/MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj" (Restore target(s)) -- FAILED.
Build FAILED.
"/src/MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj" (Restore target) (1) ->
(Restore target) ->
/usr/share/dotnet/sdk/2.2.402/NuGet.targets(123,5): error : An error occurred while retrieving package metadata for 'System.Text.Encodings.Web.4.5.0' from source '/usr/share/dotnet/sdk/NuGetFallbackFolder'. [/src/MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj]
/usr/share/dotnet/sdk/2.2.402/NuGet.targets(123,5): error : Root element is missing. [/src/MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:04.70
The command '/bin/sh -c dotnet restore "MStoreBOSGateway/MStoreBOSGatewayApi/MStoreBOSGatewayApi.csproj" --verbosity detailed' returned a non-zero code: 1
C:\Applications\VB2017Apps\MStoreBOSGateway>

Nest fails to write to ES while executed from Azure functions

I do have azure function which listens to events and write data to ES, but randomly it fails.
Exception while executing function: ElasticSearchIndexer Invalid NEST response built from a unsuccessful low level call on POST: /_bulk
# Invalid Bulk items:
# Audit trail of this API call:
- [1] AllNodesDead: Took: 00:00:00
- [2] Resurrection: Node: http://ip:9200/ Took: 00:00:00
- [3] PingFailure: Node: http://ip:9200/ Exception: PipelineException Took: 00:00:02.0095670
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Failed to ping the specified node.. Call: Status code unknown from: HEAD / ---> Elasticsearch.Net.PipelineException: Failed to ping the specified node. ---> Elasticsearch.Net.PipelineException: An error occurred trying to read the response from the specified node. ---> System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Elasticsearch.Net.HttpWebRequestConnection.<RequestAsync>d__5`1.MoveNext()
--- End of inner exception stack trace ---
at Elasticsearch.Net.RequestPipeline.<PingAsync>d__65.MoveNext()
--- End of inner exception stack trace ---
at Elasticsearch.Net.RequestPipeline.<PingAsync>d__65.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Elasticsearch.Net.Transport`1.<PingAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Elasticsearch.Net.Transport`1.<PingAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Elasticsearch.Net.Transport`1.<RequestAsync>d__15`1.MoveNext()
--- End of inner exception stack trace ---
# Audit exception in step 3 PingFailure:
Elasticsearch.Net.PipelineException: An error occurred trying to read the response from the specified node. ---> System.Net.WebException: The request was aborted: The request was canceled.
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Elasticsearch.Net.HttpWebRequestConnection.<RequestAsync>d__5`1.MoveNext()
--- End of inner exception stack trace ---
at Elasticsearch.Net.RequestPipeline.<PingAsync>d__65.MoveNext()
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response:
<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
I am registering in DI .
var uris = FlymarkAppSettings.Instance.ElasticServerConnection.Split(';').Select(url => new Uri(url));
var settings = new ConnectionSettings(new StaticConnectionPool(uris));
#if DEBUG
settings.EnableDebugMode();
#endif
builder.Register(c => new ElasticClient(settings))
.As<IElasticClient>()
.SingleInstance();

Publish telerik application

I want to publish the telerik app builder.It shows this issue.
Build failed: One or more errors occurred..
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at Telerik.BlackDragon.Common.Data.TargetResultDataExtensions.GetRelativeOutputPath(TargetResultData targetResultData, DevicePlatform platform)
at Telerik.BlackDragon.Common.Data.TargetResultDataExtensions.GetRelativePathToPackage(TargetResultData targetResultData, DevicePlatform platform)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at Telerik.BlackDragon.Client.Build.Services.BuildService.d__2.MoveNext()
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task1.get_Result()
at Telerik.BlackDragon.Client.Build.CloudBuild.ExecuteCore(IHttpServiceContext httpServiceContext, LogHelper logger)
at Telerik.BlackDragon.Client.Build.CloudTaskBase.ExecuteCore()
---> (Inner Exception #0) System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at Telerik.BlackDragon.Common.Data.TargetResultDataExtensions.GetRelativeOutputPath(TargetResultData targetResultData, DevicePlatform platform)
at Telerik.BlackDragon.Common.Data.TargetResultDataExtensions.GetRelativePathToPackage(TargetResultData targetResultData, DevicePlatform platform)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at Telerik.BlackDragon.Client.Build.Services.BuildService.d__2.MoveNext()
It's because you have this error
System.AggregateException: One or more errors occurred. ---> System.InvalidOperationException: Sequence contains more than one matching element
It means that your linq query returns more than one element. if it's normal, you should use FirstOrDefault().
SingleOrDefault() throws an exception if more than one element exists.

I can't download from https on MonoDroid - am I missing something obvious?

Here's the code I'm running:
var wc = new WebClient ();
var test1 = wc.DownloadString("http://www.google.com");
var test2 = wc.DownloadString("https://www.google.com");
test1 gives me some text.
test2 never gets initialised because of an exception with trace starting:
{System.Net.WebException: Error getting response stream (Write:
EndWrite failure): SendFailure ---> System.IO.IOException: EndWrite
failure ---> System.Net.Sockets.SocketException: The socket has been
shut down at System.Net.Sockets.Socket.EndSend (IAsyncResult result)
[0x0002d] in
/home/jon/Development/xamarin/mono/mcs/class/System/System.Net.Sockets/Socket_2_1.cs:1989
at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar)
[0x0002f] in
/home/jon/Development/xamarin/mono/mcs/class/System/System.Net.Sockets/NetworkStream.cs:358
--- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x0003d]
in
/home/jon/Development/xamarin/mono/mcs/class/System/System.Net.Sockets/NetworkStream.cs:360
at Mono.Security.Protocol.Tls.RecordProtocol.EndSendRecord
(IAsyncResult asyncResult) [0x00040] in
/home/jon/Development/xamarin/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:721
at Mono.Security.Protocol.Tls.RecordProtocol.SendRecord (ContentType
contentType, System.Byte[] recordData) [0x0000b] in
/home/jon/Development/xamarin/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/RecordProtocol.cs:729
I'm running MonoDevelop.MonoDroid - 2.6.0.0 - with a download from MonoDroid a couple of days ago - "Mono for Android: 1.2.24817.105690530 (Evaluation)"
Is this just a bug - or is there some other step I need for MonoDroid?
It seems this has been confirmed as a bug in the 1.2 release - so I'm closing this question!

Visual Studio published application install/update timeout problem

we are developing a Winform application in C# and Visual Studio 2010 which we publish to a folder on our server. We use the 'installation folder URL' field in the publish tab with 'http://server/folder'. The problem is that if more than one person trying to install or update the application on their machine, the install or update will fail and the error log says it is has timed out, I have added the contents of the log file to the end of this post.
It seems like a some kind of locking is going on, the folder we publish to on the server has read only permission. We have tried many things, like using 'Clean Solution' and 'Rebuild Solution'.
Does anyone know about this problem or have any suggestions that might help. Thank you for you help.
Jing Jing Tao
PLATFORM VERSION INFO
Windows : 6.1.7600.0 (Win32NT)
Common Language Runtime : 4.0.30319.225
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.225 (RTMGDR.030319-2200)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : file:///C:/Users/Administrator/AppData/Roaming
/Microsoft/Windows/Start%20Menu/Programs/TiffinSolutions/Removal%20Software.appref-ms%7C
Server : Microsoft-IIS/7.0
X-Powered-By : ASP.NET
Deployment Provider url : £http://tiffinsolutions.zapto.org/ApplicationUpdateFiles/Removal%20Software.application
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\TiffinSolutions\Removal Software.appref-ms| resulted in exception. Following failure messages were detected:
+ Downloading £http://tiffinsolutions.zapto.org/ApplicationUpdateFiles/Application Files/Removal Software_1_1_0_157/Removal Software.exe.manifest did not succeed.
+ The operation has timed out
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [24/05/2011 14:22:16] : Activation of C:\Users\Administrator\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\TiffinSolutions\Removal Software.appref-ms| has started.
* [24/05/2011 14:22:16] : Performing necessary update check as specified by the deployment.
* [24/05/2011 14:22:17] : Consuming new update.
* [24/05/2011 14:22:17] : Installation of the application has started.
ERROR DETAILS
Following errors were detected during this operation.
* [24/05/2011 14:23:57] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
- Downloading http://tiffinsolutions.zapto.org/ApplicationUpdateFiles/Application Files/Removal Software_1_1_0_157/Removal Software.exe.manifest did not succeed.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
at System.Deployment.Application.DownloadManager.DownloadApplicationManifest(AssemblyManifest deploymentManifest, String targetDir, Uri deploymentUri, IDownloadNotification notification, DownloadOptions options, Uri& appSourceUri, String& appManifestPath)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.ConsumeUpdatedDeployment(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentUpdate(SubscriptionState& subState, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ProcessOrFollowShortcut(String shortcutFile, String& errorPageUrl, TempFile& deployFile)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
--- Inner Exception ---
System.Net.WebException
- The operation has timed out
- Source: System
- Stack trace:
at System.Net.HttpWebRequest.GetResponse()
at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.
In the end the conclusion we were able to gain was that the server is not setup for hosting and we used our hosted service to store our files.

Resources