# \[SOLVED\] Android client can’t sync

**URL:** <https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358>\
**Category:** Help\
**Created:** [October 9, 2020, 1:02am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358 "2020-10-09T01:02:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 9, 2020, 1:02am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/1 "2020-10-09T01:02:23Z")

</div>

Hi, I’m a new Bitwarden\_rs user trying to migrate our current password system.

The current installed versions are:

- Web Vault: 2.15.1
- Bitwarden\_rs: 1.16.3

I’ve followed the [solution from this thread](https://vaultwarden.discourse.group/t/solved-android-client-cant-sync-vault/200/6), by installing sequentially all the android versions down to version 2.4.0, and in all cases it prompted a sync error.

The app is getting responde (200) on connection and response (400) on sync. This is how it looks in the access log:

```
xxx.xxx.xxx.xxx - - [09/Oct/2020:01:38:50 +0100] "POST /api/accounts/prelogin HTTP/1.1" 200 32 "-" "Bitwarden_Mobile/2.4.0 (Android 8.1.0; SDK 27; Model xxx)"
xxx.xxx.xxx.xxx - - [09/Oct/2020:01:38:56 +0100] "POST /identity/connect/token HTTP/1.1" 200 3254 "-" "Bitwarden_Mobile/2.4.0 (Android 8.1.0; SDK 27; Model xxx)"
xxx.xxx.xxx.xxx - - [09/Oct/2020:01:38:56 +0100] "GET /api/sync HTTP/1.1" 400 226 "-" "-"                                                                            
xxx.xxx.xxx.xxx - - [09/Oct/2020:01:38:57 +0100] "PUT /api/devices/identifier/776cde62-f4b8-415c-a6d6-5e06d16b26d8/token HTTP/1.1" 400 226 "-" "-"                   
xxx.xxx.xxx.xxx - - [09/Oct/2020:01:39:29 +0100] "GET /api/sync HTTP/1.1" 400 226 "-" "-"                                                                            
xxx.xxx.xxx.xxx - - [09/Oct/2020:01:40:51 +0100] "GET /notifications/hub?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJuYmYiOjE2MDIyMDEyNzcsImV4cCI6MTYwMjIwODQ3NywiaXNzIjoiaHR0cDovL3ZhdWx0LmZyZWVuZXIubmV0fGxvZ2luIiwic3ViIjoiZWQ2YTczZTgtOTE5NC00YjQyLTgyMWEtNjNmZTExZjFjZTI4IiwicHJlbWl1bSI6dHJ1ZSwibmFtZSI6IlNpbW9uIiwiZW1haWwiOiJzaW1vbkBzbWFydGh5LmNvbSIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJvcmdvd25lciI6WyIwYjIyYTA2MC02MzEyLTRiNzctOTVkNi0yZDYyMmI5NDNmNWEiLCI5Zjc3MmZjNC0zMThiLTQyMWMtODRhOC04MjNkY2Y3ZDU2ZDAiLCJiYTdlZDQyZi1kYjZjLTQyN2MtOTRiNi05YTI0NjFlNmRmMWYiXSwib3JnYWRtaW4iOltdLCJvcmd1c2VyIjpbXSwib3JnbWFuYWdlciI6W10sInNzdGFtcCI6ImI1NDIxNmNiLWI3OTItNDY3Yi1hZDBmLWIzYWUwYjU3YzA4NiIsImRldmljZSI6ImMwM2VkZDY4LWVjZDgtNDJmZC05NTM2LTA2ZDY5Y2UwZDZlOSIsInNjb3BlIjpbImFwaSIsIm9mZmxpbmVfYWNjZXNzIl0sImFtciI6WyJBcHBsaWNhdGlvbiJdfQ.ip2ChSZXv7y7khbh-8X-_FDRyuplZqeevDrhiSvUj1SqsUd3NaFBY11pSOVJ1OihHuqbtzlJE2fQnLYq7Sa2yyzmc_vuUtyNrDfF_SCB9aj8OEsEioWu3ukMdhEvgjy6BEuuype19JMF_QGFmJ93Pg3a68sUe9H0I98FhRh5GYFqDHkGlasAYybRs2DzDaFYo-sWmdfaMls4BTVyI3mBbw4ma9R85jjmcBzZMZvZOkBH0Th651o_k4qnQPeX" 414 170 "-" "-"

```

Hope to get through this last hurdle in order to have the system up and running.  
Thanks!

---

<div class="post-metadata">

**Author:** ![gpopesc](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/gpopesc/32/36_2.png) [@gpopesc](https://vaultwarden.discourse.group/u/gpopesc)\
**Post date:** [October 9, 2020, 5:35pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/2 "2020-10-09T17:35:12Z")

</div>

Did you put your server in the settings(top left corner, before you login) ? Can you login on browsers? Can you login in browser 's plugins?

---

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 9, 2020, 6:16pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/3 "2020-10-09T18:16:10Z")

</div>

Yes, that’s right. I’ve set up the custom server in the top-left corner setting. And the synchronisation works fine on Firefox/Chrome/Brave plugins and extensions.

Using the Bitwarden linux desktop application works fine too.

The syncing error only happens when I try to set up the Android app.

---

<div class="post-metadata">

**Author:** ![gpopesc](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/gpopesc/32/36_2.png) [@gpopesc](https://vaultwarden.discourse.group/u/gpopesc)\
**Post date:** [October 9, 2020, 6:55pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/4 "2020-10-09T18:55:31Z")

</div>

Strange, I have no idea why android app is not working. Try to ping your server or login from a browser from android. It seems that somehow Android block your server. Did you use an adblock/vpn/proxy from android? As a work around, if all above are OK, try to use Firefox nightly(search how to add your extensions) or kiwi browser where you can add the plug in.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 9, 2020, 8:09pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/5 "2020-10-09T20:09:05Z")

</div>

Im running android Version: 2.6.2 (3206) and using the very latest version via the `testing` docker tag.

With an nginx reverse proxy which handles the SSL.  
I can’t reproduce this error at all.

Also, do you see anything in the logs of bitwarden at all during the crash?

---

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 9, 2020, 10:28pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/6 "2020-10-09T22:28:05Z")

</div>

Thanks for following up. The following tests have pushed the issue one step further (hope so!).  
I’ll report in detail what I’ve done in case it’s useful to someone else that might suffer this issue:

1. I connect the Android device straight away with no adblock/proxy/vpn/firewall.

2. Pinging the server from Android device is fine. It shows consistent 50ms time and no packet lost.

3. The vault loads fine if I login from the Android browser app.

4. I installed Kiwi Browser and the Bitwarden extension. I can log in and sync perfectly through the extension.

5. I reinstalled 2 versions of the Android app (v.2.5.6 and v.2.6.1). I downloaded the packages from here: [https://github.com/bitwarden/mobile/releases](https://github.com/bitwarden/mobile/releases) (filename com.x8bit.bitwarden.apk)

On launching the app, I click the top-left icon and set my custom URL, as I do in the PC. Then I proceed to log in and the server allows the connection.

This is how it looks the accepted connection from the logs perspective:

> ```
> tail -n 10 bitwarden_nginx_access.log
> 
> xxx.xxx.xxx.xxx - - [09/Oct/2020:22:03:42 +0100] "POST /api/accounts/prelogin HTTP/1.1" 200 32 "-" "Bitwarden_Mobile/2.6.1 (Android 8.1.0; SDK 27; Model xxx)"                                                                                                                                                                  
> xxx.xxx.xxx.xxx - - [09/Oct/2020:22:03:44 +0100] "POST /identity/connect/token HTTP/1.1" 200 3254 "-" "Bitwarden_Mobile/2.6.1 (Android 8.1.0; SDK 27; Model xxx)"                                                                                                                                                               
> xxx.xxx.xxx.xxx - - [09/Oct/2020:22:03:45 +0100] "GET /api/sync HTTP/1.1" 400 226 "-" "-"                                                                            
> xxx.xxx.xxx.xxx - - [09/Oct/2020:22:03:46 +0100] "PUT /api/devices/identifier/80bd067c-f487-4567-b805-c8300fd4aeff/token HTTP/1.1" 400 226 "-" "-"  
> 
> ```

> ```
> tail -n 10 bitwarden.log
>   
> [2020-10-09 22:03:42.520][request][INFO] POST /api/accounts/prelogin
> [2020-10-09 22:03:42.521][response][INFO] POST /api/accounts/prelogin (prelogin) => 200 OK
> [2020-10-09 22:03:44.562][request][INFO] POST /identity/connect/token
> [2020-10-09 22:03:44.878][bitwarden_rs::api::identity][INFO] User xxx@gmail.com logged in successfully. IP: xxx.xxx.xxx.xxx
> [2020-10-09 22:03:44.879][response][INFO] POST /identity/connect/token (login) => 200 OK
> 
> ```

> ```
> journalctl -n 10 -u bitwarden.service
> 
> Oct 09 22:03:42 hostname bitwarden_rs[313987]: [2020-10-09 22:03:42.520][request][INFO] POST /api/accounts/prelogin                                                   
> Oct 09 22:03:42 hostname bitwarden_rs[313987]: [2020-10-09 22:03:42.521][response][INFO] POST /api/accounts/prelogin (prelogin) => 200 OK                             
> Oct 09 22:03:44 hostname bitwarden_rs[313987]: [2020-10-09 22:03:44.562][request][INFO] POST /identity/connect/token                                                  
> Oct 09 22:03:44 hostname bitwarden_rs[313987]: [2020-10-09 22:03:44.878][bitwarden_rs::api::identity][INFO] User xxx@gmail.com logged in successfully. IP: xxx.xxx.xxx.xxx
> Oct 09 22:03:44 hostname bitwarden_rs[313987]: [2020-10-09 22:03:44.879][response][INFO] POST /identity/connect/token (login) => 200 OK
> 
> ```

Now, I’m logged in the Android app. It doesn’t contain any key, and therefore go to `Settings > Sync` and click on the Sync button.  
This is how the logs report the failed sync attempt:

> ```
> tail -n 10 bitwarden_nginx_access.log
> 
> xxx.xxx.xxx.xxx - - [09/Oct/2020:22:22:19 +0100] "GET /api/sync HTTP/1.1" 400 226 "-" "-"  
> 
> ```

> ```
> tail -n 10 bitwarden.log
>   
> Doesn't log anything related to the sync attempt.
> 
> ```

> ```
> journalctl -n 10 -u bitwarden.service
> 
> Doesn't log anything related to the sync attempt.
> 
> ```

In contrast, this is what gets logged whenever I hit the sync button on the browser plugin (It syncs just fine):

> ```
> tail -n 10 bitwarden_nginx_access.log
> 
> xxx.xxx.xxx.xxx - - [09/Oct/2020:22:26:35 +0100] "GET /api/sync HTTP/2.0" 200 63082 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"  
> 
> ```

> ```
> tail -n 10 bitwarden.log
>   
> [2020-10-09 22:26:35.266][request][INFO] GET /api/sync
> [2020-10-09 22:26:35.280][response][INFO] GET /api/sync?<data..> (sync) => 200 OK
> 
> ```

> ```
> journalctl -n 10 -u bitwarden.service
> 
> Oct 09 22:26:35 figtree bitwarden_rs[313987]: [2020-10-09 22:26:35.266][request][INFO] GET /api/sync                                                                
> Oct 09 22:26:35 figtree bitwarden_rs[313987]: [2020-10-09 22:26:35.280][response][INFO] GET /api/sync?<data..> (sync) => 200 OK
> 
> ```

Please notice that while Nginx logs both failed/accepted sync attempts, bitwarden service in contrast just logs the accepted attempt.

Then I caught on a little detail:

- The Android App does the connection and syncing using HTTP1.1 protocol: `GET /api/sync HTTP/1.1`
- While the browser plugins/apps are syncing using HTTP2 protocol: `GET /api/sync HTTP/2.0`. The Bitwarden extension on Kiwi browser running under Android also uses HTTP2 protocol.

That apparently points to the Nginx configuration, isn’t it?  
At first sight, I see two potential candidates to address this issue:

Nginx general configuration file:

> ```
> cat /etc/nginx/nginx.conf | grep ssl_protocols
> 
> ssl_protocols TLSv1.2 TLSv1.3;
> 
> ```

Vault vhost file:

> ```
> cat /etc/nginx/sites-available/vault | grep 'listen 443'
> 
> listen 443 ssl http2;
> 
> ```

I’m under the impression that here could lie the key to solve the issue.  
But I’m not fully sure how to deal with that, because on one hand the server accepts the HTTP1.1 login request from the Android app but denies the HTTP1.1 sync request. While all HTTP2 requests go through without issues.  
Any hints?

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 10, 2020, 8:43am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/7 "2020-10-10T08:43:38Z")

</div>

@iamb, i don’t think that has anything to do with it. I have the same setup as you. I don’t know if you also have ssl from nginx to bitwardenrs, but that is not what i have.

I also see HTTP1.1 from the android client which works fine, no crash what so ever.

The only difference i see is that i have version 2.6.2 (beta) running instead of 2.6.1, but looking at the changes, i can’t say that i see anything which indicates as something fixed.

What kind of certificate do you have? And ciphers?  
If you test your site with [https://www.ssllabs.com/ssltest/](https://www.ssllabs.com/ssltest/) for example, does it give any errors, and what does it show at the client compatibility?

---

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 10, 2020, 11:33am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/8 "2020-10-10T11:33:22Z")

</div>

Ok, here’s the SSL test summary. It got an A score.  
I’ll send you the SSL test report link by PM, to avoid publishing sensible info over here.

 ![ssl-test](https://global.discourse-cdn.com/free1/uploads/vaultwarden/original/1X/5324333c159a92d193cd04477516f862cef347c8.png)

I don’t see any relevant red flags there. Only a couple of comments in orange color:

- DNS CAA No ([more info](https://blog.qualys.com/ssllabs/2017/03/13/caa-mandated-by-cabrowser-forum))
- TLS\_ECDHE\_RSA\_WITH\_AES\_128\_CBC\_SHA ( `0xc013` ) ECDH secp384r1 (eq. 7680 bits RSA) FS **WEAK** 128

What puzzles me is the fact that the Bitwarden Service doesn’t log the failed sync attempts, only the successful ones. Somehow that could point to Nginx impeding these request from being known by the Bitwarden Service. Isn’t it?  
Not sure where to dig at this point…

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 11, 2020, 11:18am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/9 "2020-10-11T11:18:22Z")

</div>

I see you are still using an old Bitwarden\_RS version.  
Could you please try to update to the very latest version, 1.17.0 (using web-vault 2.16.1).  
I think this could solve your issues, but i’m not sure.

Other then that, it all looks ok.

---

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 11, 2020, 9:10pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/10 "2020-10-11T21:10:04Z")

</div>

Hi, I’ve updated to the latest version. I restarted the service and I can see in the service log that the new version is up and running: **Bitwarden\_rs: Version 1.17.0-257b143d**

The web vault is also displaying the latest version: **2.16.1**

Unfortunately the issue remains the same.

I login/sync from any browser extension or desktop app, and the connection goes through flawlessly.  
Now from the Android App, I get to login with no issues but the sync is being rejected.  
I installed the latest Android app available at:  
`https://github.com/bitwarden/mobile/releases/download/v2.6.1/com.x8bit.bitwarden.apk`

Here are the logs from the connection and the sync attempts:  
From Nginx point of view:

> ```
> tail -n 10 bitwarden_nginx_access.log
> 
> ```

> ```
> xxx.xxx.xxx.xxx - - [11/Oct/2020:21:23:38 +0100] "POST /api/accounts/prelogin HTTP/1.1" 200 32 "-" "Bitwarden_Mobile/2.6.1 (Android 8.1.0; SDK 27; Model xxx)"
> xxx.xxx.xxx.xxx - - [11/Oct/2020:21:23:41 +0100] "POST /identity/connect/token HTTP/1.1" 200 3254 "-" "Bitwarden_Mobile/2.6.1 (Android 8.1.0; SDK 27; Model xxx)"
> xxx.xxx.xxx.xxx - - [11/Oct/2020:21:23:41 +0100] "GET /api/sync HTTP/1.1" 400 226 "-" "-" 
> xxx.xxx.xxx.xxx - - [11/Oct/2020:21:23:43 +0100] "PUT /api/devices/identifier/48023035-730f-4581-b36b-b48de0259a18/token HTTP/1.1" 400 226 "-" "-"                    
> xxx.xxx.xxx.xxx - - [11/Oct/2020:21:23:49 +0100] "GET /notifications/hub?access_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJuYmYiOjE2MDI0NDc0MjcsImV4cCI6MTYwMjQ1NDYyNywiaXNzIjoiaHR0cHM6Ly92YXVsdC5mcmVlbmVyLm5ldHxsb2dpbiIsInN1YiI6ImVkNmE3M2U4LTkxOTQtNGI0Mi04MjFhLTYzZmUxMWYxY2UyOCIsInByZW1pdW0iOnRydWUsIm5hbWUiOiJTaW1vbiIsImVtYWlsIjoic2ltb25Ac21hcnRoeS5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwib3Jnb3duZXIiOlsiMGIyMmEwNjAtNjMxMi00Yjc3LTk1ZDYtMmQ2MjJiOTQzZjVhIiwiOWY3NzJmYzQtMzE4Yi00MjFjLTg0YTgtODIzZGNmN2Q1NmQwIiwiYmE3ZWQ0MmYtZGI2Yy00MjdjLTk0YjYtOWEyNDYxZTZkZjFmIl0sIm9yZ2FkbWluIjpbXSwib3JndXNlciI6W10sIm9yZ21hbmFnZXIiOltdLCJzc3RhbXAiOiJiNTQyMTZjYi1iNzkyLTQ2N2ItYWQwZi1iM2FlMGI1N2MwODYiLCJkZXZpY2UiOiI5ZGVhNzI5ZC1hOWFhLTQ4ZDItOGM2OS1kZDU4ZTZkMGVhZmMiLCJzY29wZSI6WyJhcGkiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsiQXBwbGljYXRpb24iXX0.EbnPLC7y-RiC3AreBL4eRm9EQ_CYknPNPNHqB2I9Q1CABlPPeFiqC7nwcJfCIV357hkg0iEDCzpF7HdV82heuvYRNbPt47OMh3_xSQhLWmhCvvP1vY0HXVLxIv4O3nmYHRtDXSaaA3xzhvp0rRSzlL7JiEcRCON8zgl9zfg5KDVkR6Nb_zAwUqwl3uxGtBfSrTuQ_ljuC4tGJAq36rwyLHbf1oCPKRZuPYuga1xDHRXyFixLvdGNitSLldN" 414 170 "-" "-"                                                                            
> xxx.xxx.xxx.xxx - - [11/Oct/2020:21:24:28 +0100] "GET /api/sync HTTP/1.1" 400 226 "-" "-"
> 
> ```

From Bitwarden\_rs Log point of view the login shows fine. But notice that there’s no reference to the failed syncing:

> ```
> tail -n 10 bitwarden.log
> 
> [2020-10-11 21:21:36.853][request][INFO] GET /api/accounts/profile
> [2020-10-11 21:21:36.854][response][INFO] GET /api/accounts/profile (profile) => 200 OK
> [2020-10-11 21:23:38.897][request][INFO] POST /api/accounts/prelogin
> [2020-10-11 21:23:38.897][response][INFO] POST /api/accounts/prelogin (prelogin) => 200 OK
> [2020-10-11 21:23:40.916][request][INFO] POST /identity/connect/token
> [2020-10-11 21:23:41.248][bitwarden_rs::api::identity][INFO] User xxx@gmail.com logged in successfully. IP: xxx.xxx.xxx.xxx
> [2020-10-11 21:23:41.249][response][INFO] POST /identity/connect/token (login) => 200 OK
> 
> ```

While successful sync attempts from browser/desktop show as follows in bitwarden.log:

> ```
> tail -n 10 bitwarden.log | grep sync
> 
> [2020-10-11 21:17:37.352][request][INFO] GET /api/sync
> [2020-10-11 21:17:37.364][response][INFO] GET /api/sync?<data..> (sync) => 200 OK
> 
> ```

From the Bitwarden\_rs Service perspective, same thing. Successful login but no reference to the failed sync attempt:

> ```
> journalctl -n 10 -u bitwarden.service
> 
> Oct 11 21:23:38 hostname bitwarden_rs[341645]: [2020-10-11 21:23:38.897][request][INFO] POST /api/accounts/prelogin
> Oct 11 21:23:38 hostname bitwarden_rs[341645]: [2020-10-11 21:23:38.897][response][INFO] POST /api/accounts/prelogin (prelogin) => 200 OK
> Oct 11 21:23:40 hostname bitwarden_rs[341645]: [2020-10-11 21:23:40.916][request][INFO] POST /identity/connect/token
> Oct 11 21:23:41 hostname bitwarden_rs[341645]: [2020-10-11 21:23:41.248][bitwarden_rs::api::identity][INFO] User xxx@gmail.com logged in successfully. IP: xxx.xxx.xxx.xxx
> Oct 11 21:23:41 hostname bitwarden_rs[341645]: [2020-10-11 21:23:41.249][response][INFO] POST /identity/connect/token (login) => 200 OK
> 
> ```

While the successful sync attempts from browser/desktop show look like this:

> ```
> journalctl -n 10 -u bitwarden.service | grep sync
> 
> Oct 11 21:17:37 hostname bitwarden_rs[341645]: [2020-10-11 21:17:37.352][request][INFO] GET /api/sync
> Oct 11 21:17:37 hostname bitwarden_rs[341645]: [2020-10-11 21:17:37.364][response][INFO] GET /api/sync?<data..> (sync) => 200 OK
> 
> ```

To make sure that the phone is not the one causing the issue, I’ve installed the Android app in 2 different phones running Android 8 and Android 9.  
And I’ve tried the sync on both devices using wifi and data connections. The result is invariably unsuccessful.  
Therefore, we can rule out the phone or wifi settings from causing the issue.

I don’t know what else to try. My gut feeling tells me that Nginx might be the one causing the issue, because it logs both the successful and the failed attempts. Whilst the Bitwarden\_rs Service only logs the successful ones.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 11, 2020, 9:59pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/11 "2020-10-11T21:59:39Z")

</div>

I actually have had a similar issue described today by someone else. And found it could be a single cipher which is causing this issue.

If you open your vault in the web-vault, do you see any items which do not have a name?

Or could you manually check your database cipher table for any empty `name` column item? Or something not looking like an encrypted value.

---

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 12, 2020, 1:24am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/12 "2020-10-12T01:24:35Z")

