-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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]: Syncing (shared) calendar misses some events #36644
Comments
Currently, Thunderbird will randomly hide / not show events from Nextcloud calendars. I've no idea if it's a Thunderbird or a Nextcloud bug. I reported that a while ago in the Thunderbird Bugzilla, unfortunately with no official reaction so far: https://bugzilla.mozilla.org/show_bug.cgi?id=1795720 Currently, Nextcloud calendars in Thunderbird are basically unusable due to this. (Without exaggaration, you just never now if you have an appointment or not if you check the calendar view in Thunderbird.) |
I will add that this holds both for syncing directly with Thunderbird, via TbSync and on our phones with DAVX5 - whether or not this is a result of Thunderbird shenanigans, though, I cannot say, but it might not be the case. |
@Fjodor42: Mh, I'm also using DAVx⁵ on my Android with the same Nextcloud calendars, and the Android calendar is flawlessly synced with Nextcloud. It's only Thunderbird (using its built-in CalDAV support, I didn't try TBSync) which randomly hides many appointments / events in the synced calendars. Can you describe exactly under which circumstances you're missing events / calendars on your phone? |
Unfortunately, I cannot. There seems to be a bias to what my wife puts into the calendar going missing, but this may very well just be a function of her being the one who puts in the most new events. And, for the record, while Thunderbird has been set up on her computer, she mostly uses her phone anyway, which means DAVX5. So, to recap the broad outline, it's DAVX5 on two devices, Thunderbird on 2 (three including my wife's), and a haze of hit-and-miss as to whether events stick, leading me to speculate that Nextcloud might also have a problem, but your trouble with Thunderbird certainly does lend credence to theories about that being the/a culprit. |
I have a similar, probably the same problem: In the last four weeks I had twice the problem that some calendar entries on shared calendars were not synced to phones. Here is the information I have: Setup:
first problem (about two weeks ago):
second problem (today):
In both cases it looks like the entries weren't transferred in one incremental update. Of course, in the next incremental updates they weren't send because they didn't change. After changing one of the entries it was synced because it was included in the next incremental update. Unfortunately I have no log of the original sync. So I don't now whether the first incremental update, where the entries should have been included, just missed these entries or whether this update was somehow aborted or whether something else went wrong. If anyone has any idea what to try to reproduce this issue, I'm happy helping testing and gathering logs. |
@OliverBreuer: That's different from what I encounter - I'd assume it's a different problem and should be reported as a different bug (though not sure whether it's a Nextcloud bug or DavX5 then):
So there's not single eventy missing from the calendar, but basically the other way around - in the end, only a few events still show up in Thunderbird. Maybe there's the same underlying cause, but I'm not sure... The observation described in the original bug description above more seems to match what I'm observing and less what you're experiencing... |
@gohrner , @OliverBreuer: As for the original bug description, being written by me, I would like to state that both of your observations seem to fit within what I tried to describe. |
I am experiencing the same issue across various clients (macOS/iOS, Thunderbird/Evolution, DavX5) since I upgraded to Nextcloud 26.0.1. A client creates an event and this is synced to the Nextcloud server (the event appears in the Nextcloud calendar app). But the entries sometimes don't appear on some clients, even if I force refresh the calendar on the client. I can't tell whether the new entries are not synced to the clients or synced but simply not shown due to some other issue. The issue occurs on shared calendars with different users and clients, but also on a single calendar with the same user and different clients. Unfortunately, I can't reproduce the issue reliably. Any guidance on how to debug this issue is highly welcome. |
I have the same problem as Flortsch since upgrading to Nextcloud 26. I too then reinstalled various instances from scratch, but the problem remains the same. |
We have the same problem as flortsch too. Nextcloud 26 with shared calendars synced with various clients (Thunderbird, DAVx5). @Eskawotz: I'll check whether I can reproduce the bug when waiting 12 hours until I reopen my Thunderbird after I created a new event/updated an existing one on another client. I'll report back what happend. |
One more comment on that bug: But now I figured out something out, which makes it even more weird: But the general issue remains. I made a rollback to Nextcloud25, cause this is such a nasty issue. |
Here the result of my test: I then started to look into the source code to get an idea what change could have caused that behavior. |
I also thought that this prune job could be related to this issue, but the job should keep an amount of change objects in the db (10k per default) when pruning (which should be more than enough for small instances). You could test if disabling cronjobs fixes your issue. I have upgraded my instance to 26.0.2 and will report if I still face this issue. Also will check out if this happens after the 12h of not syncing clients. |
Thanks for analyzing! This bug drives me crazy since forever, and I always suspected thunderbird since no events are missing on my mobile. But the mobile syncs every hour, so... @Eskawotz : An easier workaround (instead of deleting / readding) is to disable offline support in the thunderbird calendar, save, re-enable, save. Then all events are re-synced as well. @ckroenicke @flortsch If I understand your comments correctly, then at least the last 10k change objects should still be present in the table oc_calendarchanges? That's clearly not the case in my installation... (And my calendar is huge, with daily changes since years, check the ID). The only change that is present is from today (the URI seems to contain a unix timestamp from today). So maybe there is a bug in this prune job which prevents keeping the last 10k changes?
|
I have also upgraded to 26.0.2 (another test-instance, productive is 25!) and it still has that issue. @charno: Thank you for that hint! |
Okay, so I tested the prune job on my instance. I updated a calendar event on my Evolution client, synced it with Nextcloud which resulted in a new row in the Indeed, the job did not keep the row and cleared the whole table! Looking at the code it seems to me that an SQL delete statement with a offset parameter is created that might not be supported on all DB types (running MariaDB here). However, I don't fully understand the impact of these missing rows in the |
@Eskawotz Yeah, it seems to me that the prune job code is buggy. It did not keep any rows and wiped my |
The easiest way to disable this job without globally disabling cron for me seems to just comment all the code in the run function of
|
I forgot to add that we also use Nextcloud (26.0.2) with a MariaDB (10.3.32). |
I have commented out as well and will check.. I will let you know! |
For completeness, I digged deeper into the code, especially |
@flortsch I'm also on it, already have the dev environment setup. The vscode devcontainer setup uses postgre, and the error is present there as well. |
Hmm... Doesn't seem to easy a bug: private function getSQLForDelete(): string
{
$table = $this->sqlParts['from']['table']
. ($this->sqlParts['from']['alias'] ? ' ' . $this->sqlParts['from']['alias'] : '');
return 'DELETE FROM ' . $table
. ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : '');
} vs. private function getSQLForSelect(): string
{
$query = 'SELECT ' . ($this->sqlParts['distinct'] ? 'DISTINCT ' : '') .
implode(', ', $this->sqlParts['select']);
$query .= ($this->sqlParts['from'] ? ' FROM ' . implode(', ', $this->getFromClauses()) : '')
. ($this->sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->sqlParts['where']) : '')
. ($this->sqlParts['groupBy'] ? ' GROUP BY ' . implode(', ', $this->sqlParts['groupBy']) : '')
. ($this->sqlParts['having'] !== null ? ' HAVING ' . ((string) $this->sqlParts['having']) : '')
. ($this->sqlParts['orderBy'] ? ' ORDER BY ' . implode(', ', $this->sqlParts['orderBy']) : '');
if ($this->isLimitQuery()) {
return $this->connection->getDatabasePlatform()->modifyLimitQuery(
$query,
$this->maxResults,
$this->firstResult
);
}
return $query;
} The query builder seems to not honor setFirstResult for delete queries... And the query builder is external (doctrine/dbal) |
Pull request #38639 opened. Hoping for fast merge :-) |
Nice! Thanks @charno for fixing the code and creating the PR :) Hoping for fast merge! |
The prune job has an interval set of one day, so it is only triggered by cron.php when the time diff between the last prune job and cron.php execution is >= 1 day. Also, some clients seem to sync calenders/contacts differently, not using sync tokens but doing a full sync I guess (e.g. I could still sync calendar changes with Dav5x, although my oc_calendarchanges table was wiped by the prune job). In this case, an empty oc_calendarchanges table has no effect. |
@gohrner I'll test the backport to stable25 assuming that it is the same bug. If not, I'll reopen the issue. |
pruneOutdatedSyncTokens accidentally deletes all entries of the calendarchanges table instead of leaving $limit elements in the table Signed-off-by: Christof Arnosti <[email protected]>
Signed-off-by: Christof Arnosti <[email protected]>
pruneOutdatedSyncTokens accidentally deletes all entries of the calendarchanges table instead of leaving $limit elements in the table Signed-off-by: Christof Arnosti <[email protected]>
Signed-off-by: Christof Arnosti <[email protected]>
The linked PR does not fix this issue for 25 and below so there is another unknown bug. Reopening this issue until it's fixed. |
This bug has been definitively introduced with version 26. |
I have a NC 26.0.3 self-hosted, with a shared calendar between my NC acount and my wife account. We user DavX5 to synchronize caldenars on Android. Event are not shared anymore. If I create an event, she doesn't see it. If she creates an event, I cannot see it. That is pretty annoying. Does a patch will come, or may I tried to patch by myself as explained above ? |
You would have to apply the patch manually, it didn't make it into 26.0.3. |
Patch is scheduled for 26.0.4 #38920 |
pruneOutdatedSyncTokens accidentally deletes all entries of the calendarchanges table instead of leaving $limit elements in the table Signed-off-by: Christof Arnosti <[email protected]>
Signed-off-by: Christof Arnosti <[email protected]>
For completeness, I'd would like to point out that despite patch #38920, if you have a subscribed calendar source containing many VEVENTS (like I have) the As far as I can see, the As per the RFC, UID and DTSTAMP are mandatory fields and could therefore be used for this. Also, on a related note, I believe there is a minor bug in the initial lines of |
I'd just like to point out that I have the same exact issue w/ Thunderbird v115.3.1, DAVx5, and Xandikos (a CalDAV server.) Seems more like a Thunderbird issue that never got fixed. |
Did you investigate further? I am not familiar with the code base in general, but I also think that expiring sync tokens simply by pruning all expect the last |
I am using NextCloud 28.0.1 and am experiencing similar issues as the original poster. I use current iOS clients, Thunderbird 115.6.0, NC 28.0.1. Newly created calendar items don't always get shared between all clients. The only solution that works for me is to remove and re-add the account on clients (iOS, Thunderbird). All appointments are correctly visible in the NC calendar webinterface. In my case #38639 did not fix the issue. |
|
We might be able to detect when our sync tokens do not have all the data since the client's last sync: #44126. Unfortunately, at least Thunderbird doesn't handle the special condition. |
Bug description
For a number of years, I have run my own NextCloud instance, on which I have renamed my user's default calendar to "Fælles Kalender" (Danish for Common Calendar), so my wife and I can both enter events into it, to update each other on events that affect us both.
Both of us sync from Android phones (via DAVX5 as recommended), and I have also been subscribed via Thunderbird on both my personal and my work computers.
As for the latter subscriptions, I used to just use the built-in CalDAV functionality, but have switched to the CalDAV connector for TbSync as per recommended, but to no avail of the problem described below.
For quite some time, we have experienced the unfortunate state of affairs that, seemingly at random, her updates from her Android phone will not show up in my sync'ed applications, vice versa, and sometimes previously sync'ed events seem to "go missing".
Due to lack of mental and chronological surplus, I have postponed looking further into this, but it cannot continue.
I have recently noticed that the events will typically be shown in the web view of the calendar, and will, typically, show up if I un- and resubscribe, leading me to believe that the problem does not lie in actually storing new events or alterations to existing events, but I am at a loss regarding how to even ascertain whether this is even a NextCloud problem, or a problem shared between CalDAV implementations of Thunderbird, TbSync and DAVX5.
Hence, initially, I am asking for help pinpointing where the problem lies, but have labeled is a bug, as the common denominator seem to be NextCloud, rather than the various clients.
Please advise
Steps to reproduce
Expected behavior
Shared access to a calendar should mean that all participants, whatever their CalDAV client, should be able to create and alter events and have their events, or changes to such, be reflected to all participants, regardless of the CalDAV-compliant client software used to sync.
Installation method
Community Web installer on a VPS or web space
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.0
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
The text was updated successfully, but these errors were encountered: