# Exited with code 139

**URL:** <https://forums.docker.com/t/exited-with-code-139/53223>\
**Category:** Compose\
**Created:** [June 29, 2018, 4:24pm UTC](https://forums.docker.com/t/exited-with-code-139/53223 "2018-06-29T16:24:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssamix](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@ssamix](https://forums.docker.com/u/ssamix)\
**Post date:** [June 29, 2018, 4:24pm UTC](https://forums.docker.com/t/exited-with-code-139/53223/1 "2018-06-29T16:24:18Z")

</div>

I have error exited with code 139 /always stopping my service any idea pls…thanks

PS C:\Users\sso\Documents\Visual Studio 2017\Projects\MyProject\> docker-compose up tokenserver  
mssqldata is up-to-date  
Creating tokenapi … done  
Attaching to tokenapi  
tokenapi | info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]  
tokenapi | User profile is available. Using ‘/root/.aspnet/DataProtection-Keys’ as key repository; keys will not be encrypted at rest.  
tokenapi | info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[58]  
tokenapi | Creating key {fa3b3b48-dada-49ea-86f2-67b7b86b0409} with creation date 2018-06-28 08:40:54Z, activation date 2018-06-28 08:40:54Z, and expiration date 2018-09-26 08:40:54Z.  
tokenapi | warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]  
tokenapi | No XML encryptor configured. Key {fa3b3b48-dada-49ea-86f2-67b7b86b0409} may be persisted to storage in unencrypted form.  
tokenapi | info: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[39]  
tokenapi | Writing data to file ‘/root/.aspnet/DataProtection-Keys/key-fa3b3b48-dada-49ea-86f2-67b7b86b0409.xml’.  
tokenapi | info: IdentityServer4.Startup[0]  
tokenapi | You are using the in-memory version of the persisted grant store. This will store consent decisions, authorization codes, refresh and reference tokens in memory only. If you are using any of those features in production, you want to switch to a different store implementation.  
tokenapi | dbug: IdentityServer4.Startup[0]  
tokenapi | Using Identity.Application as default scheme for authentication  
tokenapi | dbug: IdentityServer4.Startup[0]  
tokenapi | Using Identity.External as default scheme for sign-in  
tokenapi | dbug: IdentityServer4.Startup[0]  
tokenapi | Using Identity.External as default scheme for sign-out  
tokenapi | dbug: IdentityServer4.Startup[0]  
tokenapi | Using Identity.Application as default scheme for challenge  
tokenapi | dbug: IdentityServer4.Startup[0]  
tokenapi | Using Identity.Application as default scheme for forbid  
tokenapi | info: Microsoft.EntityFrameworkCore.Infrastructure[10403]  
tokenapi | Entity Framework Core 2.1.0-rtm-30799 initialized ‘ApplicationDbContext’ using provider ‘Microsoft.EntityFrameworkCore.SqlServer’ with options: None  
tokenapi |  
tokenapi | Unhandled Exception: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL Server)  
tokenapi | at System.Data.SqlClient.SqlInternalConnectionTds…ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling)  
tokenapi | at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)  
tokenapi | at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)  
tokenapi | at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)  
tokenapi | at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)  
tokenapi | at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)  
tokenapi | at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) tokenapi | at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)  
tokenapi | at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) tokenapi | at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)  
tokenapi | at System.Data.SqlClient.SqlConnection.Open()  
tokenapi | at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)  
tokenapi | at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)  
tokenapi | at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.\<\>c\_\_DisplayClass18\_0.b\_\_0(DateTime giveUp)  
tokenapi | at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.\<\>c\_\_DisplayClass12\_0`2.<Execute>b__0(DbContext c, TState s) tokenapi | at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded) tokenapi | at Microsoft.EntityFrameworkCore.ExecutionStrategyExtensions.Execute[TState,TResult](IExecutionStrategy strategy, Func`2 operation, Func`2 verifySucceeded, TState state)  
tokenapi | at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerDatabaseCreator.Exists(Boolean retryOnNotExists)  
tokenapi | at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()  
tokenapi | at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)  
tokenapi | at TokenApi.Data.IdentityDbInit.d\_\_0.MoveNext() in /app/Data/IdentityDbInit.cs:line 24  
tokenapi | — End of stack trace from previous location where exception was thrown —  
tokenapi | at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
tokenapi | at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)  
tokenapi | at System.Threading.ThreadPoolWorkQueue.Dispatch()  
tokenapi exited with code 139

PS C:\Users\xxx\Documents\Visual Studio 2017\Projects\myproject\> docker inspect tokenapi  
[  
{  
“Id”: “69cd32847ea0cb96621b38ed5ba4e86c7716873b1b8df38e0f5d6145325c25ca”,  
“Created”: “2018-06-29T21:32:11.4315242Z”,  
“Path”: “dotnet”,  
“Args”: [  
“TokenApi.dll”  
],  
“State”: {  
“Status”: “exited”,  
“Running”: false,  
“Paused”: false,  
“Restarting”: false,  
“OOMKilled”: false,  
“Dead”: false,  
“Pid”: 0,  
“ExitCode”: 139,  
“Error”: “”,  
“StartedAt”: “2018-06-29T21:56:07.0391815Z”,  
“FinishedAt”: “2018-06-29T21:56:23.5693257Z”  
},  
“Image”: “sha256:264591ebc0152b2bc4e0a0e22df5ffd31a1a2ec8eee33b3499e922a26170d592”,  
“ResolvConfPath”: “/var/lib/docker/containers/69cd32847ea0cb96621b38ed5ba4e86c7716873b1b8df38e0f5d6145325c25ca/resolv.conf”,  
“HostnamePath”: “/var/lib/docker/containers/69cd32847ea0cb96621b38ed5ba4e86c7716873b1b8df38e0f5d6145325c25ca/hostname”,  
“HostsPath”: “/var/lib/docker/containers/69cd32847ea0cb96621b38ed5ba4e86c7716873b1b8df38e0f5d6145325c25ca/hosts”,  
“LogPath”: “/var/lib/docker/containers/69cd32847ea0cb96621b38ed5ba4e86c7716873b1b8df38e0f5d6145325c25ca/69cd32847ea0cb96621b38ed5ba4e86c7716873b1b8df38e0f5d6145325c25ca-json.log”,  
“Name”: “/tokenapi”,  
“RestartCount”: 0,  
“Driver”: “overlay2”,  
“Platform”: “linux”,  
“MountLabel”: “”,  
“ProcessLabel”: “”,  
“AppArmorProfile”: “”,  
“ExecIDs”: null,  
“HostConfig”: {  
“Binds”: [],  
“ContainerIDFile”: “”,  
“LogConfig”: {  
“Type”: “json-file”,  
“Config”: {}  
},  
“NetworkMode”: “myproject\_backend”,  
“PortBindings”: {  
“80/tcp”: [  
{  
“HostIp”: “”,  
“HostPort”: “5000”  
}  
]  
},  
“RestartPolicy”: {  
“Name”: “”,  
“MaximumRetryCount”: 0  
},  
“AutoRemove”: false,  
“VolumeDriver”: “”,  
“VolumesFrom”: [],  
“CapAdd”: null,  
“CapDrop”: null,  
“Dns”: null,  
“DnsOptions”: null,  
“DnsSearch”: null,  
“ExtraHosts”: null,  
“GroupAdd”: null,  
“IpcMode”: “shareable”,  
“Cgroup”: “”,  
“Links”: null,  
“OomScoreAdj”: 0,  
“PidMode”: “”,  
“Privileged”: false,  
“PublishAllPorts”: false,  
“ReadonlyRootfs”: false,  
“SecurityOpt”: null,  
“UTSMode”: “”,  
“UsernsMode”: “”,  
“ShmSize”: 67108864,  
“Runtime”: “runc”,  
“ConsoleSize”: [  
0,  
0  
],  
“Isolation”: “”,  
“CpuShares”: 0,  
“Memory”: 0,  
“NanoCpus”: 0,  
“CgroupParent”: “”,  
“BlkioWeight”: 0,  
“BlkioWeightDevice”: null,  
“BlkioDeviceReadBps”: null,  
“BlkioDeviceWriteBps”: null,  
“BlkioDeviceReadIOps”: null,  
“BlkioDeviceWriteIOps”: null,  
“CpuPeriod”: 0,  
“CpuQuota”: 0,  
“CpuRealtimePeriod”: 0,  
“CpuRealtimeRuntime”: 0,  
“CpusetCpus”: “”,  
“CpusetMems”: “”,  
“Devices”: null,  
“DeviceCgroupRules”: null,  
“DiskQuota”: 0,  
“KernelMemory”: 0,  
“MemoryReservation”: 0,  
“MemorySwap”: 0,  
“MemorySwappiness”: null,  
“OomKillDisable”: false,  
“PidsLimit”: 0,  
“Ulimits”: null,  
“CpuCount”: 0,  
“CpuPercent”: 0,  
“IOMaximumIOps”: 0,  
“IOMaximumBandwidth”: 0  
},  
“GraphDriver”: {  
“Data”: {  
“LowerDir”: “/var/lib/docker/overlay2/52cc2afe4ab753ff5964f20e8bdfd726609f8aaffd7d09cccc0ff19995e06088-init/diff:/var/lib/docker/overlay2/739914f1f68235c57fd062d112a00e89e90ed700acf650f55f435d0a63c86a5d/diff:/var/lib/docker/overlay2/f82b929917eeb8e4156fd661c571568127949b255383b65e338f6ef63013a1f6/diff:/var/lib/docker/overlay2/43cabbd996cea738480e0b8f1a6be21f0742ad9be381e71b7b5ce6d803c548a7/diff:/var/lib/docker/overlay2/cd34a54e221f7446992eff6265f627e61b218eff3edee6ccdcabd4c5a08c035e/diff:/var/lib/docker/overlay2/02c2c00fd62272a1a3539f510d6bf4652bd2905dbf2f224da123f7cac806fe4b/diff:/var/lib/docker/overlay2/d018e46a6b0615a1b1a4b9d1abc6965fef9eaf9b21d4cf89b82ed3ac682cf6b7/diff:/var/lib/docker/overlay2/570a0a3e2c193d89bf789b2d3e5deecd9ebf762036421f1132b434359ef3bc11/diff”,  
“MergedDir”: “/var/lib/docker/overlay2/52cc2afe4ab753ff5964f20e8bdfd726609f8aaffd7d09cccc0ff19995e06088/merged”,  
“UpperDir”: “/var/lib/docker/overlay2/52cc2afe4ab753ff5964f20e8bdfd726609f8aaffd7d09cccc0ff19995e06088/diff”,  
“WorkDir”: “/var/lib/docker/overlay2/52cc2afe4ab753ff5964f20e8bdfd726609f8aaffd7d09cccc0ff19995e06088/work”  
},  
“Name”: “overlay2”  
},  
“Mounts”: [],  
“Config”: {  
“Hostname”: “69cd32847ea0”,  
“Domainname”: “”,  
“User”: “”,  
“AttachStdin”: false,  
“AttachStdout”: false,  
“AttachStderr”: false,  
“ExposedPorts”: {  
“80/tcp”: {}  
},  
“Tty”: false,  
“OpenStdin”: false,  
“StdinOnce”: false,  
“Env”: [  
“ASPNETCORE\_ENVIRONMENT=Development”,  
“MvcClient=http://localhost:5200”,  
“PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin”,  
“DOTNET\_RUNNING\_IN\_CONTAINER=true”,  
“DOTNET\_VERSION=2.0.7”,  
“DOTNET\_DOWNLOAD\_URL=https://dotnetcli.blob.core.windows.net/dotnet/Runtime/2.0.7/dotnet-runtime-2.0.7-linux-x64.tar.gz”,  
“DOTNET\_DOWNLOAD\_SHA=d8f6035a591b5500a8b81188d834ed4153c4f44f1618e18857c610d0b332d636970fd8a980af7ae3fbff84b9f1da53aa2f45d8d305827ea88992195cd5643027”,  
“ASPNETCORE\_URLS=http://+:80”,  
“ASPNETCORE\_PKG\_VERSION=2.0.8”  
],  
“Cmd”: null,  
“ArgsEscaped”: true,  
“Image”: “myproject\_tokenserver”,  
“Volumes”: null,  
“WorkingDir”: “/app”,  
“Entrypoint”: [  
“dotnet”,  
“TokenApi.dll”  
],  
“OnBuild”: null,  
“Labels”: {  
“com.docker.compose.config-hash”: “6611cf5be498aec1512a07e595106bc6074ac1bfae76abf71073346a5d8cca58”,  
“com.docker.compose.container-number”: “1”,  
“com.docker.compose.oneoff”: “False”,  
“com.docker.compose.project”: “myproject”,  
“com.docker.compose.service”: “tokenserver”,  
“com.docker.compose.version”: “1.21.1”  
}  
},  
“NetworkSettings”: {  
“Bridge”: “”,  
“SandboxID”: “2687b0750ae1ca43797cfca32958ce4a8355d685508c39304df2a8167783a04b”,  
“HairpinMode”: false,  
“LinkLocalIPv6Address”: “”,  
“LinkLocalIPv6PrefixLen”: 0,  
“Ports”: {},  
“SandboxKey”: “/var/run/docker/netns/2687b0750ae1”,  
“SecondaryIPAddresses”: null,  
“SecondaryIPv6Addresses”: null,  
“EndpointID”: “”,  
“Gateway”: “”,  
“GlobalIPv6Address”: “”,  
“GlobalIPv6PrefixLen”: 0,  
“IPAddress”: “”,  
“IPPrefixLen”: 0,  
“IPv6Gateway”: “”,  
“MacAddress”: “”,  
“Networks”: {  
“myproject\_backend”: {  
“IPAMConfig”: null,  
“Links”: null,  
“Aliases”: [  
“tokenserver”,  
“69cd32847ea0”  
],  
“NetworkID”: “4e63df2ee2c869f837ce24622cfa6a3b9288d09112309300cffc8ccbfea798d4”,  
“EndpointID”: “”,  
“Gateway”: “”,  
“IPAddress”: “”,  
“IPPrefixLen”: 0,  
“IPv6Gateway”: “”,  
“GlobalIPv6Address”: “”,  
“GlobalIPv6PrefixLen”: 0,  
“MacAddress”: “”,  
“DriverOpts”: null  
},  
“myproject\_frontend”: {  
“IPAMConfig”: null,  
“Links”: null,  
“Aliases”: [  
“tokenserver”,  
“69cd32847ea0”  
],  
“NetworkID”: “4cfb64ca1ec557a5b36371f8f818f40c8ca0a3fd4fee0b1734de69619951f8a0”,  
“EndpointID”: “”,  
“Gateway”: “”,  
“IPAddress”: “”,  
“IPPrefixLen”: 0,  
“IPv6Gateway”: “”,  
“GlobalIPv6Address”: “”,  
“GlobalIPv6PrefixLen”: 0,  
“MacAddress”: “”,  
“DriverOpts”: null  
}  
}  
}  
}  
]

---

<div class="post-metadata">

**Author:** ![clyde23](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@clyde23](https://forums.docker.com/u/clyde23)\
**Post date:** [October 19, 2018, 8:38pm UTC](https://forums.docker.com/t/exited-with-code-139/53223/2 "2018-10-19T20:38:37Z")

</div>

This is a database corruption that is most likely related to your hardware. Can you please run a disk test and Memtest?
