nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.32k stars 4.06k forks source link

Don't exit calendar import when Invalid ICS "VALARM" block appears #25671

Open funwhilelost opened 3 years ago

funwhilelost commented 3 years ago

Steps to reproduce

  1. Import the attached ICS file to Nextcloud via the Calendar app - Zebras Unite Fireside Chat — on Clubhouse.zip

or

  1. Add ICS to Evolution with CalDAV as backend - Zebras Unite Fireside Chat — on Clubhouse.zip
  2. Click Next
  3. Select the WebDAV calendar
  4. Click Next

Expected behaviour

The appointment is added to the calendar, gracefully ignoring the invalid VALARM block:

BEGIN:VALARM
TRIGGER:-PT15M
UID:11847057@mn.co
END:VALARM

Actual behaviour

ICS File Contents

BEGIN:VCALENDAR
VERSION:2.0
PRODID:icalendar-ruby
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:DAYLIGHT
DTSTART:20210314T030000
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
TZNAME:PDT
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20201101T010000
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
TZNAME:PST
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20210215T232037Z
UID:11847057@mn.co
DTSTART;TZID=America/Los_Angeles:20210225T170000
DTEND;TZID=America/Los_Angeles:20210225T180000
DESCRIPTION:Zebras Unite\n\nJenny\, who runs a regular event series on Club
 house\, will be chatting with Mara Zepeda and me about all things Zebras U
 nite. This one may be recorded and available for later listening. The timi
 ng makes it less suitable for European time zones\, but some of you in Asi
 a / Oceania might be interested to drop in. As discussed previously\, Club
 house is an iOS only app at the moment that we are experimenting with.\n\n
 See More: https://mightynetworks.com/app/8/spaces/485142/posts/11847057%3F
 utm_campaign=calendar_sync&utm_medium=calendar&utm_source=calendar_link
LAST-MODIFIED;TZID=America/Los_Angeles:20210213T081854
LOCATION:https://mightynetworks.com/app/8/spaces/485142/posts/11847057%3Fut
 m_campaign=calendar_sync&utm_medium=calendar&utm_source=calendar_link
SUMMARY:Zebras Unite Fireside Chat — on Clubhouse
BEGIN:VALARM
TRIGGER:-PT15M
UID:11847057@mn.co
END:VALARM
BEGIN:VALARM
ACTION:AUDIO
TRIGGER:-PT15M
UID:11847057@mn.co
END:VALARM
BEGIN:VALARM
ACTION:DISPLAY
TRIGGER:-PT15M
DESCRIPTION:Zebras Unite Fireside Chat — on Clubhouse
END:VALARM
BEGIN:VALARM
ACTION:AUDIO
TRIGGER:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR

Server configuration

Operating system: Ubuntu 18.04 Web server: Apache (from snap) Database: MySQL 5.7.33 (from snap) PHP version: 7.4.14 (from snap) Nextcloud version: 20.0.7.1

Updated from an older Nextcloud/ownCloud or fresh install: updated via snap from ~18

Where did you install Nextcloud from: snap

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` Enabled: - accessibility: 1.6.0 - activity: 2.13.4 - bookmarks: 4.0.8 - calendar: 2.1.3 - camerarawpreviews: 0.7.10 - cloud_federation_api: 1.3.0 - comments: 1.10.0 - contacts: 3.4.3 - contactsinteraction: 1.1.0 - dashboard: 7.0.0 - dav: 1.16.2 - federatedfilesharing: 1.10.2 - federation: 1.10.1 - files: 1.15.0 - files_external: 1.11.1 - files_markdown: 2.3.1 - files_mindmap: 0.0.24 - files_pdfviewer: 2.0.1 - files_sharing: 1.12.2 - files_trashbin: 1.10.1 - files_versions: 1.13.0 - files_videoplayer: 1.9.0 - firstrunwizard: 2.9.0 - logreader: 2.5.0 - lookup_server_connector: 1.8.0 - metadata: 0.12.0 - music: 0.17.3 - news: 15.2.2 - nextcloud_announcements: 1.9.0 - notes: 4.0.2 - notifications: 2.8.0 - oauth2: 1.8.0 - password_policy: 1.10.1 - photos: 1.2.3 - polls: 1.7.5 - previewgenerator: 3.1.1 - privacy: 1.4.0 - provisioning_api: 1.10.0 - recommendations: 0.8.0 - serverinfo: 1.10.0 - settings: 1.2.0 - sharebymail: 1.10.0 - support: 1.3.0 - survey_client: 1.8.0 - systemtags: 1.10.0 - tasks: 0.13.6 - text: 3.1.0 - theming: 1.11.0 - twofactor_backupcodes: 1.9.0 - twofactor_totp: 5.0.0 - user_status: 1.0.1 - viewer: 1.4.0 - weather_status: 1.0.0 - workflowengine: 2.2.0 Disabled: - admin_audit - deck - drawio - encryption - end_to_end_encryption - event_update_notification - extract - files_readmemd - files_rightclick - gpxedit - keeweb - ownpad - spreed - user_ldap ```

