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

Mail invitation - There was an error updating your attendance status. #6568

Open
netaviator opened this issue May 5, 2019 · 117 comments
Open
Assignees
Labels
1. to develop Accepted and waiting to be taken care of bug

Comments

@netaviator
Copy link

Steps to reproduce

  1. Create an appointment
  2. Add attendee to meeting -> mail is created
  3. Click accept button in mail

Expected behaviour

Status of attendee should be updated in the calendar view.

Actual behaviour

The following error is shown:
There was an error updating your attendance status.
Please contact the organizer directly.

Already tried

I already found this post with the same problem and tried to use another mail address for my Nextcloud account without success. There is currently no user sharing the exact same mail address.
https://help.nextcloud.com/t/solved-cannot-accept-calendar-invitation/50154

Server configuration

Operating system:
Ubuntu 16.04
Web server:
Apache
Database:
MySQL
PHP version:
7.2.12
Server version: (see your admin page)
15.0.7
Calendar version: (see the apps page)
1.6.5
Updated from an older installed version or fresh install:
Yes, updated since ownCloud 8
Signing status (ownCloud/Nextcloud 9.0 and above):

No errors have been found.

List of activated apps:

Enabled:
- accessibility: 1.1.0
- activity: 2.8.2
- admin_audit: 1.5.0
- bruteforcesettings: 1.3.0
- calendar: 1.6.5
- cloud_federation_api: 0.1.0
- contacts: 3.1.1
- data_request: 1.2.0
- dav: 1.8.1
- deck: 0.6.1
- federatedfilesharing: 1.5.0
- federation: 1.5.0
- files: 1.10.0
- files_markdown: 2.0.6
- files_pdfviewer: 1.4.0
- files_sharing: 1.7.0
- files_texteditor: 2.7.0
- files_trashbin: 1.5.0
- files_versions: 1.8.0
- files_videoplayer: 1.4.0
- gallery: 18.2.0
- groupfolders: 3.0.0
- lookup_server_connector: 1.3.0
- notifications: 2.3.0
- oauth2: 1.3.0
- password_policy: 1.5.0
- provisioning_api: 1.5.0
- quota_warning: 1.4.0
- sharebymail: 1.5.0
- tasks: 0.9.8
- theming: 1.6.0
- twofactor_backupcodes: 1.4.1
- twofactor_totp: 2.1.2
- twofactor_u2f: 2.1.3
- updatenotification: 1.5.0
- workflowengine: 1.5.0
Disabled:
- comments
- encryption
- files_external
- files_retention
- firstrunwizard
- logreader
- nextcloud_announcements
- serverinfo
- support
- survey_client
- systemtags
- user_ldap

Nextcloud configuration:

{
"system": {
"instanceid": "***REMOVED SENSITIVE VALUE***",
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"cloud.xxxxxxx.xxxxxxx"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "https:\/\/cloud.xxxxxxx.xxxxxxx",
"dbtype": "mysql",
"version": "15.0.7.0",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"logtimezone": "UTC",
"installed": true,
"maintenance": false,
"loglevel": 2,
"theme": "",
"trashbin_retention_obligation": "auto, 14",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_smtpmode": "sendmail",
"mail_smtpauthtype": "LOGIN",
"updater.release.channel": "stable"
}
}

Are you using external storage, if yes which one: local/smb/sftp/...
no

Are you using encryption: yes/no
no

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

Client configuration

Browser:
Firefox , Chrome

Operating system:
Windows 10, macOSX, iOS

CalDAV-clients:
iOS

Logs

Web server error log

Nothing

Log file (data/nextcloud.log)

Nothing

Browser log

Nothing
@georgehrke
Copy link
Member

Is it in a calendar shared with you?

=> there already is a Server Ticket about this in the Server.

Do all Nextcloud users have unique email addresses?

=> If no, that’s not supported

@netaviator
Copy link
Author

No, the calendar used is my default calendar and i can confirm, that there are no duplicates in the mail-addresses.

@hostingnuggets
Copy link

Do all Nextcloud users have unique email addresses?

=> If no, that’s not supported

@georgehrke Does this problem only affect the accounts which have non-unique e-mail addresses or does it affect all accounts as soon as there is one non-unique e-mail address?

@georgehrke georgehrke transferred this issue from nextcloud/calendar May 30, 2019
@netaviator
Copy link
Author

netaviator commented Jun 3, 2019

Any update on this? I still have the same error with Nextcloud version 16.0.1 and calendar version 1.7.0. I can confirm that the user list does not show users with the same mail address and i see no duplicat mail addresses in the db, too.

@wolfgangsiefert
Copy link

I Have exact the same issue with one user in my nextcloud installation.
Version 15.0.8
One User with unique Email-Address can't create working invitations, other users are working...
The calendar is not shared

@Six81
Copy link

Six81 commented Jul 23, 2019

Hi there, any Updates on this? I'm having the same issue but with every user.

I am on NC 16.0.3 and Calendar 1.7.0, i have no users with the same Mail address.

I create an appointment on my own personal cal, add an attendee (one of my other private Mail addresses, not connected to the system), i get the invitation mail, click on "accept" and i get the error: There was an error updating your attendance status.
Please contact the organizer directly.

I have zero clue where to look from here.
I know that this is the case on shared calendars and that there is an issue if there are double Mail addresses but non of this is the case here. Any help?

@Toka69
Copy link

Toka69 commented Aug 8, 2019

Hello.

The same problem, on two nextclouds. Each with NC 16.0.0 and calendar 1.7.0

@CamZie
Copy link

CamZie commented Sep 11, 2019

Hello, also same problem here with NC 16.0.3 also without any e-mail duplicates.

@feutl
Copy link

feutl commented Feb 14, 2020

same problem on my server when clicking on the mails sent to the invited person via email.
in my case it is a email address not assigned to a user insight nextcloud.
Simply because it is my office mail and my private mail is assigned to the user in nextcloud.

NC: 17.0.3
Calendar App: 2.0.1

@mokkin
Copy link

mokkin commented Apr 9, 2020

I can confirm this.

NC: 18.0.3
Calendar: 2.0.3

@jrester
Copy link

jrester commented Aug 19, 2020

What are you using for background jobs? I had the same problem and switching from ajax to cron seems to have fixed it.

@feutl
Copy link

feutl commented Aug 19, 2020

I am using cron

@RailsViceRoads
Copy link

I have the same behaviour on one NC instance. If i chose the accept button inside the invitation, it will result in an error on the NC page:
InvitationError

NextCloud versions { "id": "removedbyme", "items": [ [ "server", "version", "19.0.4.2" ], [ "server", "code", "other" ], [ "server", "enable_avatars", "yes" ], [ "server", "enable_previews", "yes" ], [ "server", "memcache.local", "\\OC\\Memcache\\APCu" ], [ "server", "memcache.distributed", "none" ], [ "server", "asset-pipeline.enabled", "no" ], [ "server", "filelocking.enabled", "yes" ], [ "server", "memcache.locking", "none" ], [ "server", "debug", "no" ], [ "server", "cron", "cron" ], [ "php", "version", "7.3.6" ], [ "php", "memory_limit", 536870912 ], [ "php", "max_execution_time", 3600 ], [ "php", "upload_max_filesize", 535822336 ], [ "database", "type", "mysql" ], [ "database", "version", "5.6.19" ], [ "database", "size", 14229504 ], [ "apps", "accessibility", "1.5.0" ], [ "apps", "activity", "2.12.1" ], [ "apps", "admin_audit", "1.9.0" ], [ "apps", "announcementcenter", "3.8.1" ], [ "apps", "bruteforcesettings", "disabled" ], [ "apps", "calendar", "2.0.4" ], [ "apps", "caniupdate", "disabled" ], [ "apps", "cloud_federation_api", "1.2.0" ], [ "apps", "comments", "1.9.0" ], [ "apps", "contacts", "3.4.0" ], [ "apps", "contactsinteraction", "1.0.0" ], [ "apps", "dav", "1.15.0" ], [ "apps", "federatedfilesharing", "1.9.0" ], [ "apps", "federation", "1.9.0" ], [ "apps", "files", "1.14.0" ], [ "apps", "files_lock", "0.8.3" ], [ "apps", "files_pdfviewer", "1.8.0" ], [ "apps", "files_rightclick", "0.16.0" ], [ "apps", "files_sharing", "1.11.0" ], [ "apps", "files_texteditor", "disabled" ], [ "apps", "files_trashbin", "1.9.0" ], [ "apps", "files_versions", "1.12.0" ], [ "apps", "files_videoplayer", "1.8.0" ], [ "apps", "firstrunwizard", "2.8.0" ], [ "apps", "gallery", "disabled" ], [ "apps", "groupfolders", "7.1.0" ], [ "apps", "impersonate", "1.6.1" ], [ "apps", "logreader", "2.4.0" ], [ "apps", "lookup_server_connector", "1.7.0" ], [ "apps", "nextcloud_announcements", "1.8.0" ], [ "apps", "notifications", "2.7.0" ], [ "apps", "oauth2", "1.7.0" ], [ "apps", "password_policy", "1.9.1" ], [ "apps", "passwords", "2020.10.0" ], [ "apps", "photos", "1.1.0" ], [ "apps", "polls", "1.5.4" ], [ "apps", "privacy", "1.3.0" ], [ "apps", "provisioning_api", "1.9.0" ], [ "apps", "recommendations", "disabled" ], [ "apps", "serverinfo", "1.9.0" ], [ "apps", "settings", "1.1.0" ], [ "apps", "sharebymail", "1.9.0" ], [ "apps", "spreed", "9.0.4" ], [ "apps", "support", "1.2.1" ], [ "apps", "survey_client", "1.7.0" ], [ "apps", "systemtags", "1.9.0" ], [ "apps", "tasks", "0.13.3" ], [ "apps", "templateeditor", "disabled" ], [ "apps", "text", "3.0.1" ], [ "apps", "theming", "1.10.0" ], [ "apps", "twofactor_backupcodes", "1.8.0" ], [ "apps", "updatenotification", "1.9.0" ], [ "apps", "user_external", "disabled" ], [ "apps", "viewer", "1.3.0" ], [ "apps", "workflowengine", "2.1.0" ], [ "stats", "num_files", 20647 ], [ "stats", "num_users", 17 ], [ "stats", "num_storages", 22 ], [ "stats", "num_storages_local", 1 ], [ "stats", "num_storages_home", 17 ], [ "stats", "num_storages_other", 4 ], [ "stats", "num_comments", 140 ], [ "stats", "num_comment_markers", 7 ], [ "stats", "num_systemtags", 6 ], [ "stats", "num_systemtags_mappings", 1 ], [ "files_sharing", "num_shares", 34 ], [ "files_sharing", "num_shares_user", 2 ], [ "files_sharing", "num_shares_groups", 21 ], [ "files_sharing", "num_shares_link", 2 ], [ "files_sharing", "num_shares_link_no_password", 2 ], [ "files_sharing", "num_fed_shares_sent", 0 ], [ "files_sharing", "num_fed_shares_received", 0 ], [ "files_sharing", "permissions_1_1", "6" ], [ "files_sharing", "permissions_2_1", "8" ], [ "files_sharing", "permissions_3_1", "2" ], [ "files_sharing", "permissions_1_3", "1" ], [ "files_sharing", "permissions_4_15", "1" ], [ "files_sharing", "permissions_1_17", "7" ], [ "files_sharing", "permissions_1_19", "7" ], [ "files_sharing", "permissions_0_31", "2" ], [ "encryption", "enabled", "no" ], [ "encryption", "default_module", "no" ] ] }

If I chose "Weitere Optionen..." (more options ?) from the invitation mail, I'll get the correct configuration page on NC. But the Save-Button results to the same error as above.

May be interesting: There is an other NC instance, hosted by the same provider, but on an other server. This instance will work as expected. The NC versions are exactly the same. Difference are the OS-Versions on the servers and the history of the instances. The first is older (more updates installed).

