bitwarden / server

Bitwarden infrastructure/backend (API, database, Docker, etc).
https://bitwarden.com
Other
15.11k stars 1.26k forks source link

Error when trying to import passwords from LastPass #630

Closed mtnair closed 4 years ago

mtnair commented 4 years ago

Hey, I have a problem when importing passwords from LastPass to my bitwarden server. My vault is completely empty, I just set up the bitwarden server on my machine and tried to import the passwords. Then I get the following error: Error In my ./bwdata/logs/api/Api/<date>.txt log file I get the following output:

2019-12-31 03:39:25.909 +00:00 [Error] Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated.
System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
The statement has been terminated. ---> System.ComponentModel.Win32Exception (258): Unknown error 258
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlBulkCopy.RunParser(BulkCopySimpleResultSet bulkCopyHandler)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinuedOnSuccess(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsyncContinued(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.CopyBatchesAsync(BulkCopySimpleResultSet internalResults, String updateBulkCommandText, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestContinuedAsync(BulkCopySimpleResultSet internalResults, CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalRestAsync(CancellationToken cts, TaskCompletionSource`1 source)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServerInternalAsync(CancellationToken ctoken)
   at System.Data.SqlClient.SqlBulkCopy.WriteRowSourceToServerAsync(Int32 columnCount, CancellationToken ctoken)
   at System.Data.SqlClient.SqlBulkCopy.WriteToServer(DataTable table, DataRowState rowState)
   at Bit.Core.Repositories.SqlServer.CipherRepository.CreateAsync(IEnumerable`1 ciphers, IEnumerable`1 folders) in /home/appveyor/projects/server/src/Core/Repositories/SqlServer/CipherRepository.cs:line 501
   at Bit.Core.Services.CipherService.ImportCiphersAsync(List`1 folders, List`1 ciphers, IEnumerable`1 folderRelationships) in /home/appveyor/projects/server/src/Core/Services/Implementations/CipherService.cs:line 602
   at Bit.Api.Controllers.CiphersController.PostImport(ImportCiphersRequestModel model) in /home/appveyor/projects/server/src/Api/Controllers/CiphersController.cs:line 231
   at lambda_method(Closure , Object )
   at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
   at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()
ClientConnectionId:9d9589fe-3f58-4493-940a-d0bea47a417a
Error Number:-2,State:0,Class:11

I even tried to import a test passwort, which also didn't work:

url,username,password,extra,name,grouping,fav
https://google.com/,username,test123,,My Google,,0

A friend of mine installed bitwarden server on his machine, for him the import from LastPass worked without any problems. I don't think I did anything different. I'm running bitwarden on Debian Buster (10.2). Can someone help me please?

kspearrin commented 4 years ago

It seems that your SQL server container is timing out. Is it running properly? docker ps

mtnair commented 4 years ago
$ docker ps
CONTAINER ID        IMAGE                            COMMAND                  CREATED             STATUS                  PORTS                                                                                                                                        NAMES
954243d36e4a        bitwarden/nginx:1.32.0           "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   80/tcp, 0.0.0.0:8084->8080/tcp, 0.0.0.0:8444->8443/tcp                                                                                       bitwarden-nginx
139fcfb3a771        bitwarden/admin:1.32.0           "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   5000/tcp                                                                                                                                     bitwarden-admin
cf2af40457e0        bitwarden/attachments:1.32.0     "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   5000/tcp                                                                                                                                     bitwarden-attachments
bef2ab71f400        bitwarden/icons:1.32.0           "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   5000/tcp                                                                                                                                     bitwarden-icons
26689a346cd4        bitwarden/notifications:1.32.0   "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   5000/tcp                                                                                                                                     bitwarden-notifications
28be178592e1        bitwarden/mssql:1.32.0           "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   1433/tcp                                                                                                                                     bitwarden-mssql
fa1c734ff20a        bitwarden/api:1.32.0             "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   5000/tcp                                                                                                                                     bitwarden-api
469e97324eb8        bitwarden/events:1.32.0          "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   5000/tcp                                                                                                                                     bitwarden-events
671f246c65c1        bitwarden/identity:1.32.0        "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   5000/tcp                                                                                                                                     bitwarden-identity
22776ae19149        bitwarden/web:2.12.0             "/entrypoint.sh"         10 hours ago        Up 10 hours (healthy)   5000/tcp                                                                                                                                     bitwarden-web
ab7cb5086711        robbertkl/ipv6nat                "/docker-ipv6nat-com…"   6 weeks ago         Up 5 weeks                                                                                                                                                           mailcowdockerized_ipv6nat-mailcow_1
75f22ee80ab3        mailcow/rspamd:1.55              "/docker-entrypoint.…"   6 weeks ago         Up 4 weeks                                                                                                                                                           mailcowdockerized_rspamd-mailcow_1
060d663e54a7        mailcow/acme:1.63                "/sbin/tini -g -- /s…"   6 weeks ago         Up 5 weeks                                                                                                                                                           mailcowdockerized_acme-mailcow_1
5fab01eed54c        nginx:mainline-alpine            "/bin/sh -c 'envsubs…"   6 weeks ago         Up 16 hours             127.0.0.1:8083->8083/tcp, 80/tcp, 127.0.0.1:8443->8443/tcp                                                                                   mailcowdockerized_nginx-mailcow_1
12bb781f077d        mailcow/netfilter:1.31           "python3 -u /server.…"   6 weeks ago         Up 5 weeks                                                                                                                                                           mailcowdockerized_netfilter-mailcow_1
e02f9bc705d6        mailcow/phpfpm:1.54              "/docker-entrypoint.…"   6 weeks ago         Up 5 weeks              9000/tcp                                                                                                                                     mailcowdockerized_php-fpm-mailcow_1
aff8dd2d68b8        mailcow/solr:1.7                 "docker-entrypoint.s…"   6 weeks ago         Up 5 weeks              127.0.0.1:18983->8983/tcp                                                                                                                    mailcowdockerized_solr-mailcow_1
607cde1b5e8f        memcached:alpine                 "docker-entrypoint.s…"   6 weeks ago         Up 5 weeks              11211/tcp                                                                                                                                    mailcowdockerized_memcached-mailcow_1
46a46e9138ce        mailcow/olefy:1.2                "python3 -u /app/ole…"   6 weeks ago         Up 5 weeks                                                                                                                                                           mailcowdockerized_olefy-mailcow_1
bfc8e6251f4d        mailcow/unbound:1.9              "/docker-entrypoint.…"   6 weeks ago         Up 5 weeks              53/tcp, 53/udp                                                                                                                               mailcowdockerized_unbound-mailcow_1
c1be96e41dc0        redis:5-alpine                   "docker-entrypoint.s…"   6 weeks ago         Up 5 weeks              6379/tcp                                                                                                                                     mailcowdockerized_redis-mailcow_1
951ffb2adc5f        mailcow/sogo:1.62                "/bin/sh -c 'exec /u…"   6 weeks ago         Up 4 weeks                                                                                                                                                           mailcowdockerized_sogo-mailcow_1
dd2f2136b6ba        mariadb:10.3                     "docker-entrypoint.s…"   6 weeks ago         Up 5 weeks              127.0.0.1:13306->3306/tcp                                                                                                                    mailcowdockerized_mysql-mailcow_1
2b03cb6821b3        mailcow/postfix:1.42             "/bin/sh -c 'exec /u…"   6 weeks ago         Up 16 hours             0.0.0.0:25->25/tcp, 0.0.0.0:465->465/tcp, 0.0.0.0:587->587/tcp, 588/tcp                                                                      mailcowdockerized_postfix-mailcow_1
ca17bb27f3ed        mailcow/clamd:1.32               "/sbin/tini -g -- /c…"   6 weeks ago         Up 2 hours                                                                                                                                                           mailcowdockerized_clamd-mailcow_1
2a5e1bbd3d70        mailcow/dovecot:1.97             "/docker-entrypoint.…"   6 weeks ago         Up 16 hours             0.0.0.0:110->110/tcp, 0.0.0.0:143->143/tcp, 0.0.0.0:993->993/tcp, 0.0.0.0:995->995/tcp, 0.0.0.0:4190->4190/tcp, 127.0.0.1:19991->12345/tcp   mailcowdockerized_dovecot-mailcow_1
5acb16b7750d        mailcow/dockerapi:1.36           "python3 -u /app/doc…"   6 weeks ago         Up 5 weeks                                                                                                                                                           mailcowdockerized_dockerapi-mailcow_1
c5084ae2fece        mailcow/watchdog:1.61            "/bin/sh -c '/watchd…"   6 weeks ago         Up 5 weeks                                                                                                                                                           mailcowdockerized_watchdog-mailcow_1

mssql seems to work fine. I am running a mailcow instance on my server using docker, too. Might this be a problem?

kspearrin commented 4 years ago

I am not sure. Maybe try stopping everything except Bitwarden and see if that changes anything?

mtnair commented 4 years ago

tl;dr What can I say... I just tried different approaches with mailcow stopped and bitwarden running, or mailcow and bitwarden running, it now always worked without any SQL server timeouts. I have no clue...

My procedure: [at this point in the history, importing passwords was not possible]

Thank you anyways!