Nextcloud configuration:

Config report ``` { "system": { "apps_paths": [ { "path": "\/snap\/nextcloud\/current\/htdocs\/apps", "url": "\/apps", "writable": false }, { "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps", "url": "\/extra-apps", "writable": true } ], "supportedDatabases": [ "mysql" ], "memcache.locking": "\\OC\\Memcache\\Redis", "memcache.local": "\\OC\\Memcache\\Redis", "redis": { "host": "***REMOVED SENSITIVE VALUE***", "port": 0 }, "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost", "redacted" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "20.0.7.1", "overwrite.cli.url": "http:\/\/localhost", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpauthtype": "LOGIN", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "loglevel": 0, "maintenance": false, "preview_max_x": "2048", "preview_max_y": "2048", "jpeg_quality": "60" } }

Are you using external storage, if yes which one: Yes, local and S3 app

Are you using encryption: yes

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Chrome 88 Operating system: Ubuntu 20.10

Logs

Web server error log

Web server error log ``` Unsure where to find in snap ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` Debug twofactor_totp /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug music /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug metadata /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug files_sharing /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug files_mindmap /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug files_markdown /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug files_external /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug contacts /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug serverDI The requested alias "PreviewManager" is depreacted. Please request "OCP\IPreview" directly. This alias will be removed in a future Nextcloud version. 2021-02-15T23:36:25+00:00 Debug camerarawpreviews /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:25+00:00 Debug music /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:29+00:00 Debug files_sharing /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:29+00:00 Debug files_external /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:29+00:00 Debug contacts /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:29+00:00 Debug serverDI The requested alias "PreviewManager" is depreacted. Please request "OCP\IPreview" directly. This alias will be removed in a future Nextcloud version. 2021-02-15T23:36:29+00:00 Debug camerarawpreviews /appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead. 2021-02-15T23:36:29+00:00 ```

Browser log

