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

Browser tab hangs when loading calendar #4758

Closed
TinfoilSubmarine opened this issue Nov 20, 2022 · 6 comments
Closed

Browser tab hangs when loading calendar #4758

TinfoilSubmarine opened this issue Nov 20, 2022 · 6 comments
Labels
0. to triage Pending approval or rejection bug performance 🚀

Comments

@TinfoilSubmarine
Copy link

Steps to reproduce

  1. Open nextcloud
  2. Select calendar

Expected behavior

Browser tab should not freeze and allow me to use calendar app.

Actual behaviour

Unable to select anything in calendar as the tab is frozen.

Calendar app version

4.1.0

CalDAV-clients used

DAVx5

Browser

Firefox (Linux) 107.0, Chromium (Linux) 107.0.5304.87, Fennec/Firefox (Android) 105.1.0

Client operating system

Void Linux (x86_64-glibc), Android 11

Server operating system

Void Linux (x86_64-glibc)

Web server

Other

Database engine version

PostgreSQL

PHP engine version

PHP 8.1

Nextcloud version

25.0.1

Updated from an older installed version or fresh install

Updated from an older version

List of activated apps

Enabled:
  - activity: 2.17.0
  - calendar: 4.1.0
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - contacts: 5.0.1
  - contactsinteraction: 1.6.0
  - cookbook: 0.10.1
  - dav: 1.24.0
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - firstrunwizard: 2.14.0
  - gpoddersync: 3.7.1
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - mediadc: 0.2.0
  - nextcloud_announcements: 1.14.0
  - notes: 4.6.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - photos: 2.0.0
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - related_resources: 1.0.3
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - survey_client: 1.13.0
  - systemtags: 1.15.0
  - tasks: 0.14.5
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - viewer: 1.9.0
  - workflowengine: 2.7.0
Disabled:
  - admin_audit
  - bruteforcesettings: 2.4.0
  - comments: 1.9.0
  - dashboard: 7.4.0
  - encryption
  - files_external
  - password_policy: 1.13.0
  - recommendations: 0.7.0
  - sharebymail: 1.9.0
  - support: 1.2.1
  - suspicious_login
  - twofactor_totp
  - user_ldap
  - user_status: 1.3.1
  - weather_status: 1.4.0

Nextcloud configuration

{
    "system": {
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "apps_paths": [
            {
                "path": "\/usr\/share\/webapps\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/lib\/nextcloud\/apps",
                "url": "\/wapps",
                "writable": true
            }
        ],
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud.beckmeyer.us"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "version": "25.0.1.1",
        "overwrite.cli.url": "https:\/\/cloud.beckmeyer.us",
        "dbtype": "pgsql",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "log_type": "syslog",
        "syslog_tag": "nextcloud",
        "logfile": "",
        "loglevel": 0,
        "mail_smtpmode": "smtp",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtpauthtype": "LOGIN",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "updater.release.channel": "stable",
        "trashbin_retention_obligation": "auto, 28",
        "versions_retention_obligation": "auto, 14",
        "default_phone_region": "US",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "overwriteprotocol": "https",
        "maintenance": false
    }
}

Web server error log

No response

Log file

No response

Browser log

Proxying an event bus of version 2.1.1 with 1.3.0 index.es.js:2337:14
JQMIGRATE: Migrate is installed, version 3.4.0 jquery-migrate.min.js:2:698
Proxying an event bus of version 2.1.1 with 1.3.0 index.es.js:2337:14
jQuery is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:60:15
Proxying an event bus of version 2.1.1 with 3.0.2 ProxyBus.ts:16:20
Proxying an event bus of version 2.1.1 with 3.0.2 ProxyBus.ts:16:20
Proxying an event bus of version 2.1.1 with 1.3.0 index.es.js:2337:14
$ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. globals.js:60:15
Registering notifications container as a menu NotificationsApp.vue:219
$ is deprecated: The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own. 2 globals.js:60:15
Notifications permissions granted NotificationsApp.vue:444
Polling interval updated to 30000 NotificationsApp.vue:404
Started background fetcher as session_keepalive is enabled NotificationsApp.vue:266
Proxying an event bus of version 2.1.1 with 3.0.2 index.js:19:12
Proxying an event bus of version 2.1.1 with 1.3.0 index.es.js:2337:6
Proxying an event bus of version 2.1.1 with 3.0.2 index.esm.js:11:12
[INFO] calendar: 
Initial settings:
	- AppVersion: 4.1.0
	- EventLimit: true
	- FirstRun: true
	- ShowWeekNumbers: false
	- ShowTasks: true
	- ShowWeekends: true
	- SkipPopover: false
	- SlotDuration: 00:30:00
	- DefaultReminder: none
	- TalkEnabled: false
	- TasksEnabled: true
	- Timezone: automatic
	- HideEventExport: false
	- ForceEventAlarmType: false
	- disableAppointments: false
 
