Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Nextcloud Backup stops working with createFile returned null #1426

Open
Bruceforce opened this issue Jul 14, 2024 · 10 comments
Open

[BUG] Nextcloud Backup stops working with createFile returned null #1426

Bruceforce opened this issue Jul 14, 2024 · 10 comments
Labels
bug A bug report

Comments

@Bruceforce
Copy link

Version

3.1

Source

Google Play

Vault encryption

Yes (with biometric unlock)

Device

Poco F2 Pro

Android version

12

ROM

No response

Steps to reproduce

  1. Enable Auto Backup.
  2. Configure a Nextcloud folder as target for the backups.
  3. Don't change anything for some time (sorry it's unclear to me what exactly triggers this)

What do you expect to happen?

Nextcloud backups should continue to work also if there was no backup in a few weeks.

What happens instead?

Nextcloud backups stop working after some time. I get an error com.beemdevelopment.aegis.vault.VaultManagerException: createFile returned null" if I click on Details.

Log

No response

@Bruceforce Bruceforce added the bug A bug report label Jul 14, 2024
@alexbakker
Copy link
Member

This is likely to be an issue at Nextcloud's end. It can't hurt to take a look at the logs to see if there's anything that points us in the right direction though.

Please capture a log using ADB while reproducing the issue and share it with us: https://github.com/beemdevelopment/Aegis/blob/master/CONTRIBUTING.md#bug-reports. Just Aegis' logs won't suffice, so please exclude the log filter for Aegis.

@Bruceforce
Copy link
Author

Will do. But it might take a time because I just "re-enabled" the backup granting access to the folder which usually fixes the issue for a couple of days. Once it comes back I'll capture some logs and post them here.

@Bruceforce
Copy link
Author

Hey @alexbakker I grabbed the debug log.
full-debug.log

@alexbakker
Copy link
Member

alexbakker commented Aug 21, 2024

Thanks. Relevant portion from the log:

08-11 12:09:16.890 14674 18746 I VaultBackupManager: Creating backup at content://org.nextcloud.documents/tree/083520c769d3fadce4db0d5a8f4ba118/2312/document/083520c769d3fadce4db0d5a8f4ba118/2312: aegis-backup-20240811-120916.json
08-11 12:09:16.894 14674 18746 E ActivityThread: Failed to find provider info for org.nextcloud.documents
08-11 12:09:16.894 14674 18746 W DocumentFile: Failed query: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.database.Cursor.moveToNext()' on a null object reference
08-11 12:09:16.896 14674 18746 E ActivityThread: Failed to find provider info for org.nextcloud.documents
08-11 12:09:16.896 14674 18746 W DocumentsContract: Failed to create document
08-11 12:09:16.896 14674 18746 W DocumentsContract: java.lang.IllegalArgumentException: Unknown authority org.nextcloud.documents
08-11 12:09:16.896 14674 18746 W DocumentsContract: 	at android.content.ContentResolver.call(ContentResolver.java:2447)
08-11 12:09:16.896 14674 18746 W DocumentsContract: 	at android.provider.DocumentsContract.createDocument(DocumentsContract.java:1380)
08-11 12:09:16.896 14674 18746 W DocumentsContract: 	at androidx.documentfile.provider.TreeDocumentFile.createFile(SourceFile:23)
08-11 12:09:16.896 14674 18746 W DocumentsContract: 	at com.beemdevelopment.aegis.vault.VaultBackupManager.createBackup(SourceFile:88)
08-11 12:09:16.896 14674 18746 W DocumentsContract: 	at com.beemdevelopment.aegis.vault.VaultBackupManager$$ExternalSyntheticLambda0.run(SourceFile:12)
08-11 12:09:16.896 14674 18746 W DocumentsContract: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
08-11 12:09:16.896 14674 18746 W DocumentsContract: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
08-11 12:09:16.896 14674 18746 W DocumentsContract: 	at java.lang.Thread.run(Thread.java:1012)
08-11 12:09:16.896 14674 18746 E VaultBackupManager: Unable to create backup: com.beemdevelopment.aegis.vault.VaultRepositoryException: createFile returned null
08-11 12:09:16.897 14674 18746 W System.err: com.beemdevelopment.aegis.vault.VaultRepositoryException: createFile returned null
08-11 12:09:16.897 14674 18746 W System.err: 	at com.beemdevelopment.aegis.vault.VaultBackupManager.createBackup(SourceFile:346)
08-11 12:09:16.897 14674 18746 W System.err: 	at com.beemdevelopment.aegis.vault.VaultBackupManager$$ExternalSyntheticLambda0.run(SourceFile:12)
08-11 12:09:16.897 14674 18746 W System.err: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
08-11 12:09:16.897 14674 18746 W System.err: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
08-11 12:09:16.897 14674 18746 W System.err: 	at java.lang.Thread.run(Thread.java:1012)

In particular:

Failed to find provider info for org.nextcloud.documents

You do still have the Nextcloud app installed and are logged into it, right? And you didn't uninstall / reinstall Nextcloud in the mean time after you enabled automatic backups in Aegis?

