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

Edit rights for shared calendar group not working via CalDAV update from NC 10.0.1 to 10.0.2 #2747

Closed
groentebroer opened this issue Dec 19, 2016 · 7 comments

Comments

@groentebroer
Copy link

Steps to reproduce

  1. Install NC 10.0.1, Create a group with 2 users
  2. Create a calender at 1 user and share it wit the group. Make the share with "edit" rights
  3. Try to edit via CalDav the shared calendar as user 2.

Expected behaviour

The user should be able to edit the calendar.

Actual behaviour

An error is thrown in the log:

"app":"caldav","message":"Exception: {"Message":"HTTP\/1.1 404 Principal with name users not found","Exception":"Sabre\\DAV\\Exception\\NotFound","Code":0,"Trace":"#0 \/var\/www\/html\/nextcloud_10.0.2\/3rdparty\/sabre\/dav\/lib\/DAV\/Tree.php(76)

Server configuration

Operating system: Linux

Web server: Apache

Database: Mysql / MirandaDB

PHP version: 5.6.2.9

Nextcloud version: 10.0.2

Updated from an older Nextcloud/ownCloud or fresh install:
Updated from 10.0.1
(Which was updated from a previous OwnCloud)

Where did you install Nextcloud from:
Source

List of activated apps:

App list ``` Enabled: - activity: 2.3.2 - calendar: 1.4.1 - comments: 1.0.0 - dav: 1.0.1 - federatedfilesharing: 1.0.1 - federation: 1.0.1 - files: 1.5.2 - files_sharing: 1.0.0 - files_texteditor: 2.1 - files_trashbin: 1.0.0 - files_versions: 1.3.0 - files_videoplayer: 0.9.8 - news: 9.0.4 - notifications: 0.3.0 - password_policy: 1.0.0 - provisioning_api: 1.0.0 - serverinfo: 1.1.1 - survey_client: 0.1.5 - systemtags: 1.0.2 - templateeditor: 0.1 - theming: 1.0.1 - updatenotification: 1.0.1 - workflowengine: 1.0.1 Disabled: - admin_audit - encryption - external - files_accesscontrol - files_automatedtagging - files_external - files_pdfviewer - files_retention - firstrunwizard - gallery - user_external - user_ldap - user_saml ```

The content of config/config.php:

Config report ``` { "system": { "instanceid": "oc3hx226ao1w", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "scrubbed" ], "datadirectory": "\/var\/www\/html\/nextcloud\/data", "overwrite.cli.url": "https:\/\/localhost\/nextcloud", "dbtype": "mysql", "version": "9.1.2.2", "dbname": "owncloud", "dbhost": "localhost", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "logtimezone": "UTC", "installed": true, "updatechecker": false, "theme": "", "loglevel": 2, "maintenance": false, "appstore.experimental.enabled": true } } ```

Are you using external storage, if yes which one: no

Are you using encryption: yes

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

Client configuration

Browser: FireFox

Operating system: Windows

Logs

Web server error log

Web server error log ``` Insert your webserver log here ```

Nextcloud log (data/nextcloud.log)

Nextcloud log ``` { "reqId": "WFU9m6JVY3Skr1249SfMSwAAAAU", "remoteAddr": "", "app": "caldav", "message": "Exception: {\"Message\":\"HTTP\\\/1.1 404 Principal with name users not found\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\NotFound\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(76): Sabre\\\\DAVACL\\\\AbstractPrincipalCollection->getChild('users')\\n#1 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Tree.php(71): Sabre\\\\DAV\\\\Tree->getNodeForPath('principals\\\/user...')\\n#2 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(903): Sabre\\\\DAV\\\\Tree->getNodeForPath('principals\\\/user...')\\n#3 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(768): Sabre\\\\DAV\\\\Server->getPropertiesForPath('principals\\\/user...', Array, 0)\\n#4 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/CalDAV\\\/Schedule\\\/Plugin.php(569): Sabre\\\\DAV\\\\Server->getProperties('principals\\\/user...', Array)\\n#5 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/CalDAV\\\/Schedule\\\/Plugin.php(285): Sabre\\\\CalDAV\\\\Schedule\\\\Plugin->getAddressesForPrincipal('principals\\\/user...')\\n#6 [internal function]: Sabre\\\\CalDAV\\\\Schedule\\\\Plugin->calendarObjectChange(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response), Object(Sabre\\\\VObject\\\\Component\\\\VCalendar), 'calendars\\\/user2...', false, true)\\n#7 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#8 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/CalDAV\\\/Plugin.php(891): Sabre\\\\Event\\\\EventEmitter->emit('calendarObjectC...', Array)\\n#9 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/CalDAV\\\/Plugin.php(772): Sabre\\\\CalDAV\\\\Plugin->validateICalendar('BEGIN:VCALENDAR...', 'calendars\\\/user2...', false, Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response), true)\\n#10 [internal function]: Sabre\\\\CalDAV\\\\Plugin->beforeCreateFile('calendars\\\/user2...', 'BEGIN:VCALENDAR...', Object(OCA\\\\DAV\\\\CalDAV\\\\Calendar), false)\\n#11 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#12 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(1034): Sabre\\\\Event\\\\EventEmitter->emit('beforeCreateFil...', Array)\\n#13 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(523): Sabre\\\\DAV\\\\Server->createFile('calendars\\\/user2...', Resource id #433, NULL)\\n#14 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpPut(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#15 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#16 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(459): Sabre\\\\Event\\\\EventEmitter->emit('method:PUT', Array)\\n#17 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(248): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#18 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/apps\\\/dav\\\/appinfo\\\/v1\\\/caldav.php(86): Sabre\\\\DAV\\\\Server->exec()\\n#19 \\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/remote.php(165): require_once('\\\/var\\\/www\\\/html\\\/n...')\\n#20 {main}\",\"File\":\"\\\/var\\\/www\\\/html\\\/nextcloud_10.0.2\\\/3rdparty\\\/sabre\\\/dav\\\/lib\\\/DAVACL\\\/AbstractPrincipalCollection.php\",\"Line\":118,\"User\":\"user2\"}", "level": 0, "time": "2016-12-17T13:29:01+00:00", "method": "PUT", "url": "\/nextcloud\/remote.php\/caldav\/calendars\/user2\/calendar_shared_by_user1\/9e64ab6c-f853-45e3-b1c4-f3e7a5b37917.1481981343487.ics", "user": "user2", "version": "9.1.2.2" } ```
@nickvergessen
Copy link
Member

Ref #2552 @rullzer

@groentebroer
Copy link
Author

Hi,

I did some further testing after reading some other bug reports.
Set up a new nextcould 10.0.2 instance with a new database. Enabled calendar as well.
Created user1 and user2, and created a shared calendar at user 1, shared with a group both users are in.

Created a new thunderbird profile to setup the caldav accounts.
This works!

I linked the erroneous calendar from my "real" nextcloud installation and this also worked. Could it be a client thing after updating?
After reading some more threads, it seems that the caldav functions are now under /dav/ instead of /caldav/. Adding the same account using the /caldav/ url, and the issue is there again, able to read but not able to edit/insert.

So the solution is to change the client urls to /dav/ instead of /caldav/ which is not that trivial on most clients (for understandable reasons).
I made the following redirect which works for my client:

RewriteCond %{REQUEST_URI} ^/owncloud/remote\.php/caldav/calendars/(.*)$ 
RewriteRule ^ /owncloud/remote.php/dav/calendars/%1 [R=302,L]

Looks like it is related to: #2649
At least this makes 10.0.2 work again with a shared calendar.

@marc0s
Copy link
Contributor

marc0s commented Dec 22, 2016

I can confirm that the URL rewrite fixed it on my side as well.

@Linkinsoldier
Copy link

Linkinsoldier commented Jan 15, 2017

I can confirm rewriting the well-known urls did the trick:

#rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
#rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
rewrite ^/.well-known/carddav /remote.php/dav/ redirect;
rewrite ^/.well-known/caldav /remote.php/dav/ redirect;

@nickvergessen
Copy link
Member

@rullzer any idea? Seems like on the old routes some stuff is not set up correctly?

@ghost
Copy link

ghost commented Feb 10, 2017

Detected this problem today, too with NC 10.0.3. Can't update to 11 as I'm running on Ubuntu 14.04. The rewrite suggested above would probably work but my Android CalDAV Client can't handle the HTTP 302's returned and doesn't request the rewritten URL.

The fix for me was to uninstall my CalDav Client, install it again and then use the base URL provided on the PC Browser web UI for the calendar which now contains "dav" instead of "caldav" as described above.

While this works for me I have quite a number of Android devices and users of my cloud instance to which I can't recommend this approach, it's too complicated. Therefore, please fix this is the next 10.0.x release!!!

Also, it would be interesting to know why this functionality was broken after 10.0.1. Why does something like this break in a security update???

@MorrisJobke
Copy link
Member

Sadly we can't do much here except putting a huge amount of work into make the old URLs work like the new ones. We did this move in the past to be more future proof. From now on such breaks should not happen anymore. Update the URLs in your clients and it should work from then on.

Sorry for the trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants