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

SQL Connection w/Kerberos - Linux Ubuntu - Error Code 139 #7185

Closed
ebeltran1981 opened this issue Feb 14, 2022 · 1 comment
Closed

SQL Connection w/Kerberos - Linux Ubuntu - Error Code 139 #7185

ebeltran1981 opened this issue Feb 14, 2022 · 1 comment

Comments

@ebeltran1981
Copy link

ebeltran1981 commented Feb 14, 2022

Description

I'm upgrading an app from .NET 5 to 6. Our SQL servers supports Kerberos. In Windows and macOS the .NET 6 upgraded app works fine, but in Linux Ubuntu 20.04 the dotnet watch run shows: watch : Exited with error code 139 when the app tries to execute a query against the SQL server.

The connection string I am using is this:

"Server=our-sql-server.com;Database=our-db;MultipleActiveResultSets=True;Max Pool Size=300;Trusted_Connection=True;"

Configuration

  • Which version of .NET is the code running on? 6.0.102
  • What OS and version, and for Linux, what distro? Linux Ubuntu 20.04
  • What is the architecture (x64, x86, ARM, ARM64)? x64
  • Do you know whether it is specific to that configuration? I tried on a Mac Mini w/ M1 and Dell w/ i7 and works fine

Regression?

  • Did this work in a previous build or release of .NET, or from .NET Framework? I tried it with .NET 5.0.405 and works fine everywhere.

Other information

About the stack trace, there is none. When run with debug it simply dies with no message. When run with dotnet run it just quits with no error. When run with dotnet watch run it shows: watch : Exited with error code 139.

I do not have any works around. I've been trying different connections strings options, but no luck!

With this simple app throws the error:

using Microsoft.EntityFrameworkCore;

var contextOptions = new DbContextOptionsBuilder<AppDbContext>()
    .UseSqlServer(@"Server=our-sql-server.com;Database=our-db;MultipleActiveResultSets=True;Max Pool Size=300;Trusted_Connection=True;")
    .Options;

await using var context = new AppDbContext(contextOptions);
var response = await context.Database.ExecuteSqlRawAsync("SELECT * FROM AnyTable"); // <-- this makes the app crash with no message

Console.WriteLine(response);

internal class AppDbContext : DbContext
{
    public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
    {
        
    }
}
@ebeltran1981
Copy link
Author

Issue already reported in SqlClient project.

dotnet/SqlClient#1390

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant