"Vault not found" in Android App

Hello,

I’m trying to open my vaults in Android. They are located in Google Drive. They load fine in Windows via Drive File Stream and Cyberduck, so I really suspect this is specific to the Android app. The vaults are on the path “/Vaults/<vault_name>/masterkey.cryptomator”. Whenever I try to unlock a vault, I get a message saying “Vault not found, it has been renamed, moved, or deleted”. I saw other topics showing this to be related to the vault being in the root directory, but I don’t believe that applies here, unless I am misunderstanding? FWIW I have been using the app successfully for years; this is a recent development and I don’t believe anything changed in my setup.

Thanks,
Dan

Hey and welcome to the Cryptomator Community :slightly_smiling_face:,

You didn’t move/rename the vaults in the cloud?

If you remove one of these vaults from the app and re-add it, can you open that vault again?

Can you enable debug mode, try to unlock a vault with the message “Vault not found” and send us the logs: How do I enable debug mode on Android?

No, the problem with the root directory can be recognized, among other things, by the fact that the name of the vault is empty. That actually does not fit here.

You didn’t move/rename the vaults in the cloud?

No, they have not moved

If you remove one of these vaults from the app and re-add it, can you open that vault again?

Yeah, I’ve tried that a few times with all my vaults, no dice.

Can you enable debug mode, try to unlock a vault with the message “Vault not found” and send us the logs: How do I enable debug mode on Android?

Just sent them, let me know if you need more or anything

Thanks!

Thanks for the log file and further information.

The log file only verifies what the dialog says, that the masterkey.cryptomator file could not be found. However, if you deleted the vault, managed to add it again and were able to click on masterkey.cryptomator file, which is necessary to add a vault, that file must be in the cloud.

Caused by: org.cryptomator.domain.exception.NoSuchCloudFileException: masterkey.cryptomator
	at org.cryptomator.data.cloud.googledrive.GoogleDriveCloudContentRepository$Intercepted.read(GoogleDriveCloudContentRepository.java:181)
	at org.cryptomator.data.cloud.googledrive.GoogleDriveCloudContentRepository$Intercepted.read(GoogleDriveCloudContentRepository.java:71)
	at org.cryptomator.data.cloud.InterceptingCloudContentRepository.read(InterceptingCloudContentRepository.java:176)
	at org.cryptomator.data.repository.DispatchingCloudContentRepository.read(DispatchingCloudContentRepository.java:177)
	at org.cryptomator.data.cloud.crypto.CryptoCloudFactory.readKeyFileData(CryptoCloudFactory.java:142)
	at org.cryptomator.data.cloud.crypto.CryptoCloudFactory.createUnlockToken(CryptoCloudFactory.java:99)
	at org.cryptomator.data.cloud.crypto.CryptoCloudFactory.createUnlockToken(CryptoCloudFactory.java:95)
	at org.cryptomator.data.repository.CloudRepositoryImpl.prepareUnlock(CloudRepositoryImpl.java:108)
	at org.cryptomator.domain.usecases.vault.PrepareUnlock.execute(PrepareUnlock.java:26)

We took this issue as an opportunity to implement better logging for Google Drive, so that we should be able to get to the bottom of the problem. We will contact you as soon as this version is available.

@jewishdan18 could you please retest using the latest version (1.5.12 or 1.5.13-beta1) with enabled debug mode and send us the log file?

Alright, I’m on 1.5.12 and just sent the logs. I had two separate issues this time; one vault said there was an error when unlocking, and the other persisted with saying it was moved. I included both in the logs

First, the one with the error:

D	20210223120132.107	PrepareUnlockUseCase	started 4fd58a86
...
D	20210223120132.124	GoogleDriveClient	-------------- REQUEST  --------------
GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'Vaults'%20and%20'root'%20in%20parents%20and%20trashed%20%3D%20false%20or%20sharedWithMe&supportsAllDrives=true
Accept-Encoding: gzip
Authorization: <Not Logged>
User-Agent: Cryptomator-Android/1.5.12 Google-API-Java-Client/1.31.2 Google-HTTP-Java-Client/1.38.1 (gzip)
x-goog-api-client: gl-java/0.0.0 gdcl/1.31.2 linux/4.9.186

---

D	20210223120201.178	GoogleDriveClient	-------------- RESPONSE --------------
500 Internal Server Error
Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: private, max-age=0
Content-Encoding: gzip
Content-Security-Policy: frame-ancestors 'self'
Content-Type: application/json; charset=UTF-8
Date: Tue, 23 Feb 2021 17:02:02 GMT
Expires: Tue, 23 Feb 2021 17:02:02 GMT
Server: GSE
Transfer-Encoding: chunked
Vary: Origin
Vary: X-Origin
X-Android-Received-Millis: 1614099721174
X-Android-Response-Source: NETWORK 500
X-Android-Selected-Protocol: http/1.1
X-Android-Sent-Millis: 1614099692125
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block

D	20210223120201.194	PrepareUnlockUseCase	failed 4fd58a86
D	20210223120201.196	ExceptionHandler	Unexpected error
org.cryptomator.domain.exception.FatalBackendException: com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error
GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'Vaults'%20and%20'root'%20in%20parents%20and%20trashed%20%3D%20false%20or%20sharedWithMe&supportsAllDrives=true
{
  "code": 500,
  "errors": [
    {
      "domain": "global",
      "message": "Internal Error",
      "reason": "internalError"
    }
  ],
  "message": "Internal Error"
}

Later we get to the same request a valid response:

D	20210223121424.312	PrepareUnlockUseCase	started 4fdd750c
D	20210223121424.391	GoogleDriveClient	-------------- REQUEST  --------------
GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'Vaults'%20and%20'root'%20in%20parents%20and%20trashed%20%3D%20false%20or%20sharedWithMe&supportsAllDrives=true
Accept-Encoding: gzip
Authorization: <Not Logged>
User-Agent: Cryptomator-Android/1.5.12 Google-API-Java-Client/1.31.2 Google-HTTP-Java-Client/1.38.1 (gzip)
x-goog-api-client: gl-java/0.0.0 gdcl/1.31.2 linux/4.9.186

V	20210223121431.740	Progress	UNKNOWN_MIMETYPE -1%
D	20210223121447.339	GoogleDriveClient	-------------- RESPONSE --------------
200 OK
Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Content-Encoding: gzip
Content-Security-Policy: frame-ancestors 'self'
Content-Type: application/json; charset=UTF-8
Date: Tue, 23 Feb 2021 17:14:48 GMT
Expires: Mon, 01 Jan 1990 00:00:00 GMT
Pragma: no-cache
Server: GSE
Transfer-Encoding: chunked
Vary: Origin
Vary: X-Origin
X-Android-Received-Millis: 1614100487336
X-Android-Response-Source: NETWORK 200
X-Android-Selected-Protocol: http/1.1
X-Android-Sent-Millis: 1614100464392
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
...

HTTP status code 500 is really bad, that means the server has encountered a situation it doesn’t know how to handle. I’ll re check our requests that they 1:1 fit with the documentation but even when they would be wrong or something else is bad on the client side, the server in this case Google must not get into the situation of not knowing what is going on. Furthermore, I have not seen such 500 status codes at google drive yet, that’s really strange.


Regarding the moved vault:

If I’m not wrong you tried to unlock a vault with the name Vault in the root of your google drive? Can you please open your browser, open https://drive.google.com/drive/my-drive, open a folder with the name Vault and verify that there is a file inside with the name masterkey.cryptomator?

If I’m not wrong you tried to unlock a vault with the name Vault in the root of your google drive? Can you please open your browser, open https://drive.google.com/drive/my-drive, open a folder with the name Vault and verify that there is a file inside with the name masterkey.cryptomator?

My vaults follow the pattern of //Vaults/<vault_name>/masterkey.cryptomator, none are at the root of my drive

Circling back here, anything else I can try? I still get the same message, that the vaults have been moved, but I of course have not moved them in over a year

Sorry that the topic has been stalled here.

Normally the communication with Google follows the following scheme while unlocking a vault:

D/PrepareUnlockUseCase: started 5125b4f3
--> Search for Folder with the name of the parent folder in our case Vaults
D/GoogleDriveClient: -------------- REQUEST  --------------
    GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'Vaults'%20and%20'root'%20in%20parents%20and%20trashed%20%3D%20false%20or%20sharedWithMe&
