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 http 403 & Object not found (CLI UID duplicate check) #6987

Open
dl5rcw opened this Issue Jan 25, 2019 · 5 comments

Comments

Projects
None yet
2 participants
@dl5rcw
Copy link

dl5rcw commented Jan 25, 2019

Dear tine20 team,
we use tine20 for a few years now. It came that we change from SQL to LDAP to manage users, so I am currently syncing caldav calendars from one instance to another. It works fine, but in one calendar, I found an interesting problem:
I have an object that cannot be found. It says clear the one object:
https://192.168.0.111/tine20sql/calendars/59af534cf0db46a339409b38a097c22049f7321e/21/01aa90d4-24bc-4260-b58e-909a1939c2bf.ics
and when I go directly for the Browser, it says:

Sabre\DAV\Exception\NotFound Object not found

I could live with the missing object. But how can I rebuild the tine20 cache so the client does not try to sync this one?

----- debug log of the vdirsyncer I am using on ubuntu:
debug: SUMMARY:<here is the summary, I will not share
debug: more information about the title. It is not an encoding issue>
debug: TRANSP:OPAQUE
debug: X-CALENDARSERVER-ACCESS:PUBLIC
debug: X-MOZ-RECEIVED-SEQUENCE:1
debug: X-MOZ-RECEIVED-DTSTAMP:20190103T170207Z
debug: X-TINE20-CONTAINER:21
debug: UID:75533415-2bc8-4245-83bb-edf4a65b4fd8
debug: END:VEVENT
debug: END:VCALENDAR
debug: Sending request...
debug: 403
debug: {'Date': 'Fri, 25 Jan 2019 23:01:47 GMT', 'Server': 'Apache', 'Expires': 'Thu, 19 Nov 1981 08:52:00 GMT', 'Cache-Control': 'no-store, no-cache, must-revalidate', 'Pragma': 'no-cache', 'X-API': 'http://www.tine20.org/apidocs/tine20/', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains', 'X-Hostname': '$HOSTNAME', 'X-Clustername': 'clustername', 'Keep-Alive': 'timeout=5, max=17', 'Connection': 'Keep-Alive', 'Transfer-Encoding': 'chunked', 'Content-Type': 'application/xml; charset=utf-8'}
debug:
debug: <d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
debug: <s:exception>Sabre\DAV\Exception\Forbidden</s:exception>
debug: <s:message>write access denied for unknown client</s:message>
debug: </d:error>
error: Unknown error occured: 403 Client Error: Forbidden for url: https://192.168.0.111/tine20sql/calendars/59af534cf0db46a339409b38a097c22049f7321e/21/75533415-2bc8-4245-83bb-edf4a65b4fd8.ics
error: Use -vdebug to see the full traceback.

@dl5rcw

This comment has been minimized.

Copy link
Author

dl5rcw commented Jan 25, 2019

Okay, I found a duplicate entry in tine20sql for this specific date. I deleted the second one and I was able to sync with no restriction. I guess there has been a copy/paste event by the user, creating a duplicate and yielding the 403 Client Error. Going for the URL, I was not able to find it on the browser with the tine20sql instance either.
Could it make sense to create some sort of 'garbage collector' that could be run by cron during night to find any of those duplicates? It really seems to create issues with some clients out there, and certainly seems to confuse any import/expoert or sync mechanism.

@pschuele pschuele added the CalDAV label Jan 29, 2019

@pschuele

This comment has been minimized.

Copy link
Member

pschuele commented Jan 29, 2019

hi Lars,

I'm not sure if this was really a duplicate event. it would be great to see the tine20.log for the request (maybe with DEBUG level). I'm not aware of any problems in the calendar that could be solved by a nightly cleanup job.
the log below is a different "issue" ("write access denied for unknown client").

@dl5rcw

This comment has been minimized.

Copy link
Author

dl5rcw commented Feb 4, 2019

Hi Philipp,
you are right, the log seems pointing to a different issue. I am sorry there is no log for the above issue. We just moved 85000 events per user from sql to ldap based tine install. Using tine20 since 2010 now.
The above issue is following: I found 2 events with the same UID in it. Clients such as vdirsyncer (used on ubuntu) found it. I ended up with a 'sanity-check' during port, checking for every UID, possible duplicates, etc. Solution for UID: I created a random one and replaced it for the re-occuring event. I also appended the description of the event placing the ORG_UID=$UID and NEW_UID=$RANDOM to have a chance to track them.
My thoughts: why not such 'sanity-check' as an option for tine20 on the server side? You never know if some client is messing up or if you run tine20 for years as we do, maybe some strange behavior occurs... It would be cool to have such 'sanity-check' where you can place rules - the UID could be one issue, but maybe others arise, so you could later add more checks if required. Anyway, I think this is something that could make a cool project like tine20 just a bit cooler :) 👍

Best,
Lars

@pschuele

This comment has been minimized.

Copy link
Member

pschuele commented Feb 18, 2019

My thoughts: why not such 'sanity-check' as an option for tine20 on the server side? You never know if some client is messing up or if you run tine20 for years as we do, maybe some strange behavior occurs... It would be cool to have such 'sanity-check' where you can place rules

yep, sounds like a good idea!

we already have some sanity/repair functions in the CLI frontends (for example in https://github.com/tine20/tine20/blob/master/tine20/Calendar/Frontend/Cli.php - deleteDuplicateEvents).
a UID-duplicate check/repair would also be a nice addition and not very hard to implement... setting this on "feature request".

@pschuele pschuele changed the title CalDav / Sabre - http 403 & Sabre\DAV\Exception\NotFound Object not found CalDav http 403 & Object not found (CLI UID duplicate check) Feb 18, 2019

@dl5rcw

This comment has been minimized.

Copy link
Author

dl5rcw commented Feb 21, 2019

@pschuele same seems to apply for contacts, too. After checking the calendar, I am currently checking a few thousand contacts. I came across the UID here, too. I ended up truncating addressbook and addressbook_* related entries in mysql, did an almost similar sanity check on duplicates and UIDs and did a clean import. I guess that those sanity/health checks are good to run on both, calendar and contacts.

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