question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Job failed due to exit code -2146232576

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

4reactions
AbhishekTripathicommented, Oct 30, 2019

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>
2reactions
AbhishekTripathicommented, Oct 30, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Job failed due to exit code -2146232576 · Issue #616
When running a web job in Azure, we get 'Job failed due to exit code -2146232576'. When debugging locally, the web job functions...
Read more >
Failing azure webjob (error code -2146232576)
My Azure WebJob keeps failing consistently with the exit code -2146232576. Does anyone know what the exit code relates to?
Read more >
Support for Framework 4.8.1 in Azure Webjobs
Job failed due to exit code -2146232576. which appears to be to do with Net Versions (although there is little documentation on what...
Read more >
Exit code -2146232576 - Dev Ready
Exit code -2146232576 ... And the WebJob status is set to 'Pending Restart;. It turns out that I was targeting the .Net 4.7.2...
Read more >
Job Step Failing, Process Exit Code -2146232576?
The .exe gathers information from a database view, updates a file with the information, and then ftp's the file to a web server...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found