@sushifrick
Copy link

I do see the same problem, but i was able to find a disabled test user which caused the problem. As the mail attribute is not unique in our company it would be great to have working e-mail invitations without unique e-mail addresses based on the hash in the accept- or decline links from the invitation e-mail.

@cnmicha
Copy link

cnmicha commented Nov 17, 2020

Same issue on NC 20.0.1 with calendar app 2.1.2. No users have duplicate email addresses. I'm using system cron.

I fixed the issue by adjusting "Restrict users to only share with users in their groups" in the admin sharing settings to false.

@JMoVS
Copy link

JMoVS commented Jan 26, 2021

I read somewhere that the problem might be with usernames which contain spaces. Did somebody try that?

@cnmicha
Copy link

cnmicha commented Jan 28, 2021

I read somewhere that the problem might be with usernames which contain spaces. Did somebody try that?

It was not the case as I had the problem in Nov 2020

@JMoVS
Copy link

JMoVS commented Jan 29, 2021

@cnmicha Did you get it solved?

@cnmicha
Copy link

cnmicha commented Jan 29, 2021

@JMoVS A workaround was to set "Restrict users to only share with users in their groups" in the admin sharing settings to false.

@JMoVS
Copy link

JMoVS commented Jan 29, 2021

@cnmicha Wow that is a weird work around. Does this prevent them from creating public links?

@cnmicha
Copy link

cnmicha commented Jan 29, 2021

@JMoVS Maybe.. I haven't traced down the problem any further

@JMoVS
Copy link

JMoVS commented Jan 29, 2021

@cnmicha Hmm in my case it was already not enabled :-/

@RodSeq
Copy link

RodSeq commented Feb 10, 2021

@cnmicha @JMoVS I had the same issue and confirm that the workaround works for me:

  • Go in "Settings->Administration->Sharing", then disable the checkbox “Restrict users to only share with users in their groups”
  • My setting is Nextcloud 20.0.7 and Calendar App 2.1.3

Thanks !

@feutl
Copy link

feutl commented Feb 11, 2021

I can confirm that it does not work, also not with a workaround in place ;) because for me this was always the case.
NC 20.0.5
Calendar 2.1.3

@ei8fdb
Copy link

ei8fdb commented Apr 14, 2021

Go in "Settings->Administration->Sharing", then disable the checkbox “Restrict users to only share with users in their groups” does not fix this issue here with:

Nextcloud: 20.0.9
Calendar: 2.2.0

User inviting: name@nextcloud-instance.tld
Email address being invited: name+textstring@domain.tld

@RodSeq
Copy link

RodSeq commented May 9, 2021

The workaround (disable the checkbox “Restrict users to only share with users in their groups”) is able to remove the error message "There was an error updating your attendance status."

However doing that creates a Privacy setting issue for admins, as users from a specified group can access contacts of other groups within my NC instance: for this reason, I agree that the workaround is not fixing the issue, just a temporary solution hoping for a definitive fix in the next NC release.

My setting where the issue is still not fixed: Nextcloud 21.0.1 and Calendar App 2.2.1.

@loelkes
Copy link

loelkes commented Jun 15, 2021

In my case the error only appears if users are not logged in. Logging in to my account and then clicking on the link (with the browser used for the login) solves this issue. Lifting the share restriction for users as suggested previously is not an option in my case.

@cnmicha
Copy link

cnmicha commented Jun 15, 2021

Unfortunately logging in is not an option if an organization wants to invite external users that do not have a NC account associated with their email address.

@loelkes
Copy link

loelkes commented Jun 16, 2021

Unfortunately logging in is not an option if an organization wants to invite external users that do not have a NC account associated with their email address.

Yes, I understand. But for those who do have an account there's no suggestion that they should log in. They will write to the organiser who will be as clueless as well why it fails. User who do have an account could be redirect to the login if necessary. Or at least place a hint in the error message.

@miaulalala
Copy link
Contributor

