Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Git deploy fails with "Thread was aborted" errors. #2499

Closed
sturatcliffe opened this issue Jul 8, 2017 · 13 comments
Closed

Git deploy fails with "Thread was aborted" errors. #2499

sturatcliffe opened this issue Jul 8, 2017 · 13 comments

Comments

@sturatcliffe
Copy link

Hi,

Publishing to azure from visual studio is working fine, and the app builds and runs locally. However, when configuring azure to deploy from my github repo it takes around 20-30 mins before the deployment shows as failed, sometimes with "Thread was aborted" errors, others with no error message at all.

Github repo with the sample solution: https://github.com/sturatcliffe/ng4test

I have had git deploys working earlier this morning, but since then I've added some syncfusion controls to the page, and been trying to tweak the csproj file to only run "npm install" and "npm install -g @angular/cli" when publishing, to prevent it running these scripts everytime we build the app locally.

The app service this is running on is: http://ng-four-test.azurewebsites.net/

Any clues on why the git deploys are failing?
Thanks

@watashiSHUN
Copy link
Contributor

Hello:
How did you configure to deploy from GitHub? continuous integration? in your http://ng-four-test.azurewebsites.net/ I don't see any deployment logs. can you go to your Azure portal and take a look at what does the "deployment option" say:
capture1

I tried to push your github repo to a simple web app, and I got:

remote:   Ng4Test -> D:\home\site\repository\bin\Release\netcoreapp1.1\Ng4Test.dll
remote:   * * * * * * Building Angular App * * * * * *
remote: ................................................................................................................................................................fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer

is this what you are seeing?

@sturatcliffe
Copy link
Author

No I've not seen that error before!

Apologies, I'd disconnected the git repo deployment so I could just push manually from VS2017. I'm using this as a proof of concept before I make huge changes to a live app, but I'm done changing it now!

So to configure deployment from github I just go to the deployment options tab, and select my github account and repository and leave it to do it's thing. We're using this method on numerous other core apps, just not with angular.

I've just kicked off a new github deploy, I suspect it will fail again, and then there should be some deployment logs. The only error I've seen is "Thread has been aborted". I tried fixing this by setting the SCM command timeout to 5 mins as suggested by someone else at this issue: #2089 but it doesn't seem to have any effect.

@sturatcliffe
Copy link
Author

It's now failed, but with a different error that I've not seen before:

ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Can't see why it should be running out of memory, it's only a tiny sample application!

@davidebbo
Copy link
Member

The error in sideband demultiplexer is very likely caused by using a free site that runs our of quota, since the deployment for this repo is extremely resource intensive.

The original error might be a typescript issue: microsoft/TypeScript#16234

@sturatcliffe
Copy link
Author

That's why I haven't seen that error before then as I'm on an S1 instance.

Is there a way of telling if this is due to the syncfusion packages we're re using? It seemed to start failing after adding them, and even now I have to take off the -prod from the angular build or the local publish fails as well!

@sturatcliffe
Copy link
Author

Removing -prod flag from the angular build step seems to have fixed it. I'll have to go through the tsconfig options as suggested in the issue linked above and see if I can fix it up.

@davidebbo
Copy link
Member

davidebbo commented Jul 10, 2017

One thing that may help is to isolate the step that's failing by running it manually via Kudu console instead of as part of git deployment. See this page.

@gituser227
Copy link

We are currently seeing this issue with https://sim-cms-public-staging.azurewebsites.net/

After build is complete, the log message lists this same message twice:

Thread was being aborted.
Thread was being aborted.

@stubbsy345
Copy link

Also getting this issue with angular build. Was a solution found?

@smathangi
Copy link

smathangi commented Nov 13, 2018

Also we are getting this when kudu deployment try to install function extensions from nuget.
Any solution or workaround?

Trace log :

