nextcloud / calendar

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

Appointments throws internal server error #4985

Open hanserasmus opened 1 year ago

hanserasmus commented 1 year ago

Steps to reproduce

  1. Create a new Appointments calendar
  2. Book a slot on this calendar by using the public link
  3. Check the email you used to book the slot with for confirmation link
  4. Click the link.

Expected behavior

Get a confirmation email or have the calendar event actually created.

Actual behaviour

The link in the email results in an Internal Server Error. The event is not added to the calendar and there is a log entry in nextcloud.log with the following content:

{"reqId":"Y@tww0iFaiZ7gYnCeqhzUQAAAAQ","level":3,"time":"2023-02-14T13:30:11+02:00","remoteAddr":"192.168.10.137","user":"--","app":"index","method":"GET","url":"/apps/calendar/appointment/confirm/DSLocQlaGZyxQf9CXUTi4gRn8kJzfsrc","message":"Calendarobject does not exists: sabredav-f80e3a95-40a5-4fbd-af81-702826e47076.ics","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36","version":"25.0.2.3","exception":{"Exception":"InvalidArgumentException","Message":"Calendarobject does not exists: sabredav-f80e3a95-40a5-4fbd-af81-702826e47076.ics","Code":0,"Trace":[{"file":"/var/www/html/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php","line":2906,"function":"getCalendarObjectId","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php","line":1270,"function":"updateProperties","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Calendar.php","line":199,"function":"createCalendarObject","class":"OCA\\DAV\\CalDAV\\CalDavBackend","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php","line":525,"function":"createFile","class":"Sabre\\CalDAV\\Calendar","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/CalDAV/Schedule/Plugin.php","line":177,"function":"scheduleLocalDelivery","class":"Sabre\\CalDAV\\Schedule\\Plugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"scheduleLocalDelivery","class":"OCA\\DAV\\CalDAV\\Schedule\\Plugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php","line":350,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php","line":627,"function":"deliver","class":"Sabre\\CalDAV\\Schedule\\Plugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php","line":337,"function":"processICalendarChange","class":"Sabre\\CalDAV\\Schedule\\Plugin","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/CalDAV/Schedule/Plugin.php","line":162,"function":"calendarObjectChange","class":"Sabre\\CalDAV\\Schedule\\Plugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"calendarObjectChange","class":"OCA\\DAV\\CalDAV\\Schedule\\Plugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Plugin.php","line":897,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Plugin.php","line":766,"function":"validateICalendar","class":"Sabre\\CalDAV\\Plugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/event/lib/WildcardEmitterTrait.php","line":89,"function":"beforeCreateFile","class":"Sabre\\CalDAV\\Plugin","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php","line":1094,"function":"emit","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/dav/lib/CalDAV/CalendarImpl.php","line":175,"function":"createFile","class":"Sabre\\DAV\\Server","type":"->"},{"file":"/var/www/html/nextcloud/apps/calendar/lib/Service/Appointments/BookingCalendarWriter.php","line":178,"function":"createFromString","class":"OCA\\DAV\\CalDAV\\CalendarImpl","type":"->"},{"file":"/var/www/html/nextcloud/apps/calendar/lib/Service/Appointments/BookingService.php","line":115,"function":"write","class":"OCA\\Calendar\\Service\\Appointments\\BookingCalendarWriter","type":"->"},{"file":"/var/www/html/nextcloud/apps/calendar/lib/Controller/BookingController.php","line":249,"function":"confirmBooking","class":"OCA\\Calendar\\Service\\Appointments\\BookingService","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"confirmBooking","class":"OCA\\Calendar\\Controller\\BookingController","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/nextcloud/lib/base.php","line":1047,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/nextcloud/apps/dav/lib/CalDAV/CalDavBackend.php","Line":3092,"CustomMessage":"--"}}

Calendar app version

4.2.3

CalDAV-clients used

iOS, Android, Gnome

Browser

Brave Browser Vers 1.48.158 Chromium 110.0.5481.77, Firefox 109.0.1

Client operating system

Ubuntu 22.04

Server operating system

CentOS 8 Stream

Web server

Apache

Database engine version

MariaDB

PHP engine version

PHP 8.0

Nextcloud version

25.0.2

Updated from an older installed version or fresh install

None

List of activated apps

Enabled:
  - activity: 2.17.0
  - admin_audit: 1.15.0
  - announcementcenter: 6.4.0
  - approval: 1.0.12
  - calendar: 4.2.3
  - camerarawpreviews: 0.8.1
  - cloud_federation_api: 1.8.0
  - comments: 1.15.0
  - contacts: 5.1.0
  - contactsinteraction: 1.6.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - deck: 1.8.3
  - drawio: 2.1.0
  - electronicsignatures: 2.0.3
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_downloadactivity: 1.15.0
  - files_fulltextsearch: 25.0.0
  - 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
  - forms: 3.0.4
  - fulltextsearch: 25.0.0
  - fulltextsearch_elasticsearch: 25.0.0
  - groupfolders: 13.1.1
  - impersonate: 1.11.0
  - integration_github: 1.0.15
  - integration_openproject: 2.2.1
  - integration_twitter: 1.0.3
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - mail: 2.2.2
  - memories: 4.10.3
  - nextcloud_announcements: 1.14.0
  - notes: 4.6.0
  - notifications: 2.13.1
  - oauth2: 1.13.0
  - onlyoffice: 7.6.8
  - password_policy: 1.15.0
  - passwords: 2023.1.13
  - photos: 2.0.1
  - previewgenerator: 5.1.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - ransomware_protection: 1.14.0
  - related_resources: 1.0.3
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - spreed: 15.0.3
  - suspicious_login: 4.3.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
  - user_ldap: 1.15.0
  - user_status: 1.5.0
  - user_usage_report: 1.9.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflowengine: 2.7.0

Nextcloud configuration

{
    "system": {
        "app.mail.imap.timeout": 25,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "192.168.10.6",
            "192.168.10.4",
            "nextcloud.hbps.co.za"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "25.0.2.3",
        "overwrite.cli.url": "http:\/\/nextcloud.hbps.co.za",
        "htaccess.RewriteBase": "\/",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "3306",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "Africa\/Johannesburg",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "maintenance": false,
        "onlyoffice": {
            "verify_peer_off": true
        },
        "allow_local_remote_servers": true,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": 0,
        "app_install_overwrite": [
            "breezedark",
            "drawio",
            "fulltextsearch",
            "fulltextsearch_elasticsearch",
            "files_fulltextsearch",
            "onlyoffice",
            "groupfolders",
            "ransomware_protection",
            "spreed",
            "rocketchat_nextcloud",
            "passwords",
            "electronicsignatures",
            "impersonate"
        ],
        "default_phone_region": "ISO 3166-2:ZA",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "preview_max_memory": 4096,
        "preview_max_filesize_image": 256,
        "memories.ffmpeg_path": "\/bin\/ffmpeg",
        "memories.ffprobe_path": "\/bin\/ffprobe",
        "memories.transcoder": "\/var\/www\/html\/nextcloud\/apps\/memories\/exiftool-bin\/go-vod-amd64",
        "memories.no_transcode": false,
        "memories.qsv": false
    }
}

Web server error log

No response

Log file

No response

Browser log

No response

Additional info

There are no errors in my Nextcloud Overview page. Am I missing something?

tcitworld commented 1 year ago

It seems the calendar object was inserted, but can't be found again when reading afterwards from reading into the database. Is your database using a special setup (cluster) ?

In any case, https://github.com/nextcloud/server/pull/36528 should fix this.

hanserasmus commented 1 year ago

Yes. I needed to build a proof of concept cluster setup with Galera and Maxscale specifically for someone. Decided to do it on my own instance first.

Ok will wait for the fix to be merged and update my calendar app, and see if this issue goes away. Thank you for the quick response!

tcitworld commented 1 year ago

You need the cluster to be in synchronous replication mode. The above PR should fix the calendar and contacts part, but you'll have issues all over in the rest of Nextcloud.

hanserasmus commented 1 year ago

Yeah to my knowledge it is indeed set. This is the first real issue I encountered with it. Maxscale will only failover if the primary Galera node goes down. 3 Galera nodes constantly syncing. Only 2 exposed for Nextcloud to connect to via Maxscale, third one to dump backups from.

joshtrichards commented 6 months ago

Hi @hanserasmus - How things looking over there? Alright to close this now that everything has been merged?