</div>

Hi, I’ve explored the ciphers table in the SQLite database, and I see that all the values from the name column contain some (apparently) proper encrypted text.

The rest of columns also contain encrypted strings. The only unencryped data i see, are:

- Dates at ‘created\_at’
- Dates at 'updated\_at
- The columns **fields & data** contains some unencrypted strings which read like: Name, Response, Type, Value… But the text that follows is encrypted.
- The password\_history column shows strings like: LastUsedDate and Password. But the rest is encrypted.

Looking at the web-vault all the entries name look good.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 12, 2020, 7:01am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/13 "2020-10-12T07:01:15Z")

</div>

And what if you create a new account, and just put one entry in it and try to sync that one?  
Does that work?

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 12, 2020, 8:34am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/14 "2020-10-12T08:34:03Z")

</div>

Could you try the following please.  
Install and configure the bitwarden cli.  
Install the tool `jq`, most distro’s have that in there repo’s.  
Check if you can execute `bw list items` and get a bunch of data returned.  
If that works, execute the following.

```bash
bw list items | jq '.[] | select(.name==null)'

```

---

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 12, 2020, 10:05am UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/15 "2020-10-12T10:05:16Z")

</div>

Hi, I created a new user and it managed to sync successfully in Android and Desktop. That’s already an improvement!  
The logs don’t show anything special. It just logs/syncs fine.

