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] Backup on Android leads to buffer error #307

Closed
0xShkk opened this issue Sep 9, 2022 · 24 comments
Closed

[BUG] Backup on Android leads to buffer error #307

0xShkk opened this issue Sep 9, 2022 · 24 comments

Comments

@0xShkk
Copy link

0xShkk commented Sep 9, 2022

Hi,

I have a repo which contains a few Pictures. Its about 40 MB in size in total.

The strange thing is that sometimes it works to do a backup so the push completes and everything is completely in snyc.

And then out of nowhere when trying to do a backup it says initializing push and directly after that buffer error.

It's like yesterday evening it is working then the next morning it says buffer error and then few hours later it's working again. Only adding few lines of text between the backup attempts.

Could I debug this somehow or is my repo already too big?

Screenshot_20220909-210547_Obsidian.jpg

Bug is on Android and Plugin version is 2.1.0

@Vinzent03
Copy link
Collaborator

I haven't done much research, but I guess it depends on the available ram on your device. E.g. how many other apps you have opened. 40mb isn't that big. I thought the limit would be higher.

@0xShkk
Copy link
Author

0xShkk commented Sep 10, 2022

Thats a good point. Will try to clean the cache everytime before doing a backup and see how it goes

@Vinzent03
Copy link
Collaborator

Since there isn't really anything, I can do to fix this. I'm closing this now.

@Vinzent03 Vinzent03 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2022
@sakha002
Copy link

sakha002 commented Sep 12, 2022

@Vinzent03 Hi, I am getting same buffer error when attempting to push, and my repo is tiny , the commit said 10 files changed, and device memory is big. I also closed all other apps. Any suggestions on what to do? I hope I can avoid cloning again

@0xShkk
Copy link
Author

0xShkk commented Sep 12, 2022

@Vinzent03 Hi, I am getting same buffer error when attempting to push, and my repo is tiny , the commit said 10 files changed, and device memory is big. I also closed all other apps. Any suggestions on what to do? I hope I can avoid cloning again

Just wait and try again. Its working again after a while but its definately buggy. Sad that this is not investigated any further..

@0xShkk
Copy link
Author

0xShkk commented Sep 12, 2022

Also, clearing cache after getting the error didnt help.

@c0deZ3R0
Copy link

I have the same problem with a small repo. Can't get mobile to sync without buffer error. Have cleared the cache with no luck.

@0xShkk
Copy link
Author

0xShkk commented Sep 16, 2022

@Vinzent03 maybe some advises on one could debug this?

It seems like there are a few people experiencing the issue

@0xShkk
Copy link
Author

0xShkk commented Sep 16, 2022

Or should I open the bug elsewhere?

Any help would be greatly appreciated

@Vinzent03
Copy link
Collaborator

As said before I'm really sorry it's not working on your device, but I think there is nothing I can do. The underlying lib is not very memory saving. I know that's bad for a mobile. plugin, but that's the only way I found to make it work for at least some users.

@0xShkk
Copy link
Author

0xShkk commented Sep 20, 2022

Ok no worries than. It works most of the time though

Thanks for your work and sharing

@0xShkk
Copy link
Author

0xShkk commented Oct 2, 2022

Leaving this here in case someone got the same troubles and looks for a solution.

When you exclude the Obsidian app from memory management in Android settings, the plugin works just fine. I can do this in device management settings but this setting may dependt on the device.

@Takaishisama
Copy link

Takaishisama commented Oct 8, 2022

0xShkk

Could you please explain further? Can't seem to find how

@blqke
Copy link

blqke commented Oct 16, 2022

@Takaishisama

Succeeded to exclude the app from memory management, it is now working as expected. It depends of your android device, here how you can find the settings screen:

New Project

@penfold00
Copy link

I'm experiencing the same problem with a small vault and small files.
I am using a Samsung Galaxy S10, Android 12.

The sync worked 1 or 2 times, now there's a buffer error every time and it's not pushing/pulling.
Clearing the app cache didn't help.
I checked the memory usage of the app, Android says max usage has been 333 MB, which seems normal. Average usage of 107 MB seems a bit high, but still fine.

I am very confused by the proposed solution by @0xShkk and @blqke.
@blqke you are changing the battery usage in your screenshot, which should not have anything to do with memory management?!
@0xShkk is that what you meant? I cannot find a setting to change memory usage behaviour of an app.