I still have the initially described problem on NC 25. Actually the calender is unusable if you want to send meetings to other participants. All workarounds with checking/unchecking the mentioned share checkboxes didnt help. this is a problem since 2019. is it something that is happing for only some installation or is it a general problem? If it is, shouldn't this get a higher prio? however I a still happy for all NC offers for free, but regarding collaboration this would really be important.

I get that it's frustrating, but here's the issue. We can't really deny user accounts from using email addresses that have already been used by someone else. But that leads to errors in Sabre since the calendaring system assumes the email is a unique identifier. So it finds multiple calendars for the same email address for different user accounts, but since there is nothing telling the code which one is the right one, the code, instead of leaking info, stops processing the data and errors out.

There is currently no good way forward to solve this issue. Either we change stuff in Sabre in a way that doesn't adhere to the calendaring RFCs, leading to unforseen bugs and possibly even compatibility issues with other calendaring clients. Or we adjust Nextcloud to disallow duplicate emails, which will have wide reaching effects on all parts of NC. Both of those are not something we can simply fix. Any change for this needs to have as few side effects as possible, ensure we still adhere to the calendaring RFCs and also not change the core of how NC works.

@RodSeq
Copy link

RodSeq commented Jun 27, 2023

I still have the initially described problem on NC 25. Actually the calender is unusable if you want to send meetings to other participants. All workarounds with checking/unchecking the mentioned share checkboxes didnt help. this is a problem since 2019. is it something that is happing for only some installation or is it a general problem? If it is, shouldn't this get a higher prio? however I a still happy for all NC offers for free, but regarding collaboration this would really be important.

I get that it's frustrating, but here's the issue. We can't really deny user accounts from using email addresses that have already been used by someone else. But that leads to errors in Sabre since the calendaring system assumes the email is a unique identifier. So it finds multiple calendars for the same email address for different user accounts, but since there is nothing telling the code which one is the right one, the code, instead of leaking info, stops processing the data and errors out.

There is currently no good way forward to solve this issue. Either we change stuff in Sabre in a way that doesn't adhere to the calendaring RFCs, leading to unforseen bugs and possibly even compatibility issues with other calendaring clients. Or we adjust Nextcloud to disallow duplicate emails, which will have wide reaching effects on all parts of NC. Both of those are not something we can simply fix. Any change for this needs to have as few side effects as possible, ensure we still adhere to the calendaring RFCs and also not change the core of how NC works.

This bug main problem is not with duplicated emails: main problem is that any user not having a Nextcloud account can't accept or deny any meeting invitation sent through Nextcloud Calendar App. This repressents a very basic feature that is not working today on Nextcloud: should be fix as soon as possible, duplicated emails problem can be fixed later on.

@lars-becker
Copy link

@miaulalala:

There is currently no good way forward to solve this issue. Either we change stuff in Sabre in a way that doesn't adhere to the calendaring RFCs, leading to unforseen bugs and possibly even compatibility issues with other calendaring clients. Or we adjust Nextcloud to disallow duplicate emails, which will have wide reaching effects on all parts of NC. Both of those are not something we can simply fix. Any change for this needs to have as few side effects as possible, ensure we still adhere to the calendaring RFCs and also not change the core of how NC works.

Would a be possible to add a warning in the admin interface or via occ command that shows which accounts are affected? Part of the problem is that most affected users aren't aware of the issue and don't have a clue how to work around it. The result is that Nextcloud generates errors and seems unreliable to our own users and others.

@Beheadedstraw
Copy link

Beheadedstraw commented Jun 27, 2023 via email

@RuStrannik
Copy link

RuStrannik commented Jun 27, 2023

The easiest way to fix this right now is to just not allow invitations to anyone outside of Nextcloud.

Oh, then I know how to fix all bugs and solve all problems in any software: just avoid using it!
Problems?

Now seriously: no, this is not a fix, this is crippling. Ability to send email invitations to non-registered users and processing feedback from them is essential part of functionality and it has to be fixed properly.

@Beheadedstraw
Copy link

Beheadedstraw commented Jun 27, 2023 via email

@matwacim
Copy link

matwacim commented Jul 5, 2023

however -> i use the calender only to invite nextcloud users. and i am nextcloud user myself. as far as i understand you the problem should not happen in this case but it is? It would be new to me that we have duplicate email adresses as it is also unique in the company. so i dont get the problem here. my case is pretty the simplest: nextcloud calender user is inviting another nexcloud calender user to an event. not working when accepting over email. should it?

@Beheadedstraw
Copy link

Beheadedstraw commented Jul 5, 2023 via email

@wunschadresse
Copy link

At least for the duplicate email problem I found a thread: nextcloud/server#17146
for the non-nextcloud user, i did not look.

however, both cases do not apply to my case (i am nextcloud user with unique email) , and yet i cannot accept calendar invites from calendars, that have not previously been shared with me. I am rather confused and somewhat surprised that the docs do not properly hint to what is possible under which circumstances and what is not.

@subnoodle
Copy link

subnoodle commented Jul 19, 2023

Dears,
i hit the same issue as i was searching for an alternative to my open source groupware (which has calender issues as well).
I did not expect hitting this issue, since i now it worked earlier years ago (as far as i remember).
So, in my scenario "duplicate email-address" and "Next-Cloud-User only" is not relevant:
I want and have to use the calender full in Thundbird and Smartphone, both WITH invitations to any mail-adresses (users & non-users). Since i'm not using NextCloud as UI-client here, it's not a solution to build in some checks in the UI.

Someone asked for more constructive solutions how to solve it, like a token-table for non-user-invitations.
This let's me assume that the NextCloud developers are maybe aware of the issue, but it's not that easy to solve.

Can someone of the developers role out the status quo of the invitations-mechanics in NC?
(No, i cannot read all the code myself)

Would be a good start to have this years-long issue solve.
Until now, this isssue is a showstopper using NC as ical-server.

Thank you, Thomas

@cwerstuik
Copy link

Maybe this will help future diagnostic efforts. I read through a number of comments and didn't see this mentioned:

I was able to solve the problem by going directly to the database and cleaning out old users that weren't showing up in the UI from the oc_accounts table. I'm using LDAP for user authentication and groups and so it seems like it would hide users that were removed from LDAP, but wouldn't remove them from the NC database, which is great. I see the benefits of that. But if a user was deleted in LDAP and then recreated with the same email, there would then be two users with the same email recorded in the DB but only one would show up in the UI making it look like there wasn't any duplicate emails.

Maybe it's possible there are other circumstances where user accounts are hidden from the UI, but still stored in the DB and thus cause this problem...

It seems cleaning up the DB of duplicate emails also solved the non-nextcloud invites since everything seems to be working flawlessly now, but I can't confirm this as I wasn't specifically thinking of this scenario. All I know is I couldn't seem to get accepting/declining invites to work at all before and now it all works fine.

Just some ideas: Maybe it would be helpful to have an oc_accounts cleanup option to automate this process or add it as a warning in the "Security & setup warnings" in the admin settings when there are duplicate emails in oc_accounts so it makes admins aware that this will cause problems.

@quenenni
Copy link

Hello,

Sorry for the bump, but it's a 5 years old ticket and nothing for the last 8 months for an important feature (we have lots of complains, people saying they are missing rdv etc..)

I understand it's not an easy problem to solve, but any idea when we can hope to see this problem resolved?

Thanks

@nderambure
Copy link

Hi @quenenni.
I fixed this by unchecking the box "Restrict users to only share with users in their groups".
Weirdly, it enables sharing calendar invitations to external users with no error.
It's not convenient when you have multiple separate groups on your NXC instance, but it works.

I'm not familiar with the code that managed invitation validations, but it's bound to this checkbox.
There is a knob here that should be fixed.
Restrict to its own group should permit sharing invitations to external users too.
And maybe a second checkbox to restrict to users with an account on the NXC.

@quenenni
Copy link

@nderambure Thanks for the tip, but we can't uncheck that box, to respect privacy. That's really something we can't do.

@nderambure
Copy link

@quenenni : yep, I'm affraid this is only usefull on NXC instance where you only have one group...kind of workaround.