Object { level: 0, app: "calendar", uid: "joel" }
ConsoleLogger.js:56:10
[DEBUG] @nextcloud/vue: Using version 2.2019c of the timezone database 
Object { level: 0, uid: "joel", app: "@nextcloud/vue" }
ConsoleLogger.js:52:10
You need to fill either the text or the ariaLabel props in the button component. 
Object { text: null, ariaLabel: null }
 
Object { _uid: 21, _isVue: true, __v_skip: true, _scope: {…}, "$options": {…}, _renderProxy: {…}, _self: {…}, "$parent": {…}, "$root": {…}, "$children": (1) […], … }
NcButton.js:1:20661
@nextcloud/calendar-js app is using version 2.2019c of the timezone database index.esm.js:14166:4
Fallback to locale en moment.js:85:3
[INFO] calendar: Updated moment locale: en 
Object { level: 0, app: "calendar", uid: "joel" }
ConsoleLogger.js:56:10
session heartbeat polling started session-heartbeat.js:103:9
[DEBUG] unified-search: Unified Search initialized with the following providers 
Object { 0: {…}, 1: {…}, 2: {…}, 3: {…}, 4: {…}, 5: {…}, 6: {…}, 7: {…}, 8: {…}, 9: {…}, … }
ConsoleLogger.js:52:10
Got notification data NotificationsApp.vue:367
Polling interval updated to 30000 NotificationsApp.vue:404
[DEBUG] calendar: Current user principal is /remote.php/dav/principals/users/joel/ 
Object { level: 0, app: "calendar", uid: "joel" }
ConsoleLogger.js:52:10
calendar home scanned 
Array(4) [ {…}, {…}, {…}, {…} ]
 
Array [ {…} ]
calendars.js:573:2
You need to fill either the text or the ariaLabel props in the button component. 
Object { text: null, ariaLabel: null }
 
Object { _uid: 1122, _isVue: true, __v_skip: true, _scope: {…}, "$options": {…}, _renderProxy: {…}, _self: {…}, "$parent": {…}, "$root": {…}, "$children": (1) […], … }
NcActions.js:2:2713
You need to fill either the text or the ariaLabel props in the button component. 
Object { text: null, ariaLabel: null }
 
Object { _uid: 1150, _isVue: true, __v_skip: true, _scope: {…}, "$options": {…}, _renderProxy: {…}, _self: {…}, "$parent": {…}, "$root": {…}, "$children": (1) […], … }
NcActions.js:2:2713
You need to fill either the text or the ariaLabel props in the button component. 
Object { text: null, ariaLabel: null }
 
Object { _uid: 1189, _isVue: true, __v_skip: true, _scope: {…}, "$options": {…}, _renderProxy: {…}, _self: {…}, "$parent": {…}, "$root": {…}, "$children": (1) […], … }
NcActions.js:2:2713
You need to fill either the text or the ariaLabel props in the button component. 
Object { text: null, ariaLabel: null }
 
Object { _uid: 1228, _isVue: true, __v_skip: true, _scope: {…}, "$options": {…}, _renderProxy: {…}, _self: {…}, "$parent": {…}, "$root": {…}, "$children": (1) […], … }
NcActions.js:2:2713
[DEBUG] calendar: calendars and trash bin loaded 
Object { level: 0, app: "calendar", uid: "joel", calendars: (4) […], trashBin: {…} }
ConsoleLogger.js:52:10
Script terminated by timeout at:
set@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4065479
fromData@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4059461
18350/r.Time@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4058427
clone@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4058654
nthWeekDay@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4061342
is_day_in_byday@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4089248
next_month@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4081779
next@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4078887
_getRecurExpansionObject@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:61497
getAllOccurrencesBetweenIterator@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:59407
getAllOccurrencesBetween@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:60055
BB@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5445858
jB@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5447218
ZB/</n/<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5456547
c@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5450276
YB/l/i._invoke@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5450030
YB/v/</<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5450639
zB@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5455513
o@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5455843
promise callback*zB@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5455584
o@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5455843
ZB/</n/n<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5455903
ZB/</n@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5455781
ZB/</r.events<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5456736
xx@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5264665
fetch@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5294538
m_@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5288412
f_@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5288268
h_@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5287988
p_@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5287936
u_@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5287187
t.prototype._handleAction@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5302500
t.prototype.runTask@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5298130
t.prototype.drain@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5298034
t.prototype.drained@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5297561
t.prototype.tryDrain@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5297288
t.prototype.request@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5296752
t.prototype.request@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5297797
t.prototype.resetOptions@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5301195
e.prototype.resetOptions@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5352581
handler@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:5354295
Re@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4630676
20144/t.prototype.run@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4634238
Tn@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4636057
20144/Ge/<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4631735
Le@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4631134
promise callback*Me@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4631224
Ge@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4631798
yn@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4636675
20144/t.prototype.update@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4634027
20144/t.prototype.notify@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4619433
20144/</<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4619917
addCalendar@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6215030
Be/</<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4832672
xe.prototype.commit/</<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4834203
xe.prototype.commit/<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4834181
xe.prototype._withCommit@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4836030
xe.prototype.commit@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4834155
xe/this.commit@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4830110
loadCollections/e/</<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6221259
loadCollections/e/<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6221237
c@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6207998
VV/l/i._invoke@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6207752
VV/v/</<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6208361
WV@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6213235
o@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6213441
promise callback*WV@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6213306
o@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6213441
qV/</<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6213501
qV/<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6213379
loadCollections@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:6221521
Be/</<@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4832856
xe.prototype.dispatch@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4834614
xe/this.dispatch@https://cloud.beckmeyer.us/apps/calendar/js/calendar-main.js?v=b72653ce-18:2:4830060