For the sake of clarity, I’ll refer as `user1` to the one that can’t sync in Android  
and `user2` to the one that I just created and logged/synced fine in all devices.

`user2` owns a sample test key and I added `user2` to an organization whose owner is the first user we created. `user2` can sync on the shared items of the organization.  
But the issue with `user1` still remains. It still can’t sync in Android.

With regards to the second topic: I installed Bitwarden CLI as per the instructions posted here: `https://github.com/bitwarden/cli`

I also have `jq` installed.

Next I setup the bitwarden-cli and proceed to log in.  
`user1` logs in fine. But it cannot sync through cli.

When `user1` runs `bw sync` it outputs `Syncing complete.`  
`bw sync --last` outputs: `1970-01-01T00:00:00.000Z`  
`bw list items` outputs: `[]`  
And `bw list items | jq '.[] | select(.name==null)'` outputs nothing.

The logs reports the same kind of errors posted above.  
Here’s the nginx log. First I successfully login/sync `user2` and then I proceed with `user1`:

> ```
> tail -n 10 bitwarden_nginx_access.log
> 
> ```

Here’s the successful login/sync from `user2`:

> ```
> xxx.xxx.xxx.xxx - - [12/Oct/2020:10:40:55 +0100] "POST /api/accounts/prelogin HTTP/1.1" 200 58 "-" "Bitwarden_CLI/1.12.1 (LINUX)"                                    
> xxx.xxx.xxx.xxx - - [12/Oct/2020:10:40:56 +0100] "POST /identity/connect/token HTTP/1.1" 200 2458 "-" "Bitwarden_CLI/1.12.1 (LINUX)"                                 
> xxx.xxx.xxx.xxx - - [12/Oct/2020:10:40:56 +0100] "GET /api/sync?excludeDomains=true HTTP/1.1" 200 13448 "-" "Bitwarden_CLI/1.12.1 (LINUX)"                           
> xxx.xxx.xxx.xxx - - [12/Oct/2020:10:41:10 +0100] "GET /api/accounts/revision-date HTTP/1.1" 200 13 "-" "Bitwarden_CLI/1.12.1 (LINUX)
> 
> ```

