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

Run conditions disregarded #1193

Open
DutchFlander opened this issue Jul 26, 2018 · 24 comments
Open

Run conditions disregarded #1193

DutchFlander opened this issue Jul 26, 2018 · 24 comments
Labels

Comments

@DutchFlander
Copy link

Hi,

After the latest update (v0.14.49) the Run Conditions are disregarded.
When I'm on the added wifi and charging and logging in, I have the option to exit or change the settings only. Previously with the same setup it was working perfectly.
When I remove the setting to sync only when charging and back, it starts working again, like before.
I guess this version has some new bug...

How to reproduce:

  1. have the following set up:
    image
  2. remove charging cable
  3. plug back charging cable

Syncthing won't start, but asks me to change settings:
4. go to change settings
5. in run conditions remove check mark and add it back to run only when charging
6. Syncthing starts to run in the background again

Version Information

App Version: 0.10.12
Syncthing Version: v0.14.49
Android Version: Android 7.0
@Catfriend1 Catfriend1 self-assigned this Jul 26, 2018
@Catfriend1
Copy link
Contributor

Catfriend1 commented Jul 26, 2018

Hi @DutchFlander !
I just read your Gplay report, great you found your way in here :). Could you please test the debug build and tell me if it is working with it?
If not, I'd like to further investigate the problem. Please post a full logcat (Android Log) of this issue by

  • adb logcat (frunning from computer)
  • MatLog (Android app, available on github and Gplay)

EDIT:
Sidenote: There is an ANR problem already on my bugs-to-fix todo list. The ANR happens when you stress test the run conditions UI and change the checkboxes too quickly one after another. I'll file another issue for that and propose a fix when I've completed analysis.

Sidenote 2: The dialog "Syncthing is disabled" despite matching run conditions can happen if the syncthing binary process (the core application that is wrapped by this app) dies or exits unexpectedly. Running "su / killall libsyncthing.so" in a root shell got me reproduce this. A better syncthing crash detector is also on my todo list.

@Catfriend1

This comment has been minimized.

@DutchFlander
Copy link
Author

Hi @Catfriend1,

Thanks, but since I sync important data between several machines and using it on a daily basis with my own disco and relay server, I don't think testing debug builds is a safe option for me. I always use stable release.
Also since Syncthing setup is not so easy with own relay and disco I'm a bit afraid of loosing my setup on my mobile.
I just wanted to report this issue and hoping it will be fixed in the next release.

Or if you think I can safely jump back and forth between stable and debug releases, maybe I'll give them a try.

One other thing to add here is that I'm not "stress testing" the change checkboxes quickly. Doesn't matter how slowly, you just have to make a change in the run conditions in order to start Syncthing. Before the current release I just had to plug the charging cable to my mobile and it started synching all the data between the machines. Something changed in the current release that was not present in the previous one.

Thanks for your understanding,
Dutch Flander

@Catfriend1
Copy link
Contributor

@DutchFlander The debug builds wont affect your existing release build installation. They show up as a second syncthing icon beside the existing one in the app drawer as they are a separate app from android perspective. They are not expected to be dangerous as I only changed run condition behaviour not data syncing. Its safer for you to exit the release version, install the debug app and only try run conditions leaving the folders and devices empty at default. You mustn't open both apps in parallel, if using release app e.g. the debug app has to be quit before launching. (Usually the right of the two app icons is debug in androids app drawer) after testing, uninstall debug app.

@glogiotatidis
Copy link

I get the same error on Android 8.1.0. Happy to test debug builds but the link above to the APK requires login/password. @Catfriend1 can you please provide another apk?

@glogiotatidis
Copy link

The debug APK fixed the issue for me.

  • With WiFi and "Run only on WiFi option" set to True Syncthing runs
  • Disabling WiFi, disables Syncthing

@Catfriend1 Catfriend1 removed their assignment Aug 20, 2018
@Exist2Resist
Copy link

Exist2Resist commented Aug 21, 2018

I have the same issue, I see the original report was setup for version 0.10.12.
My app version: 0.10.13 and
Syncthing version: 0.14.49 on
Android 9.0
I have to manually go into the app and check then un-check one of the run conditions check boxes for it to kick in.
It stops on it's own.
Mine is setup to run only when charging and on wifi.

@Catfriend1
Copy link
Contributor

@Exist2Resist can you please check the status tab before and after the problem occurs, including some logs? The tab is unofficial thus living at https://github.com/Catfriend1/syncthing-android/releases

@chiastic-security
Copy link

I have the same as @Exist2Resist. With the current version, configured to run only on charging, Syncthing doesn't seem to notice when I plug the charging cable in, and sync doesn't start. I have to check and uncheck one of the run conditions boxes to get it to start.