<step title="BackgroundTrace" date="2018-11-13T13:20:46.565" instance="ddaeb1" url="/api/zipdeploy" method="POST" >
    <step title="Creating temporary deployment" date="2018-11-13T13:20:46.674" />
    <!-- duration: 47ms -->
    <step title="Performing fetch based deployment" date="2018-11-13T13:20:46.740" >
        <step title="Cleaning up temp folders from previous zip deployments and extracting pushed zip file D:\local\Temp\zipdeploy\h2oueftz.zip (0.00 MB) to D:\local\Temp\zipdeploy\extracted" date="2018-11-13T13:20:46.877" />
        <!-- duration: 31ms -->
        <step title="DeploymentManager.Deploy(id:a05e8c9daf084d80bd602fd41ccbb0de)" date="2018-11-13T13:20:46.926" >
            <step title="Collecting changeset information" date="2018-11-13T13:20:46.973" />
            <!-- duration: 61ms -->
            <step title="Updating submodules" date="2018-11-13T13:20:47.033" />
            <!-- duration: 47ms -->
            <step title="Determining deployment builder" date="2018-11-13T13:20:47.206" >
                <step title="Builder is FunctionBasicBuilder" date="2018-11-13T13:20:47.269" />
                <!-- duration: 19ms -->
            </step>
            <!-- duration: 94ms -->
            <step title="Copying SSH keys" date="2018-11-13T13:20:47.854" />
            <!-- duration: 0ms -->
            <step title="Building" date="2018-11-13T13:20:47.854" >
                <step title="Generating deployment script" date="2018-11-13T13:20:47.901" >
                    <step title="Executing external process" date="2018-11-13T13:20:47.967" type="process" path="starter.cmd" arguments="&quot;D:\Program Files (x86)\SiteExtensions\Kudu\78.11022.3613\bin\node_modules\.bin\kuduscript.cmd&quot; -y --no-dot-deployment -r &quot;D:\local\Temp\zipdeploy\extracted&quot; -o &quot;D:\home\site\deployments\tools&quot; --functionApp --sitePath &quot;D:\local\Temp\zipdeploy\extracted&quot;" />
                    <!-- duration: 3705ms -->
                    <step title="Saved cached version of the deployment script for command -y --no-dot-deployment -r &quot;D:\local\Temp\zipdeploy\extracted&quot; -o &quot;D:\home\site\deployments\tools&quot; --functionApp --sitePath &quot;D:\local\Temp\zipdeploy\extracted&quot;" date="2018-11-13T13:20:51.683" />
                    <!-- duration: 0ms -->
                </step>
                <!-- duration: 3801ms -->
                <step title="Executing external process" date="2018-11-13T13:20:51.761" type="process" path="starter.cmd" arguments="&quot;D:\home\site\deployments\tools\deploy.cmd&quot;" >
                    <step title="Error occurred" date="2018-11-13T13:20:52.921" type="error" text="Thread was being aborted." stackTrace="   at System.Threading.Monitor.ObjWait(Boolean exitContext, Int32 millisecondsTimeout, Object obj)
   at System.Threading.Monitor.Wait(Object obj, Int32 millisecondsTimeout, Boolean exitContext)
   at System.Threading.Monitor.Wait(Object obj, Int32 millisecondsTimeout)
   at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.SpinThenBlockingWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.InternalWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Kudu.Core.Deployment.FetchDeploymentManager.&lt;&gt;c__DisplayClass11_1.&lt;PerformBackgroundDeployment&gt;b__3() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 339
   at Kudu.Contracts.Infrastructure.LockExtensions.TryLockOperation(IOperationLock lockObj, Action operation, String operationName, TimeSpan timeout) in C:\Kudu Files\Private\src\master\Kudu.Contracts\Infrastructure\LockExtensions.cs:line 34
   at Kudu.Contracts.Infrastructure.LockExtensions.LockOperation(IOperationLock lockObj, Action operation, String operationName, TimeSpan timeout) in C:\Kudu Files\Private\src\master\Kudu.Contracts\Infrastructure\LockExtensions.cs:line 46
   at Kudu.Core.Deployment.FetchDeploymentManager.&lt;&gt;c__DisplayClass11_0.&lt;PerformBackgroundDeployment&gt;b__1() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\FetchDeploymentManager.cs:line 323" />
                    <!-- duration: 1160ms -->
/>
                    <!-- duration: 78ms -->
                </step>
                <!-- duration: 5145ms -->
                <step title="Error occurred" date="2018-11-13T13:20:53.093" type="error" text="Thread was being aborted." stackTrace="   at System.Threading.Monitor.ObjWait(Boolean exitContext, Int32 millisecondsTimeout, Object obj)
   at System.Threading.Monitor.Wait(Object obj, Int32 millisecondsTimeout, Boolean exitContext)
   at System.Threading.Monitor.Wait(Object obj, Int32 millisecondsTimeout)
   at System.Threading.ManualResetEventSlim.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.SpinThenBlockingWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.InternalWait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
   at System.Threading.Tasks.Task`1.get_Result()
   at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func`2 onWriteOutput, Func`2 onWriteError, Encoding encoding, String arguments, Object[] args) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 221
   at Kudu.Core.Infrastructure.Executable.ExecuteWithProgressWriter(ILogger logger, ITracer tracer, String arguments, Object[] args) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 144
   at Kudu.Core.Deployment.Generator.ExternalCommandBuilder.RunCommand(DeploymentContext context, String command, Boolean ignoreManifest, String message) in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\Generator\ExternalCommandBuilder.cs:line 96" />
                <!-- duration: 16ms -->
            </step>
            <!-- duration: 6371ms -->
            <step title="Error occurred" date="2018-11-13T13:20:53.316" type="error" text="Thread was being aborted." stackTrace="   at Kudu.Core.Deployment.Generator.GeneratorSiteBuilder.Build(DeploymentContext context) in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\Generator\GeneratorSiteBuilder.cs:line 46
   at Kudu.Core.Deployment.DeploymentManager.&lt;Build&gt;d__36.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Deployment\DeploymentManager.cs:line 657" />
            <!-- duration: 11ms -->
        </step>
        <!-- duration: 6606ms -->
    </step>
    <!-- duration: 6793ms -->

@suwatch
Copy link
Member

suwatch commented Nov 13, 2018

@smathangi is your webapp name "payment...box"? If so, it seems like the abort happened because site appSettings was being updated while doing deployment. The update appSettings caused the site to restart. Try to do them in sequence.

internal ref: ln1-013.

@smathangi
Copy link

@suwatch you're right. Tried them in sequence - no more errors. Thanks much!

@suwatch suwatch closed this as completed Nov 14, 2018
@suwatch
Copy link
Member

suwatch commented Nov 14, 2018

awesome. issue is closed then.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants