Server: CalDAV PUT requests on ics fails on NC11

Created on 7 Dec 2016  路  20Comments  路  Source: nextcloud/server

Steps to reproduce

  1. I installed NC 11 from git to test QOwnNotes on it
  2. I run ocdev server --port 8081 and create some tasks with the tasks app
  3. I was able fetch an ics item like http://localhost:8081/remote.php/caldav/calendars/admin/admin-test/ownCloud-q47z41o38h5o1ogr9bsu1sjornlzh20xogwr2x6zizv583q5mi.ics via GET
  4. I got this result back
BEGIN:VCALENDAR
PRODID:-//ownCloud tasks v0.9.3
BEGIN:VTODO
CREATED:20161206T181347
DTSTAMP:20161206T181347
LAST-MODIFIED:20161206T181347
UID:77dv0xakswwa911yzxh9wzh0k9
SUMMARY:Test2
PRIORITY:0
PERCENT-COMPLETE:0
X-OC-HIDESUBTASKS:0
END:VTODO
END:VCALENDAR
  1. When I tried to update the item with a PUT request by sending the same text back as raw body (like I did with NC10 and ownCloud until now) the request fails with an error message
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
    <s:sabredav-version>3.0.9</s:sabredav-version>
    <s:exception>Sabre\DAV\Exception\NotFound</s:exception>
    <s:message>Principal with name users not found</s:message>
</d:error>
  1. I reproduced all steps with Postman

Expected behaviour

The task is updated on the server.

Actual behaviour

I got back above error message

Server configuration

Ubuntu Linux 16.04
Apache
SQLite
PHP 7.0.8-0ubuntu0.16.04.3
NC 11 beta 2 (from git), updated from previous NC install

Log output

[Wed Dec  7 16:54:33 2016] 127.0.0.1:53060 [200]: /remote.php/caldav/calendars/admin/admin-test/ownCloud-q47z41o38h5o1ogr9bsu1sjornlzh20xogwr2x6zizv583q5mi.ics
[Wed Dec  7 16:54:33 2016] 127.0.0.1:53062 [404]: /remote.php/caldav/calendars/admin/admin-test/ownCloud-q47z41o38h5o1ogr9bsu1sjornlzh20xogwr2x6zizv583q5mi.ics
bug dav

Most helpful comment

@pbek email me your address so we can get you a t-shirt :D

All 20 comments

cc @rullzer Mind diving into this? :bigeyes:

Very much appreciated! :bowing_man:

Ok so I can't really reproduce it.
But what strikes me as odd is that is says <s:sabredav-version>3.0.9</s:sabredav-version>

Did you update the submodules?

Yes, 3rdparty is up-to-date, but I just found out https://github.com/owncloud/3rdparty was used as repository!

~/Web/nextcloud/3rdparty$ git pull origin master
Von https://github.com/owncloud/3rdparty
 * branch            master     -> FETCH_HEAD
Already up-to-date.

I now checked out https://github.com/nextcloud/3rdparty (along with NC 11.0 RC 1).

Now I get this, even when I only do a GET-request to http://localhost:8081/remote.php/caldav/calendars/admin:

<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
    <s:sabredav-version>3.2.0</s:sabredav-version>
    <s:exception>Sabre\DAV\Exception\NotFound</s:exception>
    <s:message>Principal with name users not found</s:message>
</d:error>

Log: [Thu Dec 8 11:32:21 2016] 127.0.0.1:60342 [404]: /remote.php/caldav/calendars/admin

So could you PUT to an ics-url and the item was modified?
I really hope it isn't just my installation...
Is there any public test instance of NC 11?

I now reinstalled NC from git in a new folder with new mysql database and new app installs and still got the same error.

Can you post exact steps at what you send to the server? Just so I can verify properly.

Basically I have your ics file

And do:

curl -u admin:admin -X PUT --data-binary @test.ics http://localhost/remote.php/dav/calendars/admin/personal/foo.ics

Even GET gives me the error since I'm using Nexcloud's 3rdparty repository:

$ curl -u admin:admin http://localhost:8081/remote.php/caldav/calendars/admin
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
  <s:sabredav-version>3.2.0</s:sabredav-version>
  <s:exception>Sabre\DAV\Exception\NotFound</s:exception>
  <s:message>Principal with name users not found</s:message>
</d:error>

You were using dav in your url, did this change from NC10 to NC11?
When I start using dav I could fetch calendars and tasks again, but when I store I get ics validation errors...

<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<d:error xmlns:d=\"DAV:\" xmlns:s=\"http://sabredav.org/ns\">\n <s:exception>Sabre\\DAV\\Exception\\UnsupportedMediaType</s:exception>\n <s:message>Validation error in iCalendar: The supplied value () is not a correct DATE-TIME</s:message>\n</d:error>\n

... which means I can write an other version of my ical generator for the updated sabre library. :(
... and use different urls for NC11+

The new (dav) urls where added in 9 already.
But the old ones should still work

Are both urls supposed to work the same way? Because I didn't get the parser errors with oC and NC10...

@pbek, on oC and NC10, did you run it on standard ports?
not sure if related: https://github.com/nextcloud/server/issues/2573

@anonimou0, thank you for mentioning. I ran it with ocdev server --port 8081.

Sounds a lot like it, thanks a lot @rullzer! I will test the PR tomorrow!

Just updated from 10.0.2 to 11. Everything seemed fine until I noticed my calendars were out of sync. Looking into the logs I found the following entries:

Sabre\DAV\Exception\NotFound react-text: 53 : /react-text HTTP/1.1 404 Principal with name users not found

Sabre\DAV\Exception\NotAuthenticated react-text: 42 : /react-text HTTP/1.1 401 No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured
Removing the caldav-account on my device and readding it showed me, that Apple iCal was not able to authenticate, because it received the aforementioned 404 error.

I rolled back to 10, but this can not be the final saying on the topic, can it?

I use nginx 1.10.2 + PHP 7.0.14 + mysql Ver 15.1 Distrib 10.1.19-MariaDB.

Thanks for your help (hopefully).

Will be fixed in 11.0.1

Awesome, thank you @LukasReschke and @rullzer!

@pbek email me your address so we can get you a t-shirt :D

Wow, what an awesome x-mas / after x-mas present! Thanks a lot! I will wear it with pride!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

williambargent picture williambargent  路  3Comments

MorrisJobke picture MorrisJobke  路  3Comments

mama21mama picture mama21mama  路  3Comments

juliushaertl picture juliushaertl  路  3Comments

jancborchardt picture jancborchardt  路  3Comments