mysql-net / MySqlConnector

MySQL Connector for .NET
https://mysqlconnector.net
MIT License
1.39k stars 336 forks source link

Common Language Runtime detected an invalid program #1439

Closed Immons closed 9 months ago

Immons commented 9 months ago

Software versions MySqlConnector version: 2.3.3 Server type (MySQL, MariaDB, Aurora, etc.) and version: MySQL 8 .NET version: .NET 8 running on Ubuntu (Optional) ORM NuGet packages and versions: EntityFramework 8

Describe the bug When running any command with connector, it's throws exception. Works fine on macOS, only issue is on Ubuntu.

Exception

System.InvalidProgramException: Common Language Runtime detected an invalid program.
Jan 13 18:53:22 vps-4e9376b4 dotnet-kidstime-api[12772]:    at MySqlConnector.MySqlCommand.ExecuteReaderAsync(CommandBehavior behavior, IOBehavior ioBehavior, CancellationToken cancellationToken)
Jan 13 18:53:22 vps-4e9376b4 dotnet-kidstime-api[12772]:    at MySqlConnector.MySqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) in /_/src/MySqlConnector/MySqlCommand.cs:line 350
Jan 13 18:53:22 vps-4e9376b4 dotnet-kidstime-api[12772]:    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)

Additional context Migrated from .NET 6 to .NET 8, on .NET 6 it was working fine.

bgrainger commented 9 months ago

Are you using Dynatrace APM? If so, it appears to inject a problem into MySqlConnector and cause the crash: https://github.com/mysql-net/MySqlConnector/issues/1425#issuecomment-1871890221.

You should disable Dynatrace in your container and report this to Dynatrace support.

Immons commented 9 months ago

@bgrainger that was exactly that issue, thank you very much.

bgrainger commented 9 months ago

Duplicate of #1425