@subnoodle
Copy link

Dear @quenenni, yes it might be a log running issue. But it‘s really important as you stated yourself. I follow it for some years, since this issue is the show stopper for desicion making for NXC for a plattform for calendar, contacts and issues-tracker.
Thank you a lot for this engagement!

@RustyDust
Copy link

Since I'm also bothered by the problem I invested some spare time today and here's what I found:

Nextcloud version: 30.0.0
All users have unique email addresses: ✅

So I created an invitation and received this link:
https://ip_of_nc_instance/apps/dav/invitation/accept/TkshVtNLnNwn6L8VIWBsqf7g6L6KtWWuLfQl2HzsAd5EldYjNOC0DrEUlbwN

Clicking on the link to accept of course resulted in the dreaded "There was an error updating your attendance status." message.

Looking at the code I found that the message is generated in line 75 here (because the organizer is shown to me): https://github.com/nextcloud/server/blob/31ad1c5f552265d3e58496cde85914e58f0e3e2d/apps/dav/lib/Controller/InvitationResponseController.php#L62-L77

As it seems at least in my case the returned value for $iTipMessage->getScheduleStatus() isn't '1.2' but something else.
Messing with the code a bit I found that the value that comes back is '5.0'.

This particular result code is generated here (in line 509):
https://github.com/nextcloud/3rdparty/blob/2f879893c579124154f9b72d65f69a4d1c821adc/sabre/dav/lib/CalDAV/Schedule/Plugin.php#L488-L519

So why did it end up there? As it turns out, this happens when in Line 505 null is returned which in my case happened because $currentObject was null. Obviously this shouldn't have happened since I was accepting an existing invitation, right? Thus, the problem had to be in line 493ff where $currentObject is populated if $result is set.

Since $result wasn't set I dug deeper into getCalendarObjectByUID($uid) and ended up here:
https://github.com/nextcloud/server/blob/31ad1c5f552265d3e58496cde85914e58f0e3e2d/apps/dav/lib/CalDAV/CalDavBackend.php#L2346-L2362

This creates an SQL query which obviously returns an empty result set where it shouldn't. Translating the statement to real SQL and running it directly on the MariaDB server attached of course also gave me an empty result set.

SELECT c.uri AS calendaruri, co.uri AS objecturi FROM oc_calendarobjects AS co LEFT JOIN (oc_calendars AS c) ON (co.calendarid = c.id) WHERE c.principalUri = 'principals/users/user1' AND co.uid = '3085bd4f-15f8-434d-aab2-9ab197056123' AND co.deleted_at IS NULL;
Empty set (0.000 sec)

Verifying that the objects actually exist gave a positive answer:

SELECT co.uri AS objecturi, c.id AS calendarid FROM oc_calendarobjects AS co WHERE co.uid = '3085bd4f-15f8-434d-aab2-9ab197056123';
+------------------------------------------+------------+
| objecturi                                | calendarid |
+------------------------------------------+------------+
| 3085bd4f-15f8-434d-aab2-9ab197056123.ics |          6 |
+------------------------------------------+------------+

Ok, now that I got the calendar id, check out what records it may have:

SELECT * FROM oc_calendars WHERE id = '6';
+----+--------------------------+------------------+------------------+-----------+-------------+---------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+------------+
| id | principaluri             | displayname      | uri              | synctoken | description | calendarorder | calendarcolor | timezone                                                                                                                                                                                                                                                                                                                                                                                                                                                              | components   | transparent | deleted_at |
+----+--------------------------+------------------+------------------+-----------+-------------+---------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+------------+
|  6 | principals/users/mypersonaluser | Family | familycalendar |      2651 | NULL        |             4 | #C37285       | BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//Apple Inc.//Mac OS X 10.15.6//EN
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
BEGIN:DAYLIGHT
TZOFFSETFROM:+0100
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
DTSTART:19810329T020000
TZNAME:MESZ
TZOFFSETTO:+0200
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0200
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
DTSTART:19961027T030000
TZNAME:MEZ
TZOFFSETTO:+0100
END:STANDARD
END:VTIMEZONE
END:VCALENDAR
 | VEVENT,VTODO |           0 |       NULL |
+----+--------------------------+------------------+------------------+-----------+-------------+---------------+---------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------+-------------+------------+

Some things immediately hit the eye:

  • the principaluri is not the one, getCalendarObjectByUID() is looking for.
  • the timezone field looks really strange

Not caring about the timezone field for now I just removed the line creating the WHERE clause for the c.principaluri from the getCalendarObjectByUID() function for testing. This got me closer to my goal but still failed.

This time in line 497 of 3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php. Quite understandable since the calendar I want to access isn't owned by the person who invited me to the event because of it being a shared calendar that in this case happened to be owned by me.

Thus, the construction of $homePath here points to the wrong node path (to the one of the sender of the invitation not the one of the calendar's owner) :/

To fix this, I had to modify getCalendarObjectByUID() yet again to also return the real owner with the path to the object and also fix 3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php to instead of doing

$objectPath = $homePath.'/'.$result;

now doing

$objectPath = 'calendars/'.$result;

in line 496.

And lo and behold, I'm now able to accept invitations in shared calendars. Wasn't able to test whether this also fixes similar problems with personal calendars but if you want to try, the patch is attached. Chances are it'll make things worse

Be aware that I did this just for me, scratching my own itch and that I didn't check for any potential side effects

That's also why it isn't submitted as a PR ;) You have been warned.

accept_inv_fix.patch

@AleftinaT
Copy link

Thank you, @RustyDust for your solution! In my case I checked e-mails in database (Nextcloud 29).
docker exec -it nextcloud-aio-database psql -U oc_nextcloud -d nextcloud_database -c "select * from oc_accounts where data like '%<BROKEN_EMAIL>%';"
Found old not-LDAP accounts, not shown in occ user:list, changed e-mail, and disabled duplicated accounts

@miaulalala miaulalala assigned kesselb and unassigned miaulalala Nov 5, 2024
@miaulalala
Copy link
Contributor

@kesselb can your check if this issue is fixed by your work on the shared calendars? Thanks! 🙏

@SebastianKrupinski SebastianKrupinski transferred this issue from nextcloud/server Nov 8, 2024
@RustyDust
Copy link

@SebastianKrupinski Not sure why this got transferred to nextcloud/mail since the mail is generated just fine. At least for me the problem was/still is with Sabre/Dav doing a wrong calendar selection as outlined here.
Simply put: When looking up the event in question it doesn't make sense for the routines to limit the search to calendars of the sender of the invitation since you can't be sure it's not a shared calendar. And since the link only contains an object reference you have no way of pre-determining what type of calendar (shared/personal) you're looking for.

@SebastianKrupinski
Copy link
Contributor

It got transferred from server, but it was supposed to be transferred to calendar. I must have miss clicked.

@SebastianKrupinski SebastianKrupinski transferred this issue from nextcloud/mail Dec 13, 2024
@kaiyou
Copy link

kaiyou commented Dec 28, 2024

For what is worth, I spent a couple hours on this issue myself, and one thing is obvious: it needs splitting, or at least we need a clear statement that this is a mix of multiple separate issues with the same user-facing behavior. All share an issue when resolving the calendar object or calendar owner principal when accepting an invite.

Causes include:

  • an issue with the way calendar objects are referenced (possibly fixed now),
  • multiple users sharing the same email address, due to email being used as a key in Sabre,
  • the option Restrict users to only share with group members, which just breaks Dav interaction with external users.

I just faced the latter and figured out the behavior is simply defined here: https://github.com/nextcloud/server/blob/f9e6b1f81428f7ba786df781eb9a0389d8aee7c9/apps/dav/lib/Connector/Sabre/Principal.php#L426. If the option is set, then no Dav interaction can happen with external users due to them not being logged in, and principal resolution being broken.

Since the same dav collection is used both for browsing and individual interactions like accepting an invite, I do not see a proper fix to this without refactoring a large portion of the Dav code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of bug
Projects
Status: 📄 To do
Development

No branches or pull requests