azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

Grpc.Core: Error loading native library. Value cannot be null. (Parameter 'provider')

Open huberttrueselftrueme opened this issue 9 months ago • 1 comments

Version

Hi.

I am working on mac Apple M2 Pro 16 GB macOS Sequoia 15.3.2 Azure Functions Core Tools Core Tools Version: 4.0.6821 Commit hash: N/A +c09a2033faa7ecf51b3773308283af0ca9a99f83 (64-bit) Function Runtime Version: 4.1036.1.23224

<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        <TargetFramework>net9.0</TargetFramework>
        <AzureFunctionsVersion>V4</AzureFunctionsVersion>
        <OutputType>Exe</OutputType>
        <ImplicitUsings>enable</ImplicitUsings>
        <Nullable>enable</Nullable>
    </PropertyGroup>
    <ItemGroup>
        <FrameworkReference Include="Microsoft.AspNetCore.App"/>
        <!-- Application Insights isn't enabled by default. See https://aka.ms/AAt8mw4. -->
        <!-- <PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.22.0" /> -->
        <!-- <PackageReference Include="Microsoft.Azure.Functions.Worker.ApplicationInsights" Version="2.0.0" /> -->
        <PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.0.0"/>
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.2.3" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.0.1" />
        <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.1" />
        <PackageReference Include="Microsoft.DurableTask.Client" Version="1.8.1" />
        <PackageReference Include="Microsoft.DurableTask.Worker" Version="1.8.1" />
    </ItemGroup>
    <ItemGroup>
        <None Update="host.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
        </None>
        <None Update="local.settings.json">
            <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
            <CopyToPublishDirectory>Never</CopyToPublishDirectory>
        </None>
    </ItemGroup>
    <ItemGroup>
        <Using Include="System.Threading.ExecutionContext" Alias="ExecutionContext"/>
    </ItemGroup>
</Project>

Description

So this is my simple code.

public class TestTrigger
{
    private readonly ILogger<TestTrigger> _logger;

    public TestTrigger(ILogger<TestTrigger> logger)
    {
        _logger = logger;
    }

    [Function("TestTrigger")]
    public IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req)
    {
        _logger.LogInformation("C# HTTP trigger function processed a request.");
        return new OkObjectResult("Welcome to Azure Functions!");
        
    }

    [Function("TestTrigger2")]
    public IActionResult Run2(
        [HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req,
        [DurableClient] DurableTaskClient client)
    {
        _logger.LogInformation("C# HTTP trigger function processed a request.");
        return new OkObjectResult("Welcome to Azure Functions!");
        
    }
}

When i implement only this TestTrigger Azure Function work with Azurite, In Rider , With aspire as well as normal debug. Great

Then i added TestTrigger2 as well install some packages for DurableTaskClient DurableClientAttribute types

    <PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.DurableTask" Version="1.2.3" />

Now i am not able to deploy this funcion and test anything. Error form console

[2025-03-21T19:55:42.778Z] Found /Users/hubertprzybylski/RiderProjects/TrueMe3/AppHost1/Company.FunctionApp1/Company.FunctionApp1.csproj. Using for user secrets file configuration.
[2025-03-21T19:55:43.786Z] A host error has occurred during startup operation '9d121def-2fef-44b8-97ac-fbea79c186db'.
[2025-03-21T19:55:43.787Z] Grpc.Core: Error loading native library. Not found in any of the possible locations: /Users/hubertprzybylski/RiderProjects/TrueMe3/AppHost1/Company.FunctionApp1/bin/output/.azurefunctions/libgrpc_csharp_ext.arm64.dylib,/Users/hubertprzybylski/RiderProjects/TrueMe3/AppHost1/Company.FunctionApp1/bin/output/.azurefunctions/runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib,/Users/hubertprzybylski/RiderProjects/TrueMe3/AppHost1/Company.FunctionApp1/bin/output/.azurefunctions/../../runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib.
Value cannot be null. (Parameter 'provider')
Press any key to continue....[2025-03-21T19:55:45.141Z] A host error has occurred during startup operation '85dff365-ab2c-4edd-b0cb-7220d60577a4'.
[2025-03-21T19:55:45.141Z] Grpc.Core: Error loading native library. Not found in any of the possible locations: /Users/hubertprzybylski/RiderProjects/TrueMe3/AppHost1/Company.FunctionApp1/bin/output/.azurefunctions/libgrpc_csharp_ext.arm64.dylib,/Users/hubertprzybylski/RiderProjects/TrueMe3/AppHost1/Company.FunctionApp1/bin/output/.azurefunctions/runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib,/Users/hubertprzybylski/RiderProjects/TrueMe3/AppHost1/Company.FunctionApp1/bin/output/.azurefunctions/../../runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib.


Can anybody help me ?

Steps to reproduce

On mac

1.Create Azure Function Project 2. Add DurableTask function 3. Run on Azurite

huberttrueselftrueme avatar Mar 21 '25 19:03 huberttrueselftrueme

For everyone I found this workaround and it works for me #https://github.com/microsoft/durabletask-dotnet/issues/148#issuecomment-1729006827

huberttrueselftrueme avatar Mar 22 '25 07:03 huberttrueselftrueme

It looks like this was an issue with durable and a fix was released last month - can you let us know if you're still seeing this issue with all the latest bits?

https://github.com/microsoft/durabletask-dotnet/issues/148#issuecomment-3043180046

liliankasem avatar Aug 05 '25 00:08 liliankasem

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

If you are not the original author (@huberttrueselftrueme) and believe this issue is not stale, please comment with /bot not-stale and I will not close it.