Additional info

Using caddy 2.6.2 as webserver.

@TinfoilSubmarine TinfoilSubmarine added 0. to triage Pending approval or rejection bug labels Nov 20, 2022
@jmcclelland
Copy link
Contributor

jmcclelland commented Aug 6, 2023

I had the same experience when upgrading from version 24 to version 27 (and also using Postgres).

I also noticed that it doesn't happen for all users - presumably only for users with more than a certain number of calendars or calendar items??

I traced the problem to a query that postgres cannot complete in a time:

SELECT
  "c"."id",
  "c"."calendardata",
  "c"."componenttype",
  "c"."uid",
  "c"."uri"
FROM
  "oc_calendarobjects" "c"
WHERE
  ("deleted_at" IS NULL)
  AND (
    "c"."id" IN (
      SELECT
        DISTINCT "op"."objectid"
      FROM
        "oc_calendarobjects_props" "op"
      WHERE
        ("op"."calendarid" = 225)
        AND ("op"."calendartype" = 0)
        AND ("c"."classification" = 0)
        AND ("op"."name" = 'CATEGORIES')
    )
  );

It is not well-optimized. This version works much better in postgres:

SELECT
  "c"."id",
  "c"."calendardata",
  "c"."componenttype",
  "c"."uid",
  "c"."uri"
FROM
  "oc_calendarobjects" "c"
WHERE
  ("deleted_at" IS NULL)
  AND c.classification = 0
  AND (
    "c"."id" IN (
      SELECT
        DISTINCT "op"."objectid"
      FROM
        "oc_calendarobjects_props" "op"
      WHERE
        ("op"."calendarid" = 225)
        AND ("op"."calendartype" = 0)
        AND ("op"."name" = 'CATEGORIES')
    )
  );

I fixed the Nextcloud code with the following:

root@6fb3a622dcf2:/var/www/nextcloud/27.0.1/apps/dav/lib/CalDAV# diff -u CalDavBackend.php CalDavBackend.php.orig 
--- CalDavBackend.php   2023-08-06 05:42:56.623176554 +0000
+++ CalDavBackend.php.orig      2023-08-06 05:08:19.919725021 +0000
@@ -1847,7 +1847,7 @@
 
                // only return public items for shared calendars for now
                if (isset($calendarInfo['{http://owncloud.org/ns}owner-principal']) === false || $calendarInfo['principaluri'] !== $calendarInfo['{http://owncloud.org/ns}owner-principal']) {
-                       $outerQuery->andWhere($outerQuery->expr()->eq('c.classification',
+                       $innerQuery->andWhere($innerQuery->expr()->eq('c.classification',
                                $outerQuery->createNamedParameter(self::CLASSIFICATION_PUBLIC)));
                }
 

Would be curious to know if this resolves the issue for you.

@ChristophWurst
Copy link
Member

That patch makes a lot of sense. It's strange that we use the classification condition in the sub query on the properties table.

Could you please submit this as PR against https://github.com/nextcloud/server?

Thanks 🙏

@TinfoilSubmarine
Copy link
Author

Would be curious to know if this resolves the issue for you.

I just loaded up my calendar to see if I was still having this problem and I am not, so probably wouldn't be worth pulling the patch in. Looks like it might help others though if it gets merged 👍

@ChristophWurst
Copy link
Member

Let's get it in

jmcclelland added a commit to jmcclelland/server that referenced this issue Aug 7, 2023
@jmcclelland
Copy link
Contributor

Great - glad it is helpful. Let me know if there is anything else I can do.

jmcclelland added a commit to jmcclelland/server that referenced this issue Aug 7, 2023
backportbot-nextcloud bot pushed a commit to nextcloud/server that referenced this issue Aug 10, 2023
backportbot-nextcloud bot pushed a commit to nextcloud/server that referenced this issue Aug 10, 2023
backportbot-nextcloud bot pushed a commit to nextcloud/server that referenced this issue Aug 10, 2023
AndyScherzinger pushed a commit to nextcloud/server that referenced this issue Aug 10, 2023
@joshtrichards
Copy link
Member

Fixed in nextcloud/server#39741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. to triage Pending approval or rejection bug performance 🚀
Projects
None yet
Development

No branches or pull requests

4 participants