@Exist2Resist
Copy link

@Catfriend1 what logs do you need, and how do you want me to test it?

@AudriusButkevicius
Copy link
Member

@Catfriend1 decided to fork the app and maintain a forked version, so I suggest you continue the debugging on the fork. Even if you do get a response here, I'd prefer if the discussions about something being fixed in the fork would happen on the forks issue tracker, and not here.

@chiastic-security
Copy link

Will there be a PR to merge this back into the main repo, though? It's an important bug.

@AudriusButkevicius
Copy link
Member

It's not up to me, I wasn't the one that decided to fork. If someone opens a PR, I'll review, provide feedback and merge if appropriate.

@Catfriend1
Copy link
Contributor

I can file a PR after the solution proved to work. Unfortunately that is not easy to make sure as Android handles the broadcasts needed for the run conditions differently in each recent version.

@schmendrik
Copy link

schmendrik commented Oct 15, 2018

I'm using Syncthing v0.14.50 and the latest syncthing-android version.

It's a mess right now. I have syncthing-android configured to run on WIFI. However, it is constantly disabled despite my phone being connected to my local wifi network. I have to restart the app manually every time. When I first tap the Syncthing icon, it says it's not running, givig me the Exit and Change Settings options. What I do is tap Android's back button and tap on the Syncthing app again for it to actually start and load (no exit/change settings options this time). Until my phone times out and the screen goes off, and I have to repeate the procedure again.

@Catfriend1
Copy link
Contributor

@schmendrik What's your phone model and Android version? Maybe this is a manufacturer specific extension like (put WiFi off when screen off ) or (broadcast limitation for battery saving means)?

@DutchFlander
Copy link
Author

@Catfriend1 Since I reported this bug, nothing changed regarding the automatic syncing.
Till this day I have to go into the application and change something in the settings and back to start automatic syncing.
Unfortunately I had no time to test the debug apk, but since the issue reported as I recall 2 new versions (or just fixes?) were released in playstore (none of them working as before on my 2 mobiles, the conditions were working only before 0.14.49).
If it helps, currently I'm using an LG V20 with the same OS version before 14.49, nothing changed since (Android 7.0, Kernel: 3.18.31).

Thanks for your attention in advance, hope it helps!

@schmendrik
Copy link

@Catfriend1 I'm using an LG V20, Android 8.0.0 (Kernel 3.18.71). I don't know of any manufacturer specific extensions that turn WiFi on and off. I've recently upgraded from Android 7 to 8, now I'm not sure if I had the same issue on Android 7, but now that I think about it, syncthing may have started to behave strangely right around that the time I upgraded. I just checked my WiFi settings, "Keep Wi-Fi on when screen is off" is enabled, though. At this point, I can't tell if it was the Android upgrade, or an update of syncthing-android itself that introduced this issue.

@AudriusButkevicius
Copy link
Member

If you have whitelisted wifi networks you need to grant location permission to syncthing (as otherwise it can't lookup network names, from which google claims you can infer location).

@licaon-kter
Copy link
Contributor

licaon-kter commented Dec 25, 2018

AOSP 8.1 or 9, with "specific networks"

Seeing the same, start the app "can't run exit/change settings", go to settings, uncheck "run on Wi-Fi", check back "run on Wi-Fi", hit back....magic...now it works.

Location perm granted, but no location enabled.

@capi
Copy link
Contributor

capi commented Dec 25, 2018

Location perm granted, but no location enabled.

It seems, if you disable location, on certain ROMs, this also removes the possibility of getting the connected SSID. That's a very unfortunate decision by Google, in my opinion, but I somehow understand, why it has been made.

@licaon-kter
Copy link
Contributor

@capi Ok, but how does it get the ssid suddenly after toggle and untoggle? Or maybe it doesn't toggle on and stays off on back....then on the next start it checks and fails....?

@capi
Copy link
Contributor

capi commented Dec 26, 2018

@licaon-kter True. Needs to be investigated.

@licaon-kter
Copy link
Contributor

More info from my case:

  • I don't have preferred SSIDs, just WI-Fi toggled on
  • on start I get the dialogue saying I don't have a Wi-Fi connection
  • sometimes I press configure and then BACK right away and then it works
  • sometimes I press configure and then toggle Wi-Fi OFF and then ON, BACK and it works
  • sometimes even if I do the two steps above I'm still at the dialogue and nothing happens
  • sometimes even if I do the steps I'm still at the dialogue BUT behind it I can see the folders checking and then syncing as expected

On thing is unfortunately clear, most of the time, unless I open the app and do the magic spells, it will not sync by itself.

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.

9 participants