-
Notifications
You must be signed in to change notification settings - Fork 241
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
Subscribed calendar attempting refresh 100-200 times per day #4966
Comments
Hi,
If you can't find what in your client triggered this, you can update the value inside the database: SELECT * FROM oc_calendarsubscriptions WHERE principaluri = 'principals/users/%your_user_id%';
UPDATE oc_calendarsubscriptions SET refreshrate = 'P1D' WHERE id = '%the_calendar_subscription_id_you_found_above%'; |
There's currently no issue about having this option in the Calendar app UI, but we could have one (with some kind of minimal setting). |
To clarify, this issue is not about what triggered the problem, but that my Nextcloud server (not my client) is currently attempting to refresh this calendar 100-200x per day regardless of what I set |
What I said is that there's a setting per calendar subscription that overrides what Also there's the new |
Oh, sorry, I misunderstood. I know clients can refresh separately as often as they're configured for, but you're saying a client can change the server's per-calendar refresh rate setting? When I connected my Nextcloud calendars to my iPhone, it automatically pulled in the subscription I had made on my Nextcloud web interface. So if I'm understanding you correctly now, that would mean my iPhone is likely responsible for making my Nextcloud server attempt a refresh every 5 minutes. If that's the case, I went looking and don't see any way on my iPhone to change the refresh rate for this situation. The obvious setting would be its "Fetch" interval, but it's set to 15 minutes, not 5 minutes, so that doesn't explain what's going on. Is there a way to limit this serverside using the occ tool, similar to modifying |
I don't think the fetch interval manages the refresh rate as well. It's more about checking new changes for regular calendars. Only the Apple macOS Calendar app has such a setting afaik (see "Refresh a subscribed calendar"). Last time I checked, Evolution didn't have support for detecting subscriptions over CalDAV, so it's unlikely it was the culprit. In any case, if you can't access the database, I would simply advise removing the subscription from the Calendar Nextcloud app and try adding it again (maybe after a while to avoid being blocked again). |
Just an FYI, you're right, it does not appear to and I had to add it in as its own separate subscription with its own refresh rate. I do have access to the database, but I'd prefer not to go mucking around in it if I can help it. Even if I did, wouldn't my device just change it again? I obviously don't know how that works.
In any case, this seems like it might be a prudent thing to look into. I'm not sure it needs to be a UI element though? It's not really a user-facing problem that they'd need to address. Users wouldn't even know that it would need to be addressed since the only negative effect is log spam and possibly annoying the remote server. If it were to be configurable, I'd say it'd be an admin who would notice the issue and want to configure it, therefore an occ command would be the appropriate place for it. I envision this as one config value that, when set, would enforce the specified limit globally across all subscribed calendars. Calendars may attempt to refresh less frequently than the limit, but not more frequently. |
An occ command could be the way to go here. @tcitworld what do you think? |
Yes, that would be the minimal app setting I was referring to. Otherwise users could set the refresh rate for their calendars (accidentally or voluntarily) to something that would not be sustainable for the source server and for NC itself. |
An update: I did as suggested and removed the subscribed calendar from my Nextcloud web interface for a day to allow the frequency limit to pass, then re-added it. It's been 2 days and, so far, I have not tripped the frequency limit again. But, given that I don't know how or why the limit was exceeded in the first place, it seems like a good idea to have some occ setting with a reasonable default minimum value that would prevent a rogue client from doing this again in the future. Is that something we want to have? Should I create a new feature request or can we rename this one and use it since it has all the background info? |
This is the way I handled this until now, as admin. But non admin users without direct database-access can not do that. Something like A "Synchronize now" buton would be a great tool as wel. I do that now with this workaround: Find out the background-job id with then I run it:
This, like the other solutions that require direct database access, is only for server administrators with terminal access to the server. EDIT: Install it with: sudo wget -qO /usr/local/bin/nc-subscribed-calendar https://global-social.net/script/nc-subscribed-calendar
sudo chmod +x /usr/local/bin/nc-subscribed-calendar .. then simply run it:
.. it guides self explanatory through the steps. ernolf |
Hi, Yes I agree a simple occ command to force refresh by calendar subscription name would be great. @ernolf Thank you for sharing your script! Unfortunately I'm using the nextcloud snap so it won't work for me so I'll just write one that will simply find the background-job id and force execute it like you described and just schedule via cron. |
Steps to reproduce
Background:
I somehow triggered a refresh frequency limit on a subscribed calendar. I don't know how or when this first happened or if Nextcloud contributed to causing it; I only just noticed the warnings in my logs. I suspect that a caldav client, Evolution, was attempting to refresh too frequently. I have since adjusted its refresh rate. Regardless, the current situation is that the remote server is currently responding with a 503 error
Your calendar software is requesting this resource too often!
Issue Details:
My Nextcloud is now attempting 100-200 refreshes of this calendar per day. It appears to try every 5 minutes for a while, then gives up for a while, then tries again every 5 minutes for another while.
According to the docs, the default value of
calendarSubscriptionRefreshRate
is 1x per week. I manually configured it to 1x per day on the off chance that the default setting had somehow changed to 5 minutes. No apparent change in behavior.Repro:
calendarSubscriptionRefreshRate
toP1D
. Still happens.Expected behavior
Nextcloud should not be flooding this poor server with refresh requests 100-200 times per day.
Actual behaviour
I don't know if the problem is that
calendarSubscriptionRefreshRate
is not being respected or if the 503 response from the remote server has triggered a different, more aggressive refresh policy until a successful connection is made. Either way, my logs show 164 attempts to refresh on Feb 5th, 204 on the 6th, and 122 so far for today the 7th.Calendar app version
4.2.3
CalDAV-clients used
Evolution, currently refreshing 1x per day
Browser
Firefox 109
Client operating system
Arch Linux
Server operating system
Ubuntu Server 22.04.1 LTS
Web server
Apache
Database engine version
MySQL
PHP engine version
PHP 8.0
Nextcloud version
25.0.3 installed from Snap
Updated from an older installed version or fresh install
Updated from an older version
List of activated apps
Nextcloud configuration
Web server error log
No response
Log file
Browser log
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: