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

ADO.NET problems in Linux #267

Closed
HSXDev opened this issue Oct 15, 2019 · 6 comments
Closed

ADO.NET problems in Linux #267

HSXDev opened this issue Oct 15, 2019 · 6 comments

Comments

@HSXDev
Copy link

HSXDev commented Oct 15, 2019

I'm not being able to execute a simple DbConnection.Open() on a docker image running on Debian 10 (buster), i'm receiving the following message:

"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."

If i change the dockerfile to run in Ubuntu(bionic) everything works fine until i need to do a bulk insert.

Running in a windows container works just fine.

@scalablecory scalablecory transferred this issue from dotnet/core Oct 15, 2019
@roji
Copy link
Member

roji commented Oct 15, 2019

What database exactly are you running against? Can you share your csproj, connection string, etc.?

@roji
Copy link
Member

roji commented Oct 15, 2019

Also, which docker image exactly are you using?

@HSXDev
Copy link
Author

HSXDev commented Oct 15, 2019

Hey Roji, sorry for the late response.

I'm using SQL Server, my connection string is: "<providerName="System.Data.SqlClient" connectionString="Data Source=ServerName;Initial Catalog=DatabaseName;user=UserName;password=Password;MinPoolSize=10;MaxPoolSize=25;Pooling=true;"/>

Unfortunatelly i cannot share my csproj, but the code snippet where the error occurs is something like:

using (IDbConnection dbConnection = new SqlConnection(MyConnStringHere))
{
    dbConnection.Open();
    //everything else that is never reached
}

As for the docker image, i tried using the default docker file:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build
WORKDIR /src
COPY ["Project/Project.csproj", "Project/"]
RUN dotnet restore "Project/Project.csproj"
COPY . .
WORKDIR "/src/Project"
RUN dotnet build "Project.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Project.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Project.dll"]

When it didnt work i switched to:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-bionic AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.0-bionic AS build
WORKDIR /src
COPY ["Project/Project.csproj", "Project/"]
RUN dotnet restore "Project/Project.csproj"
COPY . .
WORKDIR "/src/Project"
RUN dotnet build "Project.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Project.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Project.dll"]

Also to no avail.

@roji roji transferred this issue from dotnet/corefx Oct 16, 2019
@cheenamalhotra
Copy link
Member

Hi @HSXDev

There are other related reported issues in Linux docker environments, e.g. #201 we'll address them all together.

@cheenamalhotra cheenamalhotra added this to Needs triage in SqlClient Triage Board via automation Oct 16, 2019
@sinanbaran
Copy link

sinanbaran commented Nov 5, 2019

we solved our problem using mcr.microsoft.com/dotnet/core/aspnet:3.0-bionic

@cheenamalhotra
Copy link
Member

Closing as this is similar to #201 and addressed with #577
Please open a new issue with repro if you face this again.

SqlClient Triage Board automation moved this from Needs triage to Closed Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants