Closed DanJ210 closed 7 years ago
Try looking at the logs. docker run -d
means "detached" mode. To see the dotnet app's output, run with docker run -it
or inspect the logs manually with docker logs
.
Also, did dotnet --info
and docker info
really both return Error code 134
?
@natemcmaster Thanks I will check the logs and see what's going on and report back here. I didn't realize I should have tried to get some logging.
And no dotnet --info
and docker --info
didn't return the Error code 134
. I misunderstood what those areas were for exactly so I filled in only what I thought was supposed to go there, like info. My apologies on mistaking that.
Ok so seeing the logs really helped and sorry to have bothered for something I should have learned on my own...
But what I think is happening, which should be common sense, is that the container won't talk to the SQL Server database like it does when I run it locally, via dotnet run connecting to the local SQL Server instance. So when the container is trying to run the application during container startup, it's failing because of not being to contact the database, that's my best guess at this moment.
Below I've posted all the logs for that container and that's what it's looking like, database issues causing the container to fail. So this issue could be closed and I'll be a little better at not having to bother you guys/girls for something like this in the future.
PS C:\Windows\system32> docker logs 7a [21:00:24 DBG] Compiling query model: '(from NocUser <generated>_1 in DbSet<NocUser> select <generated>_1) .Any()' [21:00:24 DBG] Optimized query model: '(from NocUser <generated>_1 in DbSet<NocUser> select <generated>_1) .Any()' [21:00:24 DBG] TRACKED: False (QueryContext queryContext) => IEnumerable<bool> _ToSequence( element: bool GetResult( valueBuffers: IEnumerable<ValueBuffer> _Query( queryContext: queryContext, shaperCommandContext: SelectExpression: SELECT CASE WHEN EXISTS ( SELECT 1 FROM [AspNetUsers] AS [a]) THEN CAST(1 AS BIT) ELSE CAST(0 AS BIT) END , queryIndex: default(System.Nullable
1[System.Int32])
)
)
)
[21:00:24 ERR] An exception occurred in the database while iterating the results of a query.
System.NotSupportedException: The keyword 'integrated security' is not supported on this platform.
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions&
userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerConnection.CreateDbConnection()
at Microsoft.EntityFrameworkCore.Internal.LazyRef1.get_Value() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open() at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](Func
2 operation, Func2 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.MoveNext() at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.GetResult[TResult](IEnumerable
1 valueBuffers)
at lambda_method(Closure , QueryContext )
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass20_0`1.
Unhandled Exception: System.AggregateException: One or more errors occurred. (The keyword 'integrated security' is not supported on this platform.) ---> System.No
tSupportedException: The keyword 'integrated security' is not supported on this platform.
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions&
userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerConnection.CreateDbConnection()
at Microsoft.EntityFrameworkCore.Internal.LazyRef1.get_Value() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open() at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](Func
2 operation, Func2 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.MoveNext() at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.GetResult[TResult](IEnumerable
1 valueBuffers)
at lambda_method(Closure , QueryContext )
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>cDisplayClass20_01.<CompileQueryCore>b__0(QueryContext qc) at System.Linq.Queryable.Any[TSource](IQueryable
1 source)
at NOCPLWebApplication.Models.SeedData.ProductServerSeedData.
[17:16:26 ERR] An exception occurred in the database while iterating the results of a query.
System.NotSupportedException: The keyword 'integrated security' is not supported on this platform.
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions&
userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerConnection.CreateDbConnection()
at Microsoft.EntityFrameworkCore.Internal.LazyRef1.get_Value() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open() at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](Func
2 operation, Func2 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.MoveNext() at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.GetResult[TResult](IEnumerable
1 valueBuffers)
at lambda_method(Closure , QueryContext )
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass20_0`1.
Unhandled Exception: System.AggregateException: One or more errors occurred. (The keyword 'integrated security' is not supported on this platform.) ---> System.No
tSupportedException: The keyword 'integrated security' is not supported on this platform.
at System.Data.SqlClient.SqlConnectionString..ctor(String connectionString)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnectionOptions(String connectionString, DbConnectionOptions previous)
at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPoolGroup(DbConnectionPoolKey key, DbConnectionPoolGroupOptions poolOptions, DbConnectionOptions&
userConnectionOptions)
at System.Data.SqlClient.SqlConnection.ConnectionString_Set(DbConnectionPoolKey key)
at System.Data.SqlClient.SqlConnection.set_ConnectionString(String value)
at System.Data.SqlClient.SqlConnection..ctor(String connectionString)
at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerConnection.CreateDbConnection()
at Microsoft.EntityFrameworkCore.Internal.LazyRef1.get_Value() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open() at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](Func
2 operation, Func2 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.MoveNext() at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.GetResult[TResult](IEnumerable
1 valueBuffers)
at lambda_method(Closure , QueryContext )
at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>cDisplayClass20_01.<CompileQueryCore>b__0(QueryContext qc) at System.Linq.Queryable.Any[TSource](IQueryable
1 source)
at NOCPLWebApplication.Models.SeedData.ProductServerSeedData.
@DanJ210 no worries, we're here to help. :)
The keyword 'integrated security' is not supported on this platform.
This is a common mistake when moving an app that runs on Windows into Linux-based Docker containers. Use User ID
and Password
instead in your connection string. Integrated Security is a Windows-only feature. If that doesn't help, checkout these samples: https://www.microsoft.com/en-us/sql-server/developer-get-started/
@natemcmaster Thank you. I did do a few things to ensure I know what I'm doing and I now know how to create a service with a blank .Net Core application and an SQL Server Linux image under an isolated network created with a docker-compose.yml file. I've been able to add data and pull it to confirm it's working.
But when I try to do it with my application, as you've shown above, I'm getting the 'integrated security'
issue. As of now my connection string is simple "Server=DJACKSON;Database=NocPlTable;User ID=sa;password=P@ssw0rd!;MultipleActiveResultSets=true;"
So I'm going to follow your link and see if I can find a solution with that but it looks like that may take quite a while. I could try to run with Windows containers but that's going to change everything! Lol.
Thanks for the help, I'll report back if I solve.
Oh. The funny thing is that I can run the application and it works fine but when I use docker-compose up
to turn on the same containers that are built from that same application, that's when I get the integrated security
issue. Otherwise I don't. Only when docker-compose up
@natemcmaster I made a very silly mistake. I had forgotten to republish the application... It was the first time I ever published a dotnet application but that was what happened.
The only thing I have to do now is run docker-compose up
twice. The first time turns on both the sql server and my application image, but the application tries contacting sql server before it's actually up and running. So I run it once, then a second time and it all connects.
Glad you were able to figure it out :)
Lol I am ripping my hair out trying to figure out what I'm doing wrong.
Steps to reproduce the issue
(e.g. copy your Dockerfile or docker-compose.yml file here)
Expected behavior
Expecting to be able to run the container with a published ASP.NET Core app.
Actual behavior
Container exits after seconds with error code (134)
Additional information (e.g. issue happens only occasionally)
I've tried many different combinations and also suggestion in the comments of the tutorial page below. I've also given my docker file with some of the different combinations I've tried but sticking to the tutorial. I've also taken a few screenshots of my filesystem to prove there's a published folder and the app .dll is in that published folder.
file:///c%3A/Users/djackson/testing/source/noc-pl-webapplication/NOC-PL-WebApplication/Dockerfile
Output of
dotnet --info
Output of
docker info