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

Minimum Free Disk Space setting not working/respected? #277

Closed
Catfriend1 opened this issue Jan 24, 2019 · 15 comments · Fixed by #278
Closed

Minimum Free Disk Space setting not working/respected? #277

Catfriend1 opened this issue Jan 24, 2019 · 15 comments · Fixed by #278
Assignees
Labels
Milestone

Comments

@Catfriend1
Copy link
Owner

Got a ticket:

Description of the issue

(...)
I have a Pixel 2 XL running the Syncthing v0.14.50 app with a folder on its
internal storage sync’d to said shared folder from home PC mentioned
above…with conditions to only sync on certain wifi AND AC power.

Syncing works well, however, my issue is that Minimum Free Disk Space
setting doesn’t seem to be respected…this is where I assume I possibly am
understanding the setting incorrectly or have it set up incorrectly…

In the app on the phone, there are two locations to adjust the Minimum Free
Disk Space that I can see. One is under the gear icon on main WEBUI and the
other is under the Advance section in the edit menu of the folder being
sync’d.

My phone is advertised as the 128GB model (110GB usable). Of this internal
capacity, I have roughly 80GB free…The default value for both of the
Minimum Free Disk Space settings in the Syncthing app was 1%; is this 1% of
the usable 110GB or 1% of the 80GB free space? Anyways, I want there to be
a total of about 5GB of free space left on the phone after all the syncing
(which obviously I understand you can’t fit 500GB into 80GB and thus
syncing stops until more free space is made available), which setting
should I change the folder or the one in the main setting…or both?

I’ve attempted various values in percentages and absolute values in MB and
GB yet when I wake up in the morning I have a notification on my phone of
low disk space and Google play services among others keep crashing due to
this…generally left with anywhere from 49 MB or less to maybe at most 120
MB or so…
(...)

Version Information

App Version: ?
Syncthing Version: v0.14.50
Android Version: ?
Device manufacturer: Google
Device model: Pixel 2 XL

Android Log

adb shell / logcat
or MatLog (search on GitHub) output
@Catfriend1
Copy link
Owner Author

Catfriend1 commented Jan 24, 2019

Setup test case:

  • Default Camera folder
  • Edit folder via web UI
  • Set MinDiskFreeSpace Unit "MB", val="100"
  • Config saved successfully
  • Config dump
  • Seeing this below node
    <minDiskFree unit="MB">100</minDiskFree>
  • Edited folder through wrapper UI
  • Seeing this below node
    <minDiskFree unit="">0</minDiskFree>

Bug confirmed.

@Catfriend1 Catfriend1 self-assigned this Jan 24, 2019
@Catfriend1 Catfriend1 added the bug label Jan 24, 2019
@cmcooper1980
Copy link

Thank you for confirming the bug! Glad it isn't isolated to me...

@Catfriend1
Copy link
Owner Author

Hmmm... tried to adjust the model so it doesn't loose the MinDiskFree contents but yet found no way of a correct implementation. I guess the text node causes trouble here as the value is not in its own tag. I reached out to the core devs as this is not an issue of the android wrapper.
See : https://forum.syncthing.net/t/problem-parsing-mindiskfree-on-android/12762

@cmcooper1980
Copy link

You're on top of it! Thanks for the update!

@Catfriend1
Copy link
Owner Author

Can you please try this APK and let me know if the problem is fixed?
Link: https://drive.google.com/open?id=1yCfYAz0KFR6lGjVXAfb0GcArdGh1ye1U

@cmcooper1980
Copy link

cmcooper1980 commented Jan 26, 2019 via email

@cmcooper1980
Copy link

cmcooper1980 commented Jan 27, 2019 via email

@Catfriend1
Copy link
Owner Author

There are still some glitches due to the gson() parser the wrapper users for handling the config when inputting high values, so that's what I already know. minHomeDiskFree also didn't work. I fixed that by my most recent commit.

@Catfriend1
Copy link
Owner Author

The fix will be part of the next release.

@cmcooper1980
Copy link

cmcooper1980 commented Jan 27, 2019 via email

Catfriend1 pushed a commit that referenced this issue Jan 27, 2019
* WIP

* Revert "WIP"

This reverts commit 98b34c4.

* WIP

* Revert "WIP"

This reverts commit 3b9fc96.

* Add de/serializer for MinDiskFree

* Move MinDiskFree out of Folder

* Move MinDiskFree out of Folder (2)

* Revert "Move MinDiskFree out of Folder (2)"

This reverts commit 65f87db.

* Revert "Move MinDiskFree out of Folder"

This reverts commit b71350b.

* Revert "Add de/serializer for MinDiskFree"

This reverts commit 5827426.

* RestApi: Add MinDiskFreeSerializer, MinDiskFreeDeserializer

* Revert "RestApi: Add MinDiskFreeSerializer, MinDiskFreeDeserializer"

This reverts commit 3922f24.

* Test

* Revert "Test"

This reverts commit 3550095.

* FolderActivity/DeviceActivity: Fix restApi unavailable in onCreate()

* Model/Folder#MinDiskFree: Initialize members (fixes #277)

* ConfigXml#getFolders: Add MinDiskFree (fixes #277)

* ConfigXml: Write back minDiskFree (fixes #277)

* Ignore notices about updating gradle dependencies

* ConfigXml: Make number parsing more safe

* FolderActivity#initFolder: Add new Folder.MinDiskFree

* Handle minDiskFree.value as String instead of float

* Revert "Handle minDiskFree.value as String instead of float"

This reverts commit 0552cfc.

* WIP

* Revert "WIP"

This reverts commit 0a3df91.

* RestApi: Avoid creating duplicate Gson() instances

* Model/Folder: Use Integer instead of Float

See gson glitch:
google/gson#1290
google/gson#968

* Try MinDiskFree.value as Long instead of Integer

* Revert "Try MinDiskFree.value as Long instead of Integer"

This reverts commit d358862.

* Revert "Model/Folder: Use Integer instead of Float"

This reverts commit ca3931b.

* Update model/Options: MinHomeDiskFree (fixes #277)
@Catfriend1
Copy link
Owner Author

Release is there on GitHub, GPlay will follow soon.

@cmcooper1980
Copy link

cmcooper1980 commented Jan 27, 2019 via email

@cmcooper1980
Copy link

cmcooper1980 commented Feb 2, 2019 via email

@Catfriend1
Copy link
Owner Author

It's not that easy. I've deleted the debug version as the code changes went in the release so there's no difference from technical view. What may cause the inaccurate free space evaluation is the parser as gson glitches and returns for example 4.5gb as 4.6 gb due to the internal scientific representation of the float value fields in the config which are like 4.5e+8 in that case. We need to transition to a different parser, for example, Jackson to fix this as In didn't found a reliable way to workaround this in gson. Doing this may introduce a lot of bugs in the initial transition step as Jackson handles the whole deserialization of config values differently... We'll do this later. Try experimenting with values then, e.g. write 2 gb instead of 2000 mb and be sure to exit the app after you changed something like this from the native web ui. This will lower parsing glitches' impact.

@cmcooper1980
Copy link

cmcooper1980 commented Feb 2, 2019 via email

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

Successfully merging a pull request may close this issue.

2 participants