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

CalDAV PUT requests on ics fails on NC11 #2552

Closed
pbek opened this Issue Dec 7, 2016 · 20 comments

Comments

Projects
None yet
7 participants
@pbek
Member

pbek commented Dec 7, 2016

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
@LukasReschke

This comment has been minimized.

Member

LukasReschke commented Dec 7, 2016

cc @rullzer Mind diving into this? :bigeyes:

@pbek

This comment has been minimized.

Member

pbek commented Dec 7, 2016

Very much appreciated! 🙇

@rullzer

This comment has been minimized.

Member

rullzer commented Dec 8, 2016

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?

@pbek

This comment has been minimized.

Member

pbek commented Dec 8, 2016

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?

@pbek

This comment has been minimized.

Member

pbek commented Dec 8, 2016

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

@rullzer

This comment has been minimized.

Member

rullzer commented Dec 8, 2016

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

@pbek

This comment has been minimized.

Member

pbek commented Dec 8, 2016

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>
@pbek

This comment has been minimized.

Member

pbek commented Dec 8, 2016

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+

@nickvergessen

This comment has been minimized.

Member

nickvergessen commented Dec 8, 2016

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

@pbek

This comment has been minimized.

Member

pbek commented Dec 8, 2016

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

@anonimou0

This comment has been minimized.

anonimou0 commented Dec 8, 2016

@pbek, on oC and NC10, did you run it on standard ports?
not sure if related: #2573

@pbek

This comment has been minimized.

Member

pbek commented Dec 9, 2016

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

@rullzer

This comment has been minimized.

Member

rullzer commented Dec 13, 2016

Mmm maybe this was caused by #2649

@pbek

This comment has been minimized.

Member

pbek commented Dec 13, 2016

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

@pbek

This comment has been minimized.

Member

pbek commented Dec 14, 2016

I commented directly at #2653.

@mariokorte

This comment has been minimized.

mariokorte commented Dec 15, 2016

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).

@LukasReschke

This comment has been minimized.

Member

LukasReschke commented Dec 16, 2016

Will be fixed in 11.0.1

@pbek

This comment has been minimized.

Member

pbek commented Dec 16, 2016

Awesome, thank you @LukasReschke and @rullzer!

@jospoortvliet

This comment has been minimized.

Member

jospoortvliet commented Dec 16, 2016

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

@pbek

This comment has been minimized.

Member

pbek commented Dec 16, 2016

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

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