lists syncing, contents not
Yes davx5 is still listed on f-droid but if you hit install you get “requested file not found…”.
Sounds like your F-droid repository index is out of date. It should work when you refresh the index. However, I don’t have any influence on that.
I understand you need information to help pin point the issue.
- I have run logcat reader on the phone. it shows logs for refreshing the calendar list but then nothing for the sync operation - just as #mickey noted with his adb logcat
Thanks for the logs! It seems that these are the logs of DAVx⁵ itself, not the system logcat. Because DAVx⁵ is not called by the system to synchronize, it can’t log anything, so the DAVx⁵ logs don’t contain anything.
- I have examined server logs and again list refreshing traffic is there but nothing at all received at the server for a sync
Seems that sync is not initiated by Android.
- Do you have a working Internet connection (or does the WiFi show an “x”)?
- Did you try another connection type?
- Do another accounts on your device sync, i.e. email or Firefox?
- In Android settings / Accounts, when was the last sync of DAVx⁵? What happens if you force sync there?
- In Android settings / Accounts, when did the other accounts sync last time?
As for steps to reproduce: install davx5, set it up, go to calendar tab and see the calendar list correctly, do a sync and it fails every time.
With these steps, it does work here on all our devices. Could you think of a way how the problem could be caused here so that I can take a look?
Sounds like your F-droid repository index is out of date
Yes, you are right - davx5 is indeed still there and downloads after a refresh of the index. My mistake.
Seems that sync is not initiated by Android. Do you have a working Internet connection (or does the WiFi show an “x”)?
Good question. I’m synching over the LAN so it shouldn’t need an Internet connection; however the Internet connects and works fine BUT there is a tiny “x” on the wifi icon. Doing a little more testing I found that Android connectivity manager contacts google when the wifi is turned on; if that fails it adds the “x” and sets the state to ‘no internet connection’. I assume that the Android sync stuff checks this state before doing anything and fails if it appears not connected (even though it is and even though the sync is over the LAN in this case). After ensuring that Perfdump in process 1000 can contact google the “x” disappears and the sync works.
So not a bug with davx5. Thanks @rfc2822 for your comments as they prompted this avenue of testing for me. I suspect the other guys with this problem will likely be able to find the solution within their Android setup also.
From what I remember, the contents of the logcat in my case is very similar. If needed, I can also post mine and the DAVx5 debug log.
After ensuring that Perfdump in process 1000 can contact google the “x” disappears and the sync works.
I’ll check this also, when I’ll get home to connect to the network (I only use this connection at home, over WiFi). How exactly did you do the “Perfump in process 1000” thing?
Android tries to contact google when the wifi is switched on to determine whether there is an internet connection or not. If it thinks not then sync will not work. Perfdump  needs to have access to the internet to do that check. In my case it was blocked by the firewall. There is also a way to disable this checking which I am currently looking at, in which case you will not need to expose perfdump to the internet. I will post how to do that shortly.
It’s a bit crap that Android does it like this as it does break some things (like davx5) that may be setup to work over the LAN and don’t necessarily need the internet.
Please please please do share with us how to “fake” working internet connection, when only LAN connection is present … It will be most useful information to many of us! Thank you!
Many thanks @icedaddy, this also made it work for me!
I also have an application firewall installed (AFWall+), where I can select which apps get access to the internet. When connected to WiFi, the logcat shows some periodic pings to several google sites, by a service named NetworkMonitor. I suppose that these are used by Android to determine the network connectivity of the phone, but they fail due to the firewall and the WiFi icon shows that small ‘x’. Still, the apps that I enable in the firewall work just fine.
DAVx5 most likely uses this information to know if the phone has internet access and does not start a sync if Android reports no connectivity. If I grant internet access to process #1000 (this is probably attached to core Android processes and the exact name might depend on the Android version and phone maker), things start to work.
@rfc2822 , would it be feasible to have a different check for network connectivity, like pinging directly the DAV server? And also to log the lack of connectivity when a sync is forced, to be visible in the logcat?
And many thanks for all the effort put into this program!
I understand this is the Android connectivity manager that does the internet check (by google contact) and Android sync checks that status to decided whether it can sync or not. I believe davx5 relies on the Android sync so I doubt there is much that could be done to fix this issue within davx5 (correct me if I an wrong @rfc2822). It should, however, be possible to detect a good or bad sync within davx5 and log it; at least that would help identify the issue. All apps that access the internet directly will work but any that check the status via connectivity manager will fail to connect and Android sync will not work at all.
I’m glad it works for you now @mickey with giving #1000 internet access. Not an ideal solution but a good work around for now. I am investigating a better fix…
@rfc2822 , would it be feasible to have a different check for network connectivity, like pinging directly the DAV server?
Unfortunately, this is done by Android. DAVx⁵ does not sync by itself, but the sync process of all accounts (e-mail, Firefox, DAVx⁵, …) is started by Android, and it’s only started when Internet connectivity is available.
And also to log the lack of connectivity when a sync is forced, to be visible in the logcat?
We’re thinking about showing a warning in the main screen of DAVx⁵ when there’s no Internet connectivity, so that people know that might be a problem.
It should, however, be possible to detect a good or bad sync within davx5 and log it; at least that would help identify the issue.
The sync is never started without connectivity.
Of course we could use timers (WorkManager) instead of relying on the sync API, and then integrate it with the sync API, but it would require to adapt the whole sync process and idea how DAVx⁵ works for some very rare use cases. But we’re thinking about that too. However at the moment, there are other things to do.
OK, here’s the options that I can see to work around this issue:
- ensure process #1000 can access the internet (as discussed above)
- disable the internet checking. You need to make the following setting either through a terminal on the phone or over adb:
settings put global captive_portal_detection_enabled 0 settings put global captive_portal_mode 0 settings put global wifi_watchdog_on 0
Reboot and it should be all good - no ‘x’ on the wifi and sync working
- I have not tried this but you should be able to redirect the check, maybe with something like AdAway or set the check IP address to your own LAN server with:
settings put global captive_portal_server [your-LAN-server-IP]
Your server would, I believe, then have to serve a page /generate_204 that returns an HTTP 204 response. With this method the system would flag you LAN as the Internet and sync would work; but if you were connected through another network it would report no Internet and sync would not work.
Hope one or more of those work for you guys.
In DAVx⁵ 2.6, there will be a warning when there’s no validated Internet connection. So when you see this, you will know there’s something wrong with the connection: