Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intermittent instances of "Microsoft.Data.SqlClient is not supported on this platform." #6094

Closed
APIWT opened this issue May 26, 2020 · 3 comments
Assignees

Comments

@APIWT
Copy link

APIWT commented May 26, 2020

We have a durable orchestration function that calls an activity function several times. In some cases, the activity function will fail with the exception Microsoft.Data.SqlClient is not supported on this platform.. This is an intermittent issue and we have tried to work around it by placing a retry policy on our activity function based on this documentation: https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-error-handling?tabs=csharp#automatic-retry-on-failure

My guess is that the VM that is being used is a different platform depending on certain conditions. We used to have this issue but it wasn't intermittent at that time. It was very consistent and this was before we upgrading to .NET Core 3.1 and the latest versions of the SDK. Now when it happens, it is super random and we aren't really sure how to handle it since it happens after a number of retries.

Investigative information

Please provide the following:

  • Timestamp: 2020-05-26T12:42:35.1856794Z
  • Function App version: NET Core App 3.1 (v3 of runtime)
  • Function App name: Unable to share this, please message me if you need details.
  • Function name(s) (as appropriate): Unable to share this, please message me if you need details.
  • Invocation ID: bdc4b58025f94a67a3b6c64bd16acf45 (Listed as execution ID)
  • Region: East US 2

Repro steps

Provide the steps required to reproduce the problem:

  1. Write an orchestration function that calls an activity function in a loop approximately 2000 times. Make sure you follow the guidance here to retry activity functions a few times: https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-error-handling?tabs=csharp#automatic-retry-on-failure
  2. In the activity function, use EF core to do some form of database access.
  3. Kick off the orchestration function and hope you get (un)-lucky.

Expected behavior

I expect that the activity function will never throw a PlatformNotSupportedException.

Actual behavior

Once in a while, the activity function will throw the PlatformNotSupportedException. It appears to happen through the three retries which makes me think it has something to do with the VM being used. This doesn't happen until about iteration 500-1000, so it doesn't happen in the first activity execution or anything like that.

Known workarounds

This might work, but we have not tried it: Azure/Azure-Functions#1370 (comment)

Related information

This is our CSPROJ:

<Project Sdk="Microsoft.NET.Sdk">

    <PropertyGroup>
        <TargetFramework>netcoreapp3.1</TargetFramework>
        <AzureFunctionsVersion>v3</AzureFunctionsVersion>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="[1.0.0]" />
        <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="[3.0.2]" />
        <PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="[3.0.10]" />
        <PackageReference Include="Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" Version="[1.1.5]" />
        <PackageReference Include="Microsoft.Extensions.Http.Polly" Version="[3.1.2]" />
        <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="[3.0.5]" />
    </ItemGroup>

    <ItemGroup>
        <None Update="host.json">
            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
        </None>
        <None Update="local.settings.json">
            <CopyToOutputDirectory>Always</CopyToOutputDirectory>
            <CopyToPublishDirectory>Never</CopyToPublishDirectory>
        </None>
    </ItemGroup>

</Project>
@ghost ghost assigned mhoeger May 26, 2020
@APIWT APIWT changed the title Intermittent instances of "Microsoft.Data.SqlClient is not supported on this platform. Intermittent instances of "Microsoft.Data.SqlClient is not supported on this platform." May 26, 2020
@IanKemp
Copy link

IanKemp commented Jun 2, 2020

Any reason why you aren't using the latest version of Microsoft.NET.Sdk.Functions?

Also, you don't seem to be referencing Microsoft.Data.SqlClient - is this correct, and you're thus confused as to why you're getting that error message?

@IanKemp
Copy link

IanKemp commented Jun 2, 2020

@APIWT seems like you are getting assistance in #5950, might be prudent to close this issue so focus can remain there.

@APIWT
Copy link
Author

APIWT commented Jun 2, 2020

Hey @IanKemp! We are referencing Microsoft.Data.SqlClient transiently through the EF Core SQL Server nuget package in a project reference of the functions project. We updated Microsoft.NET.Sdk.Functions (as per advice in #5950) and I'll close this issue and continue to work with them over there. Thanks!

@APIWT APIWT closed this as completed Jun 2, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jul 2, 2020
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

3 participants