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

backup to nextcloud directory isnt working #1061

Closed
manuelautomatisch opened this issue Dec 12, 2022 · 10 comments
Closed

backup to nextcloud directory isnt working #1061

manuelautomatisch opened this issue Dec 12, 2022 · 10 comments
Labels
bug A bug report

Comments

@manuelautomatisch
Copy link

Version

2.1.2

Source

Google Play

Vault encryption

Yes (with biometric unlock)

Device

Onenplus 7 Pro

Android version

Android 11

ROM

No response

Steps to reproduce

  1. go into settings
  2. select backups
  3. select nextcloud directory (/data/backups/aegis)
  4. manually trigger backup
  5. error occurs

When I select the root directory from my nextcloud server as backup folder the backup is working fine.

What do you expect to happen?

  1. be able to backup the aegis vault to the nextcloud directory

What happens instead?

the following error occurs:
com.beemdevelopment.aegis.vault.VaultRepositoryException: java.io.FileNotFoundException:
Error downloading file:

Log

I already tried the steps from #610 but that didnt worked as well.

@manuelautomatisch manuelautomatisch added the bug A bug report label Dec 12, 2022
@alexbakker
Copy link
Member

Could you capture a log using ADB of you reproducing the issue and share it here?

@manuelautomatisch
Copy link
Author

Yeah sure. I will do that and post the output here.

@manuelautomatisch
Copy link
Author

Short update: at the moment the backup is running to the root folder of nextcloud and it works good for me. Probably I will use it like that.
Although to solve the issue for those who are facing the same I will provide the logs for further analysis when I have time for it (could take a bit longer).

@manuelautomatisch
Copy link
Author

manuelautomatisch commented Jan 3, 2023

I finally was able to collect the logs while reproducing this issue

The backup files in the nextcloud directory were created but other than the working backup files, these are empty:

grafik

modified.txt

@joshtrichards
Copy link

@manuelautomatisch Just a bystander here, but what version of the Nextcloud Android client is (or was) that with? There was a weird upload issue fixed around the 12/12/2022. The fix got backported to v3.23.1 (which was released on 12/21/2023) so it's possible that was mixed into things for you. Can you confirm the issue happens with Nextcloud's Android v3.23.1 client?

I'm running v3.23.1 and seeing no issues with backups, but I semi-recall backings briefly being broken for me but it was fixed by the time I got around to looking into it.

@manuelautomatisch
Copy link
Author

@joshtrichards Thanks for the notice. I tried it again but unfortunetly the problem still occur although I'm using nextcloud v3.23.1. I'm not sure if there is a problem because the path is a external data store which I mounted with smb to nextcloud. It would wonder me if this is a problem but it is working in the root folder and also in other folders which are on the server itself and not on an external datastore.

@OlJohnny
Copy link

OlJohnny commented Apr 6, 2023

I am currently also facing this issue. At first the backups worked correctly, but now (without changing anything afaik) the backup function (manual & automatic) produces empty files.

Maybe we should also check for a non empty backup file before deleting the oldest backup file.

My nextcloud app version is 3.24.2

If you need any logs, please reach out to me!

Update: The nextcloud app showd a "connection error" for the new files in question
After restarting the upload queue in the nextcloud app, the files are now created correctly.

I still think the new backup files should first be created, uploaded and tested to be at the remote location correctly before the app does anything to old files

@alexbakker
Copy link
Member

alexbakker commented Apr 11, 2023

@OlJohnny I agree that we should look for ways to be more careful with backup pruning. Normally one wouldn't have to worry if writing, flushing and closing a file completes without errors. But SAF is not a normal filesystem.

We can't actually test whether the file ended up at the remote location correctly though. Best we could do is try to read back the file and see if it matches with what we thought we wrote to it, but there's a good chance that the documents provider is serving it from the local cache instead of fetching it from the (in this case Nextcloud) server.

@scheinercc
Copy link

scheinercc commented Aug 31, 2023

Not sure if it is directly related:

The following has been the same for Android 11 & 13.

I also set the backup directory to a folder inside my Nextcloud root. When clicking in Aegis -> Backups -> "Directly for backup files", I can see the auto-generated files in the file explorer being in the correct folder. Manual backups seemingly work as well. And I also checked their content in a JSON viewer.
But checking my NC the files are not there - not in the Android app nor on the server.

@alexbakker
Copy link
Member

I think we can conclude that this is most likely an issue in Nextcloud, not in Aegis. Based on a quick search, there appears to be some history of uploads not getting triggered in Nextcloud: nextcloud/android#9320 (comment).

As I said previously, we could try to read back the file we just wrote to Nextcloud's documents provider, but in all likelihood we'd just be reading the file back from the local cache instead of the remote Nextcloud server.

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

5 participants