Sync stopped working, nothing to go by in terms of debugging



  • @rfc2822 I’m fully with you that processes can be killed by the system. And you’re right - I should have been more precise when writing that “davdroid does not start again” I meant “does not start again and is not started again” - opposite to other processes.
    As you seem to know Android much better than me it would have been great to provide some hints to debug that situation better.

    Nevertheless it seems that I have found the cause for my not-synchronizing my calendars:
    Android (or should I say Google?) checks the internet-connectivity with it’s so-called “captive portal detection”.
    Whenever the network state changes, Android sends requests to different google servers.
    When these requests are answered by a login page (instead of the expected google-answer), Android presumes that you need to login somewhere to enable internet connectivity.
    If no connection can be enabled - for example because “captive portal” is blocked by a firewall - Android thinks that the internet is not reachable and shows this with a little “x” near the wifi-connection symbol. (And sometimes ask you whether you want to continue using that connection.)
    When Android thinks that there is no internet connection, it disables a diversity of other services - seemingly also synchronisation tasks.
    On rooted phones you can switch off the “captive portal service” by issuing this command:

    settings put global captive_portal_detection_enabled 0
    

    via root shell or adb root shell (the local shell sometimes needs two “su”).
    See also: https://android.stackexchange.com/questions/100657/how-to-disable-captive-portal-detection-how-to-remove-exclamation-mark-on-wi-fi

    Since inssuing this command, my calendars get synchronized again.

    Regards
    MG


  • developer

    @MadGoose Thanks for sharing your solution!

    So, your problem was basically firewall settings which were incompatible with the way how Android detects Internet connection, so that synchronization was never started (not only of DAVdroid, but all account types).

    By the way, you can also use settings put global captive_portal_server <yourserver> and create your own captive portal server 🙂 It only has to return HTTP 204. (Side effect: you also have the IP address of your device in your Web server logs.) I had this up and running once, but I don’t know whether this settings still works with current Android versions.


  • developer

    Assuming that this was the problem in the original posting, too and marking as solved. If not, I can reopen.



  • For the record, I don’t have the capitve portal service enabled, and this was not the root cause of my problem. I described how I solved it on 2018-12-08, and even though I don’t actually know what exactly went wrong, it’s been fixed ever since.

    Next time I suggest to keep separate issues in separate threads, please.



  • … spoke to soon. The problem is back. Syncing stopped working again, exhibiting the exact same symptoms as before.

    I went ahead to disable the captive portal detection and rebooted, and now it’s synchronising again. So maybe this was the problem, after all, though I don’t understand why it would have worked in the past.



  • @rfc2822 said in Sync stopped working, nothing to go by in terms of debugging:

    @MadGoose Thanks for sharing your solution!

    So, your problem was basically firewall settings which were incompatible with the way how Android detects Internet connection, so that synchronization was never started (not only of DAVdroid, but all account types).

    Well, not quite:

    • DAVDroid synced after a reboot for a certain time - just until i got killed (by the system?). It just was not restarted to continue synchronization.
    • All other apps continued their “synchronization” - but I guess all other apps I use do not rely on the synchronization framework by Android but use other methods to restart after having been killed by the system.

    But for sure it was no DAVdroid-related problem but the - in my opinion - not too clear documented (well, where could that be found?) behavior of synchronization framework and “internet connectivity detection”.

    Cheers
    MG


Log in to reply