azure-webjobs-sdk icon indicating copy to clipboard operation
azure-webjobs-sdk copied to clipboard

Job failed due to exit code -2146232576

Open AbhishekTripathi opened this issue 5 years ago • 7 comments

Please provide a succinct description of the issue. Azure Webjob Host in portal doesn't run the webjob but gives following error. Local execution of the webjob in VS2019 runs perfectly fine.

[10/18/2019 13:37:18 > 51e489: SYS ERR ] Job failed due to exit code -2146232576
[10/18/2019 13:37:18 > 51e489: SYS INFO] Process went down, waiting for 60 seconds
[10/18/2019 13:37:18 > 51e489: SYS INFO] Status changed to PendingRestart

Repro steps

Create a webjob targeting framework 4.8. Relevant project file snippet below -

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <LangVersion>latest</LangVersion>
    <OutputType>Exe</OutputType>
    <TargetFramework>net48</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.1.0" />
    <PackageReference Include="Microsoft.Azure.Storage.Common" Version="11.1.0" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="3.0.2" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="3.1.1" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.8" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights" Version="3.0.13" />
    <PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.0.0" />
    <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
    <PackageReference Include="System.Spatial" Version="5.8.4" />
    <PackageReference Include="Microsoft.Data.Edm" Version="5.8.4" />
    <PackageReference Include="Microsoft.Data.OData" Version="5.8.4" />
    <PackageReference Include="Microsoft.Data.Services.Client" Version="5.8.4" />
    <PackageReference Include="Microsoft.WindowsAzure.ConfigurationManager" Version="3.2.3" />
    <PackageReference Include="Microsoft.Azure.WebJobs.Core" Version="3.0.13" />
    <PackageReference Include="Microsoft.Azure.KeyVault.Core" Version="3.0.4" />
  </ItemGroup>

Deploy the webjob to Azure. In my case it is a service bus subscription trigger function but I don't think it is relevant as the host is failing much before.

Expected behavior

Provide a description of the expected behavior. Webjob host should initialize the function and run it fine. If any error, I am expecting some more information which could hint what might be going wrong.

Actual behavior

Host gives a cryptic error.

Known workarounds

Provide a description of any known workarounds. ¯_(ツ)_/¯

Related information

Another webjob with lower runtime is working fine.

Based on the issue here: https://github.com/Azure/app-service-announcements/issues/89, I tried to find the runtime version installed. I executed below query which suggests the host VM has .NET 4.7.2. How can I get 4.8 on this box?

reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v Release
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full
    Release    REG_DWORD    0x70bf6

Provide any related information

  • Package version
  • Links to source

AbhishekTripathi avatar Oct 18 '19 14:10 AbhishekTripathi

Update: I found that Azure AppService has not been updated to support the framework v4.8, I downgraded my webjob project to 4.7.2. I deleted the job and redeployed. I still get the same error.

AbhishekTripathi avatar Oct 18 '19 14:10 AbhishekTripathi

Same issue with 4.7.1. Now attempting to downgrade to 4.7 which requires going through the Nuget hell to choose appropriate version of binaries.

AbhishekTripathi avatar Oct 18 '19 15:10 AbhishekTripathi

Issue persists! :(

AbhishekTripathi avatar Oct 18 '19 18:10 AbhishekTripathi

The root of the problem was with VS tooling. Changing the framework version in the project through the project property page doesn't automatically change the app.config. Note that the webjob was originally created with the full framework version 4.8. Obviously, since the Azure AppServices still is on 4.7.2 at the moment of writing this comment, the webjob failed with the cryptic error. I changed the webjob's target framework to 4.7 and other lower versions but none of them worked. It turned out that changing the project property doesn't change the following snippet which exists in the app.config file. One must manually change it to 4.7 or lower for it to work in the AppService environment in Azure. This was the resolution to the problem. Possibly, some documentation can be added to those who stumble over this problem and are finding hard deciphering the cryptic system error codes.

<startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7" />
  </startup>

AbhishekTripathi avatar Oct 30 '19 18:10 AbhishekTripathi

I shouldn't be closing this issue. Please take a look and have an appropriate resolution.

AbhishekTripathi avatar Oct 30 '19 18:10 AbhishekTripathi

We are also facing the same issue. Can anyone suggest, any possible way to publish .Net framework 4.8 supported application as Azure WebJob?

Vineet-Yadav avatar Jan 28 '20 10:01 Vineet-Yadav

Has this been fixed now? Since someone has tried to run in 4.8 in this stack question https://stackoverflow.com/a/72856579/11519765

anime-shed avatar Nov 23 '22 06:11 anime-shed