nextcloud / calendar

📆 Calendar app for Nextcloud
https://apps.nextcloud.com/apps/calendar
GNU Affero General Public License v3.0
989 stars 240 forks source link

Importing some ICS files from Horde can crash the calendar app and make it very difficult to recover #642

Open Debianer opened 7 years ago

Debianer commented 7 years ago

Nextcloud 12.0.3 Calendar 1.5.6

Steps to reproduce

  1. Create Calendar in Horde with repeating events etc. (dunno exactly what kind of data triggers the bug, but not all, since one export was sucessful
  2. Export ICS file from Horde
  3. Import ICS file into Calendar on Nextcloud

Expected behaviour

File should get imported

Actual behaviour

I see a blue bar moving in a white box. After about 25 seconds the box disappear without the blue bar having finished. Then the circle next to the calendar starts to turn. The load from the web page increases and I can't click on anything. After some time the browser will tell me the site has crashed (Chromium) or the site takes too long and if I want to cut it off (Firefox). If I try to get to the calendar, it will show the same behavior every time. Working with the calendar is not possible. If the calendar is shared, other users that see the calendar will not be able to use the calendar plugin as well.

I can only delete the calendar from the tasks tab.

After deleting that calendar from the tasks tab, I can successfully see and calendar again. But when I try to set a new appointment, I can only do that for the whole day. Any appointment in any calendar will fail to be created, if I enter a time.

Server configuration

General server configuration

Operating system: Linux 2.6.32-696.13.2.el6.x86_64 #1 SMP Thu Oct 5 21:22:16 UTC 2017 x86_64

Web server: Apache (cgi-fcgi)

Database: mysql 5.6.38

PHP version: 7.1.10

PHP-modules loaded ``` - Core - date - libxml - openssl - pcre - zlib - bcmath - bz2 - calendar - ctype - dom - hash - fileinfo - filter - ftp - gettext - SPL - iconv - json - mbstring - session - standard - posix - readline - Reflection - Phar - shmop - SimpleXML - soap - sockets - exif - sysvmsg - sysvsem - sysvshm - tokenizer - wddx - xml - xmlreader - xmlwriter - zip - mysqlnd - cgi-fcgi - curl - gd - imap - mcrypt - mysqli - PDO - pdo_mysql - PDO_ODBC - xsl - sqlite3 - pdo_sqlite - gmp - pcntl - intl - ionCube Loader - Zend OPcache ```

Nextcloud configuration

Nextcloud version: 12.0.3 - 12.0.3.3

Updated from an older Nextcloud/ownCloud or fresh install: freshh install

Where did you install Nextcloud from: Nextcloud homepage zipfile

Are you using external storage, if yes which one: files_external is disabled

Are you using encryption: no

Are you using an external user-backend, if yes which one: no (LDAP/ActiveDirectory/Webdav/...)

Signing status ``` { "core": { "EXTRA_FILE": { "nextcloud-12.0.3.zip": { "expected": "", "current": "f13f0810b1755abdcac8c72e69417baeebd759943afb6743530a136b440ac9bebded8dae282450056c0613f5982b15f41aefba3b766ebb5eaea3d3a0e82710cc" } } } } ```
Enabled apps ``` - activity: 2.5.2 - bruteforcesettings: 1.0.2 - calendar: 1.5.6 - comments: 1.2.0 - dav: 1.3.0 - federatedfilesharing: 1.2.0 - federation: 1.2.0 - files: 1.7.2 - files_pdfviewer: 1.1.1 - files_sharing: 1.4.0 - files_texteditor: 2.4.1 - files_trashbin: 1.2.0 - files_versions: 1.5.0 - files_videoplayer: 1.1.0 - firstrunwizard: 2.1 - gallery: 17.0.0 - issuetemplate: 0.2.2 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - nextcloud_announcements: 1.1 - notifications: 2.0.0 - oauth2: 1.0.5 - password_policy: 1.2.2 - provisioning_api: 1.2.0 - serverinfo: 1.2.0 - sharebymail: 1.2.0 - survey_client: 1.0.0 - systemtags: 1.2.0 - tasks: 0.9.5 - theming: 1.3.0 - twofactor_backupcodes: 1.1.1 - updatenotification: 1.2.0 - workflowengine: 1.2.0 ```
Disabled apps ``` - admin_audit - encryption - files_external - user_external - user_ldap ```
Content of config/config.php ``` { "instanceid": "ocpreow41n59", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "xxx.xx" ], "datadirectory": "\/var\/www\/vhosts\/hostingxxx/data", "overwrite.cli.url": "https:\/\/xxx.xx", "dbtype": "mysql", "version": "12.0.3.3", "dbname": "xxx", "dbhost": "xxxxxxxxxx", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "mail_smtpmode": "smtp", "mail_smtpauthtype": "LOGIN" } ```

Client configuration

Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Operating system: Linux

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/50772617-importing-some-ics-files-from-horde-can-crash-the-calendar-app-and-make-it-very-difficult-to-recover?utm_campaign=plugin&utm_content=tracker%2F45525646&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F45525646&utm_medium=issues&utm_source=github).
georgehrke commented 7 years ago