Here’s the failed sync from `user1`:

> ```
> xxx.xxx.xxx.xxx - - [12/Oct/2020:10:42:20 +0100] "POST /api/accounts/prelogin HTTP/1.1" 200 58 "-" "Bitwarden_CLI/1.12.1 (LINUX)"                                     
> xxx.xxx.xxx.xxx - - [12/Oct/2020:10:42:21 +0100] "POST /identity/connect/token HTTP/1.1" 200 2517 "-" "Bitwarden_CLI/1.12.1 (LINUX)"                                  
> xxx.xxx.xxx.xxx - - [12/Oct/2020:10:42:21 +0100] "GET /api/sync?excludeDomains=true HTTP/1.1" 400 226 "-" "Bitwarden_CLI/1.12.1 (LINUX)"                                                                                     
> xxx.xxx.xxx.xxx - - [12/Oct/2020:10:42:33 +0100] "GET /api/sync?excludeDomains=true HTTP/1.1" 400 226 "-" "Bitwarden_CLI/1.12.1 (LINUX)"
> 
> ```

Therefore, it looks like the issue is connected with `user1`.  
When I check the `DB table users` I see 2 records. Both appear to have the same kind of data in all the fields. Nothing strange there that catches my eye.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 12, 2020, 5:05pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/16 "2020-10-12T17:05:18Z")

