# Unhandled Exception: System.Data.SqlClient.SqlException

**URL:** <https://community.bitwarden.com/t/unhandled-exception-system-data-sqlclient-sqlexception/1568>\
**Category:** Password Manager\
**Created:** [July 20, 2018, 1:56pm UTC](https://community.bitwarden.com/t/unhandled-exception-system-data-sqlclient-sqlexception/1568 "2018-07-20T13:56:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![thisfro](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thisfro](https://community.bitwarden.com/u/thisfro)\
**Post date:** [July 20, 2018, 1:56pm UTC](https://community.bitwarden.com/t/unhandled-exception-system-data-sqlclient-sqlexception/1568/1 "2018-07-20T13:56:14Z")

</div>

Following the guide on the docs, I installed bitwarden on Ubuntu 16.04.

I can’t add a user so i followed [this](https://www.reddit.com/r/Bitwarden/comments/7bg77j/cant_create_initial_account_after_deployment/), which didn’t help. I realised though, that after `./bitwarden.sh updatedb` output was

```plaintext

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: 35 - An internal exception was caught) ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: Resource temporarily unavailable
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostAddresses(String hostNameOrAddress)
   at System.Data.SqlClient.SNI.SNITCPHandle.Connect(String serverName, Int32 port, TimeSpan timeout)
   at System.Data.SqlClient.SNI.SNITCPHandle..ctor(String serverName, Int32 port, Int64 timerExpire, Object callbackObject, Boolean parallel)
   --- End of inner exception stack trace ---
   at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /Users/kyle/Projects/bitwarden/core/util/Setup/Program.cs:line 285
   at Bit.Setup.Program.Main(String[] args) in /Users/kyle/Projects/bitwarden/core/util/Setup/Program.cs:line 57

```

Don’t know where to look next…

Thx for any advice!

I also posted on r/bitwarden, but I’m unsure about wheter someone can help me there.

---

<div class="post-metadata">

**Author:** ![kspearrin](https://sea1.discourse-cdn.com/flex001/user_avatar/community.bitwarden.com/kspearrin/32/3_2.png) [@kspearrin](https://community.bitwarden.com/u/kspearrin)\
**Post date:** [July 20, 2018, 3:50pm UTC](https://community.bitwarden.com/t/unhandled-exception-system-data-sqlclient-sqlexception/1568/2 "2018-07-20T15:50:28Z")

</div>

The error is indicating that it cannot connect to the database for whatever reason. Is there some type of Firewall running on the server?

---

<div class="post-metadata">

**Author:** ![thisfro](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thisfro](https://community.bitwarden.com/u/thisfro)\
**Post date:** [July 20, 2018, 5:36pm UTC](https://community.bitwarden.com/t/unhandled-exception-system-data-sqlclient-sqlexception/1568/3 "2018-07-20T17:36:01Z")

</div>

Yes! There is `ufw` in place. Do I need to allow a specific port? A couple of standard ports, such as `80` or `443` are already open.

---

<div class="post-metadata">

**Author:** ![kspearrin](https://sea1.discourse-cdn.com/flex001/user_avatar/community.bitwarden.com/kspearrin/32/3_2.png) [@kspearrin](https://community.bitwarden.com/u/kspearrin)\
**Post date:** [July 20, 2018, 5:48pm UTC](https://community.bitwarden.com/t/unhandled-exception-system-data-sqlclient-sqlexception/1568/4 "2018-07-20T17:48:19Z")

</div>

Can you try disabling it temporarily to see if it solves the problem?

---

<div class="post-metadata">

**Author:** ![thisfro](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@thisfro](https://community.bitwarden.com/u/thisfro)\
**Post date:** [July 20, 2018, 5:55pm UTC](https://community.bitwarden.com/t/unhandled-exception-system-data-sqlclient-sqlexception/1568/5 "2018-07-20T17:55:06Z")

</div>

Same issue…  
Maybe port forwarding needs to be in place then?

docker ps output:  
`fb39aacfd89d bitwarden/mssql:1.20.0 "/entrypoint.sh" 15 minutes ago Restarting (1) 14 seconds ago bitwarden-mssql`

Restarting sometimes resolves this, but not always…

---

<div class="post-metadata">

**Author:** ![Nail1684](https://sea1.discourse-cdn.com/flex001/user_avatar/community.bitwarden.com/nail1684/32/47626_2.png) [@Nail1684](https://community.bitwarden.com/u/Nail1684)\
**Post date:** [January 22, 2026, 9:23pm UTC](https://community.bitwarden.com/t/unhandled-exception-system-data-sqlclient-sqlexception/1568/6 "2026-01-22T21:23:48Z")

</div>

Closed on January 22, 2026, 9:23pm UTC