@Debianer Is there any way for u to post an anonymous version of the ics file?

Without knowing what the ics looks like it's not really feasible to tackle this issue. Does it contain very complex VTIMEZONE rules?

georgehrke commented 7 years ago

Furthermore provide log messages please.

Debianer commented 7 years ago

I have a workaround: I imported an ics file that was causing this crash into Thunderbird and exported it again. It imported into Nextcloud fine.

Debianer commented 7 years ago

@georgehrke I did not find anything interesting in the logs. I checked the webserver log and data/nextcloud.log

I don't want to publicly post the ics file. Yes there are VTIMEZONE rules. I can't tell how complex they are. I can send you two ics files that were causing this issue if you are interested.

Zeuh commented 7 years ago

@debianer : could you run diff on ICS files (before/after thunderbird) ?

georgehrke commented 7 years ago

@Zeuh @Debianer was so nice to send me the two ics files. The diff is not very helpful, because Thunderbird also rearranged some VEvents.

Will look into this next week

christianlupus commented 6 years ago

I can confirm this bug. I created a new calendar in horde and added a single event to it. As soon as I mark the event a repeating one, the import fails. Here is the sample data: https://gist.github.com/christianlupus/186c39f305fc7ec080b7bba2d4d51d45. The event is in Feb 2018. You might need to deselect/select the calender to trigger it.

Some more remarks/findings:

In data/nextcloud.log nothing is logged if the error is triggered.

georgehrke commented 6 years ago

@christianlupus Yours is the bug with extremely complex VTIMEZONE rules i mentioned above: https://github.com/mozilla-comm/ical.js/issues/318

BigMichi1 commented 5 years ago

is it possible to patch the ical.js lib to include a check that years shouldn't be greater than lets say 2100, see https://github.com/mozilla-comm/ical.js/issues/318#issuecomment-543567396

no-response[bot] commented 5 years ago

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

georgehrke commented 5 years ago

Sorry for that, doesn't need info, reproducible bug

RainerB commented 4 years ago

Just a short confirmation that I experience a (very) similar issue with Nextcloud 17.0.2. Horde calendar export, then import to NC calendar is working fine. But if I try to create a new entry (doesn't matter which calendar), my browser (Firefox/Chrome) slows down ("freezes" the tab) and the browser offers to stop the affected script. The operation (new calendar entry) doesn't finish. The mentioned workaround (export horde calendar, import to thunderbird or evolution, export and then import to nextcloud) works without any issues and therefore I didn't proceed with troubleshooting.

miaulalala commented 2 months ago

I'm extrapolating from incomplete data here but I assume, due to the sample data provided, that this is an issue of never- ending recurrences crashing the intance with a MaxRecurrencesExceeded exception.

fixed by https://github.com/nextcloud/server/pull/47924