Also, might the sync of the app settings between PC and Android be a problem? Should these be excluded using .gitignore?

Thanks for your help!

@0xShkk
Copy link
Author

0xShkk commented Nov 8, 2022

@penfold00

I meant exactly this. It may be that this setting can't be found on all devices but just guessing here. For me it still works fine

@HarvsG
Copy link

HarvsG commented Feb 1, 2023

As said before I'm really sorry it's not working on your device, but I think there is nothing I can do. The underlying lib is not very memory saving. I know that's bad for a mobile. plugin, but that's the only way I found to make it work for at least some users.

isomorphic git supports reducing the clone and fetch depth: https://isomorphic-git.org/docs/en/clone
You may find this makes things less memory intensive as there is no need to clone the entire git history - particularly if users have accidentally have larger files in their git history

This comment suggests a method of keeping all the clients having a small and efficient git history, however I am not sure if these features are all implemented in these git libraries:
https://stackoverflow.com/a/37105443/3562522

Tagging in case closed issue is muted @Vinzent03

Vinzent03 added a commit that referenced this issue Feb 25, 2023
@Vinzent03
Copy link
Collaborator

@HarvsG Great idea. Available in v2.17.0

@bszewc3203
Copy link

So it seems this error doesn't have a fix yet which kinda sucks since I have the same problem. Cloning a vault crashes the app. Tried this battery option even though it is strange like the other person said and it didn't work. Also tried turning off every other app that was running.

@btmurrell
Copy link

I am having this problem 100% of the time. My repo is only 1.5MB. I am on Android. I have tried the memory and the battery suggestions above with no success.

@Vinzent03, could you share what other configurations or conditions might trigger the "buffer error"? Is there any obsidian-git logging I could capture?

I have searched isomorphic-git for "buffer error" and it does not appear on the web or in the obsidian-git repo.

Thank you!

@btmurrell
Copy link

FYI @Vinzent03, and for any others that may land here... For my case, it was a "user shot self in foot", "user solved self" PEBKAC case... I was curious about what other factors might contribute to this error. I can tell you one...

Because of other errors I had experienced, I had removed and re-cloned my repo more than once. In one reconfiguration, I moved my repo to a subfolder of its original location. So, originally my repo was in something like folder-a/notes and I moved it into folder-a/newhome/notes. To do this, I removed my folder-a/notes directory, then re-cloned into folder-a/newhome/notes. MY problem was that I left behind the folder-a/.obsidian directory.... and so, I ended up with two .obsidian folders in a hierarchy... so, as we know, the obsidian-git configs are under the .obsidian/plugins directory... and I assume there is an "up the chain" precedence in obsidian-git and with two conflicting configs, that was the cause of my "buffer error". After removing my parent directory .obsidian folder, my issue was resolved.

@MalachiMcIntosh
Copy link

MalachiMcIntosh commented Oct 30, 2023

First off thanks to the maintainers for this fantastic plugin.
I just wanted to comment for anyone who comes across this issue to say I've found a workaround that is currently working for me (Samsung Galaxy S21, Android 13).

In Settings -> Battery and Device Care -> Memory I increased the RAM Plus (which I assume is swap) to 8GB (seems overkill) and added Obsidian to the "Excluded apps" list. I haven't had any buffer error issues since. Still watching #572 intently though!

Screenshot_20231030_102125_Settings
Screenshot_20231030_102137_Device care
SmartSelect_20231030_102605_Device care

EDIT: OK, after a few more days I've started getting buffer errors again. So maybe disregard this.

@vJourneyman
Copy link

Wondering if people could report the versions of Android, phone, and RAM with their problem.
I'm able to do an initial sync from remote repo, but not a backup after making a small change.
buffer error

Pixel 5, 8GB RAM, Android 14 with Nov 5, 2023 security patch;

Obsidian maxed out at 3.9 GB of RAM usage.

How to Check RAM on Android 14?

@Mick1o
Copy link

Mick1o commented Apr 21, 2024

I'm having the same problem. I haven't even managed to backup once, not even with trying every suggested method here.

Surprising this hasn't been fixed yet as it seems to be a pretty major issue.

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

No branches or pull requests