question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot open database "Microsoft.eShopOnContainers.Services.OrderingDb" requested by the login. The login failed. Login failed for user 'sa'.

See original GitHub issue

getting this error

System.Data.SqlClient.SqlException (0x80131904): Cannot open database “Microsoft.eShopOnContainers.Services.OrderingDb” requested by the login. The login failed. Login failed for user ‘sa’. at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at Ordering.BackgroundTasks.Tasks.GracePeriodManagerService.GetConfirmedGracePeriodOrders() in /src/Services/Ordering/Ordering.BackgroundTasks/Tasks/GracePeriodManagerTask.cs:line 86 ClientConnectionId:2f8ed064-77b2-4ce4-b304-5752234ff88c Error Number:4060,State:1,Class:11

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sughosneocommented, Aug 10, 2020

Thanks @mvelosop for the details.

1reaction
mvelosopcommented, Aug 9, 2020

Hi @dereklew, @sughosneo,

I’ve seen this kind of issues happen when it takes a long time to spin up all containers for the first time, typically when using hard disks (i.e. not SSDs)

It usually helps to begin by start the sqldata containers only so the DB gets creates created. Then stop it and start the whole application again.

you can start the sqldata container with:

docker-compose up sqldata

Hope this helps.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting db error login failed for user "sa" · Issue #1239
Cannot open database "Microsoft.eShopOnContainers.Services.xxxxxxxDb" requested by the login. The login failed. Login failed for user 'sa'.
Read more >
Cannot open database requested by the login error when ...
Cannot open database "Organization_MSCRM" requested by the login. The login failed. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
Read more >
Cannot open database "test" requested by the login. ...
Just open the sql server object explorer window and connect and run the command again in the console.
Read more >
Fix: Can not Open Database requested by the login failed for ...
In this video , I am going to fix that Exception in ASP.NET CORE. Solution : Fix: Can not Open Database requested by...
Read more >
Sqlexception 0x80131904 failed for user sa login
Cannot open database "Microsoft.eShopOnContainers.Services.OrderingDb" requested by the login. The login failed. Login failed for user 'sa'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found