@Bruceforce
Copy link
Author

You do still have the Nextcloud app installed and are logged into it, right?

Correct. Nextcloud works like normal and I'm still logged in when receiving the error. Don't know if this matters, but Nextcloud is only accessible if I'm connected via VPN to my network, but the Aegis backup fails also when I'm home.

And you didn't uninstall / reinstall Nextcloud in the mean time after you enabled automatic backups in Aegis?

Nope. Nextcloud was installed all the time. As mentioned initially it fails after some amount of time, but this happens every few weeks. That's why I provided the log so late.

@alexbakker
Copy link
Member

I'm not sure what could be going on here. I would have to dig into how document providers are managed by Android and what might cause Android to forget about one. Either way, I don't think there's anything we can do about it from Aegis' end.

@moedn
Copy link

moedn commented Sep 26, 2024

Hey there, I ran into the same error. For me it could be fixed by just re-defining the backup folder in the Aegis settings. Right after that, the backup worked again

@Bruceforce
Copy link
Author

Hey there, I ran into the same error. For me it could be fixed by just re-defining the backup folder in the Aegis settings. Right after that, the backup worked again

Hey. Thanks for the suggested fix. However, this is not a fix (at least for me). It will break again and again and again... I re-add the backup every few weeks. Then it works for two weeks or so and then it stops working again.

@jonfre
Copy link

jonfre commented Oct 12, 2024

I had the same issue using a folder on device (not Nextcloud). See below. Manually creating this folder solved the issue (for now).
Version 3.2 from F-Droid on GrapheneOS.

10-12 07:03:24.971 30415 30728 I VaultBackupManager: Creating backup at content://com.android.externalstorage.documents/tree/primary:Syncthing/T420/Backup/Aegis/document/primary:Syncthing/T420/Backup/Aegis: aegis-backup-20241012-090324.json
10-12 07:03:24.982 30415 30728 W DocumentFile: Failed query: java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.database.Cursor.moveToNext()' on a null object reference
10-12 07:03:24.995 30415 30728 W DocumentsContract: Failed to create document
10-12 07:03:24.995 30415 30728 W DocumentsContract: android.os.ParcelableException: java.io.FileNotFoundException: Missing file for primary:Syncthing/T420/Backup/Aegis at /storage/emulated/0/Syncthing/T420/Backup/Aegis
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.os.ParcelableException$1.createFromParcel(ParcelableException.java:82)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.os.ParcelableException$1.createFromParcel(ParcelableException.java:79)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.os.Parcel.readParcelableInternal(Parcel.java:5036)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.os.Parcel.readParcelable(Parcel.java:5018)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3187)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.os.Parcel.createException(Parcel.java:3176)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.os.Parcel.readException(Parcel.java:3152)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:202)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:154)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.content.ContentProviderProxy.call(ContentProviderNative.java:764)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.content.ContentResolver.call(ContentResolver.java:2494)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.provider.DocumentsContract.createDocument(DocumentsContract.java:1380)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at androidx.cardview.widget.CardView$1.createFile(SourceFile:16)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at com.beemdevelopment.aegis.vault.VaultBackupManager.createBackup(SourceFile:98)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at com.beemdevelopment.aegis.vault.VaultBackupManager$$ExternalSyntheticLambda0.run(SourceFile:12)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at java.lang.Thread.run(Thread.java:1012)
10-12 07:03:24.995 30415 30728 W DocumentsContract: Caused by: java.io.FileNotFoundException: Missing file for primary:Syncthing/T420/Backup/Aegis at /storage/emulated/0/Syncthing/T420/Backup/Aegis
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at java.lang.reflect.Constructor.newInstance0(Native Method)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	at android.os.ParcelableException.readFromParcel(ParcelableException.java:56)
10-12 07:03:24.995 30415 30728 W DocumentsContract: 	... 18 more
10-12 07:03:24.995 30415 30728 E VaultBackupManager: Unable to create backup: com.beemdevelopment.aegis.vault.VaultRepositoryException: createFile returned null
10-12 07:03:24.995 30415 30728 W System.err: com.beemdevelopment.aegis.vault.VaultRepositoryException: createFile returned null
10-12 07:03:24.995 30415 30728 W System.err: 	at com.beemdevelopment.aegis.vault.VaultBackupManager.createBackup(SourceFile:383)
10-12 07:03:24.995 30415 30728 W System.err: 	at com.beemdevelopment.aegis.vault.VaultBackupManager$$ExternalSyntheticLambda0.run(SourceFile:12)
10-12 07:03:24.995 30415 30728 W System.err: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
10-12 07:03:24.995 30415 30728 W System.err: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
10-12 07:03:24.995 30415 30728 W System.err: 	at java.lang.Thread.run(Thread.java:1012)

@Bruceforce
Copy link
Author

Would be interesting to know if the issue re-appears on your end also after a few weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug report
Projects
None yet
Development

No branches or pull requests

4 participants