D/GoogleDriveClient: -------------- RESPONSE --------------
    200 OK
D/GoogleDriveClient: {
     "files": [
      {
       "id": "1LbBMOnCOvzINIHjBIyLKl8my_LPmGL9Z",
       "name": "Vaults",
       "mimeType": "application/vnd.google-apps.folder"
      },
--> Vaults folder found, use the id as parent id and look for a folder with the name Foo 
D/GoogleDriveClient: -------------- REQUEST  --------------
    GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'Foo'%20and%20'1LbBMOnCOvzINIHjBIyLKl8my_LPmGL9Z'%20in%20parents%20and%20trashed%20%3D%20false&supportsAllDrives=true
D/GoogleDriveClient: -------------- RESPONSE --------------
    200 OK
D/GoogleDriveClient: {
     "files": [
      {
       "id": "1y4U0_NVGUDaOYYEgcM8zwmoka_V5MMXW",
       "name": "Foo",
       "mimeType": "application/vnd.google-apps.folder"
      }
     ]
    }
--> Folder (Vault) Foo found,  use the id as parent id and look for the masterkey-file 
D/GoogleDriveClient: -------------- REQUEST  --------------
    GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'masterkey.cryptomator'%20and%20'1y4U0_NVGUDaOYYEgcM8zwmoka_V5MMXW'%20in%20parents%20and%20trashed%20%3D%20false&supportsAllDrives=true
D/GoogleDriveClient: -------------- RESPONSE --------------
    200 OK
D/GoogleDriveClient: {
     "files": [
      {
       "id": "1IyxCpvujCqNBYu1DGE7_dlOOKFd2JAy9",
       "name": "masterkey.cryptomator",
       "mimeType": "application/octet-stream",
       "size": "327"
      }
     ]
    }
--> masterkey-file found, use its id to download the file content (1IyxCpvujCqNBYu1DGE7_dlOOKFd2JAy9)
D/GoogleDriveClient: -------------- REQUEST  --------------
    GET https://www.googleapis.com/download/drive/v3/files/1IyxCpvujCqNBYu1DGE7_dlOOKFd2JAy9?alt=media&supportsAllDrives=true   
D/GoogleDriveClient: -------------- RESPONSE --------------
    206 Partial Content
D/PrepareUnlockUseCase: finished 5125b4f3

With --> I inserted some comments about what actually happens.

Now when we look into your log:

PrepareUnlockUseCase	started 4fdd750c
--> Search for Folder with the name of the parent folder in our case Vaults
GoogleDriveClient	-------------- REQUEST  --------------
GET https://www.googleapis.com/drive/v3/files?fields=files(id,mimeType,name,size)&q=name%20contains%20'Vaults'%20and%20'root'%20in%20parents%20and%20trashed%20%3D%20false%20or%20sharedWithMe&supportsAllDrives=true
D	20210223121447.339	GoogleDriveClient	-------------- RESPONSE --------------
200 OK
D	20210223121447.351	GoogleDriveClient	{
 "files": [
  {
   "id": "YYY",
   "name": "XXX",
   "mimeType": "ZZZ"
  },
  ...
}
--> No folder with the name Vaults is actually in the list
D	20210223121447.355	PrepareUnlockUseCase	failed 4fdd750c
D	20210223121447.357	ExceptionHandler	Unexpected error
org.cryptomator.domain.exception.NoSuchVaultException: org.cryptomator.domain.exception.NoSuchCloudFileException: masterkey.cryptomator

Did you deleted the Vaults folder?
Can you please check using https://drive.google.com/drive/my-drive if there is a Vaults folder in the root of your Google drive because it doesn’t looks like…

Ok this was quite helpful. Definitely have a “Vaults” folder. Based on those logs, I went ahead and renamed the folder to give things a kick, and the vaults loaded. I then undid the rename, and they now load from the Vaults folder. I really wonder why the API wasn’t indicating the folder was there, but it seems like it does now

Woooow that sounds very concerning :flushed:, thanks for your feedback, we’ll keep it on the radar and I’m very happy that it’s working again :tada:.