</div>

Ah, there is something catching my eye now.  
Its during the domain sync. Do you have custom domains rules configured for user1?

---

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 12, 2020, 5:48pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/17 "2020-10-12T17:48:24Z")

</div>

No, I haven’t setup any domain rules at Bitwarden.  
If I go to `Settings > Domain rules` I see some default global rules, starting ameritrade and ending yandex.  
Both users have the same settings over there.

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 12, 2020, 5:55pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/18 "2020-10-12T17:55:55Z")

</div>

What i do find strange is that you get returned that the sync is done on `1970-01-01T00:00:00.000Z`.  
Does that happens also a second time?

On what systems do you have bitwarden\_rs running?  
And on what system do you execute that bw command?

---

<div class="post-metadata">

**Author:** ![BlackDex](https://yyz2.discourse-cdn.com/free1/user_avatar/vaultwarden.discourse.group/blackdex/32/8_2.png) [@BlackDex](https://vaultwarden.discourse.group/u/BlackDex)\
**Post date:** [October 12, 2020, 6:27pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/19 "2020-10-12T18:27:06Z")

</div>

Oke @iamb, my jq skills are very rusty ;).  
So could you try this:

```bash
bw list items | jq '.[]' | grep --color -B10 -A20 '"match": 5'

```

And check if there are many items with that.

---

<div class="post-metadata">

**Author:** ![iamb](https://avatars.discourse-cdn.com/v4/letter/i/90db22/32.png) [@iamb](https://vaultwarden.discourse.group/u/iamb)\
**Post date:** [October 12, 2020, 7:52pm UTC](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358/20 "2020-10-12T19:52:49Z")

</div>

Yes, I just logged in again from cli, did the `sync` and `bw sync --last` returns the same date: `1970-01-01T00:00:00.000Z`.

I’m running bitwarden\_rs service on a Ubuntu Server.  
And I’m connecting through the CLI from a desktop machine running Arch Linux.

Running the command:

> ```
> bw list items | jq '.[]' | grep --color -B10 -A20 '"match": 5'
> 
> ```

Outputs nothing at all. But the reason is because there are no items synced in user1 through cli.

> ```
> bw list items
> 
> ```

That simply returns an empty `[]` response

[Next page](https://vaultwarden.discourse.group/t/solved-android-client-can-t-sync/358.md?page=2)