Browser log ``` request.js:339 PUT https://redacted/remote.php/dav/calendars/redacted/personal/redacted.ics 415 (Unsupported Media Type) (anonymous) @ request.js:339 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 de @ calendar.js?v=cbb3d741-0:2 i @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ request.js:117 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 de @ calendar.js?v=cbb3d741-0:2 i @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ davCollection.js:173 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 Le @ calendar.js?v=cbb3d741-0:2 i @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ davCollection.js:33 (anonymous) @ calendar.js:53 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 Ft @ calendar.js?v=cbb3d741-0:2 i @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js:53 (anonymous) @ calendars.js:809 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 fe @ calendar.js?v=cbb3d741-0:2 i @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ index.js:4 r @ index.js:3 (anonymous) @ index.js:24 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 r @ calendar.js?v=cbb3d741-0:2 a @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ index.js:20 (anonymous) @ index.js:46 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 r @ calendar.js?v=cbb3d741-0:2 a @ calendar.js?v=cbb3d741-0:2 Promise.then (async) r @ calendar.js?v=cbb3d741-0:2 a @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 a @ index.js:38 (anonymous) @ index.js:51 c @ index.js:51 i @ calendars.js:804 h @ calendars.js:803 (anonymous) @ calendars.js:799 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 fe @ calendar.js?v=cbb3d741-0:2 i @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 importEventsIntoCalendar @ calendars.js:753 (anonymous) @ vuex.esm.js:847 m.dispatch @ vuex.esm.js:512 dispatch @ vuex.esm.js:402 (anonymous) @ SettingsImportSection.vue:241 u @ runtime.js:63 (anonymous) @ runtime.js:293 (anonymous) @ runtime.js:118 Ao @ calendar.js?v=cbb3d741-0:2 i @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 (anonymous) @ calendar.js?v=cbb3d741-0:2 importCalendar @ SettingsImportSection.vue:240 He @ vue.runtime.esm.js:1854 n @ vue.runtime.esm.js:2179 He @ vue.runtime.esm.js:1854 e.$emit @ vue.runtime.esm.js:3888 importCalendar @ ImportScreen.vue:79 He @ vue.runtime.esm.js:1854 n @ vue.runtime.esm.js:2179 s._wrapper @ vue.runtime.esm.js:6917 Show 69 more frames calendars.js:812 Error at XMLHttpRequest.n.value.regeneratorRuntime.mark.regeneratorRuntime.wrap.e.abrupt.a.onreadystatechange (request.js:353) ``` ``` curl 'https://redacted/remote.php/dav/calendars/redacted/personal/redacted.ics' \ -X 'PUT' \ -H 'Connection: keep-alive' \ -H 'Pragma: no-cache' \ -H 'Cache-Control: no-cache' \ -H 'X-NC-CalDAV-Webcal-Caching: On' \ -H 'requesttoken: J20FL0tyOXciR62kFzowJizoh9Ix9NpsYI4dYTiXo9U=:aDVXQh41YztODJ/TVQ5CanyO7Z9ghZtHDrolU1b99IE=' \ -H 'DNT: 1' \ -H 'X-Requested-With: XMLHttpRequest' \ -H 'Depth: 0' \ -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36' \ -H 'Content-Type: text/calendar; charset=UTF-8' \ -H 'Accept: */*' \ -H 'Origin: redacted' \ -H 'Sec-Fetch-Site: same-origin' \ -H 'Sec-Fetch-Mode: cors' \ -H 'Sec-Fetch-Dest: empty' \ -H 'Accept-Language: en-US,en;q=0.9' \ -H 'Cookie: redacted;' \ --data-raw $'BEGIN:VCALENDAR\r\nCALSCALE:GREGORIAN\r\nVERSION:2.0\r\nPRODID:icalendar-ruby\r\nBEGIN:VTIMEZONE\r\nTZID:America/Los_Angeles\r\nBEGIN:DAYLIGHT\r\nTZOFFSETFROM:-0800\r\nTZOFFSETTO:-0700\r\nTZNAME:PDT\r\nDTSTART:19700308T020000\r\nRRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU\r\nEND:DAYLIGHT\r\nBEGIN:STANDARD\r\nTZOFFSETFROM:-0700\r\nTZOFFSETTO:-0800\r\nTZNAME:PST\r\nDTSTART:19701101T020000\r\nRRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU\r\nEND:STANDARD\r\nEND:VTIMEZONE\r\nBEGIN:VEVENT\r\nDTSTAMP:20210215T232037Z\r\nUID:11847057@mn.co\r\nDTSTART;TZID=America/Los_Angeles:20210225T170000\r\nDTEND;TZID=America/Los_Angeles:20210225T180000\r\nDESCRIPTION:Zebras Unite\\n\\nJenny\\, who runs a regular event series on Club\r\n house\\, will be chatting with Mara Zepeda and me about all things Zebras Un\r\n ite. This one may be recorded and available for later listening. The timing\r\n makes it less suitable for European time zones\\, but some of you in Asia /\r\n Oceania might be interested to drop in. As discussed previously\\, Clubhous\r\n e is an iOS only app at the moment that we are experimenting with.\\n\\nSee M\r\n ore: https://mightynetworks.com/app/8/spaces/485142/posts/11847057%3Futm_ca\r\n mpaign=calendar_sync&utm_medium=calendar&utm_source=calendar_link\r\nLAST-MODIFIED;TZID=America/Los_Angeles:20210213T081854\r\nLOCATION:https://mightynetworks.com/app/8/spaces/485142/posts/11847057%3Fut\r\n m_campaign=calendar_sync&utm_medium=calendar&utm_source=calendar_link\r\nSUMMARY:Zebras Unite Fireside Chat — on Clubhouse\r\nBEGIN:VALARM\r\nTRIGGER:-PT15M\r\nUID:11847057@mn.co\r\nEND:VALARM\r\nBEGIN:VALARM\r\nACTION:AUDIO\r\nTRIGGER:-PT15M\r\nUID:11847057@mn.co\r\nEND:VALARM\r\nBEGIN:VALARM\r\nACTION:DISPLAY\r\nTRIGGER:-PT15M\r\nDESCRIPTION:Zebras Unite Fireside Chat — on Clubhouse\r\nEND:VALARM\r\nBEGIN:VALARM\r\nACTION:AUDIO\r\nTRIGGER:-PT15M\r\nEND:VALARM\r\nEND:VEVENT\r\nEND:VCALENDAR' \ --compressed ``` ``` Sabre\DAV\Exception\UnsupportedMediaType Validation error in iCalendar: ACTION MUST appear exactly once in a VALARM component ```
tcitworld commented 3 years ago

The ICS file is invalid, since ACTION is missing in a VALARM. What you're asking is to ignore only the invalid VALARM block, and not failing to process the whole VCALENDAR, correct?

funwhilelost commented 3 years ago

@tcitworld - yeah that was my expectation as a user. It's a very esoteric thing to prevent an appointment from being imported and I'm not sure most people would know how to remedy it. I've escalated the issue with the service that sent the file, too.

Ah - my issue title wasn't updated after I discovered the underlying syntax issue. Thanks for clarifying. I've updated the title now. Totally understand if this is a "wontfix"

tcitworld commented 3 years ago

The issue is in a dependency handling CalDAV support, any issue in any component can trigger the exception and stopping the file from being validated, so it would have to be taken upstream (but SabreDAV development isn't active anymore). https://github.com/nextcloud/3rdparty/blob/4466d782fafe2b53f3839156d10be0d3eacb47d6/sabre/dav/lib/CalDAV/Plugin.php#L873

szaimen commented 3 years ago

So should this be reported to sabra/dav instead?

tcitworld commented 3 years ago

Yeah, the issue should argue that this case should be a case 1 (repairable) or 2 error level, and not through an exception like this.

Toover commented 2 years ago

Now there's a bounty on it: https://www.bountysource.com/issues/96640198-don-t-exit-calendar-import-when-invalid-ics-valarm-block-appears @funwhilelost would you care sharing that with your friends on Clubhouse ? The more the merrier ;)