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

[Bug]: Cannot delete tasks (...object with URI ...-deleted.ics already exists...) #37577

Closed
5 of 9 tasks
tamas646 opened this issue Apr 4, 2023 · 4 comments
Closed
5 of 9 tasks
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 26-feedback bug feature: caldav Related to CalDAV internals

Comments

@tamas646
Copy link

tamas646 commented Apr 4, 2023

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

I cannot delete some tasks through the webUI / dav sync.
Error message:
A calendar object with URI 02c84c0f-940b-4a61-a08c-7ea4cc5401df-deleted.ics already exists in calendar 10, therefore this object can't be moved into the trashbin

Steps to reproduce

Unfortunately I could not reproduce the issue with new tasks.
Only some older tasks (created in NC 25) which have been moved across multiple lists behave like this.

Expected behavior

The task should be deleted without any problem. :)

Installation method

None

Nextcloud Server version

26

Operating system

Debian/Ubuntu

PHP engine version

None

Web server

Apache (supported)

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

Enabled:
  - activity: 2.18.0
  - calendar: 4.3.1
  - circles: 26.0.0
  - cloud_federation_api: 1.9.0
  - comments: 1.16.0
  - contactsinteraction: 1.7.0
  - dashboard: 7.6.0
  - dav: 1.25.0
  - deck: 1.9.0
  - federatedfilesharing: 1.16.0
  - federation: 1.16.0
  - files: 1.21.1
  - files_external: 1.18.0
  - files_pdfviewer: 2.7.0
  - files_rightclick: 1.5.0
  - files_sharing: 1.18.0
  - files_trashbin: 1.16.0
  - files_versions: 1.19.1
  - firstrunwizard: 2.15.0
  - forms: 3.2.0
  - logreader: 2.11.0
  - lookup_server_connector: 1.14.0
  - news: 21.1.0
  - nextcloud_announcements: 1.15.0
  - notes: 4.7.2
  - notifications: 2.14.0
  - oauth2: 1.14.0
  - onlyoffice: 7.8.0
  - password_policy: 1.16.0
  - photos: 2.2.0
  - privacy: 1.10.0
  - provisioning_api: 1.16.0
  - recommendations: 1.5.0
  - related_resources: 1.1.0-alpha1
  - serverinfo: 1.16.0
  - settings: 1.8.0
  - sharebymail: 1.16.0
  - support: 1.9.0
  - survey_client: 1.14.0
  - systemtags: 1.16.0
  - tasks: 0.14.5
  - text: 3.7.2
  - theming: 2.1.1
  - twofactor_backupcodes: 1.15.0
  - twofactor_nextcloud_notification: 3.6.0
  - twofactor_totp: 8.0.0-alpha.0
  - updatenotification: 1.16.0
  - user_status: 1.6.0
  - viewer: 1.10.0
  - weather_status: 1.6.0
  - workflowengine: 2.8.0
Disabled:
  - admin_audit: 1.16.0
  - bruteforcesettings: 2.6.0 (installed 2.2.0)
  - contacts: 4.0.4 (installed 4.0.4)
  - encryption: 2.14.0
  - maps: 1.0.0 (installed 1.0.0)
  - phonetrack: 0.7.4 (installed 0.7.4)
  - spreed: 15.0.4 (installed 15.0.4)
  - suspicious_login: 4.4.0
  - user_ldap: 1.16.0

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

Running the following query I got the result below:

SELECT id, uri, calendarid, uid, deleted_at FROM oc_calendarobjects WHERE calendarid = 10 AND uri like '%-deleted-deleted.ics';

kép

I found the URIs above a little bit strange.

Maybe it's related to #34375.

In NC 25 I did not face any similar issue. (except the lack of ability to move tasks across lists)

@szaimen
Copy link
Contributor

szaimen commented Apr 4, 2023

cc @raimund-schluessler I suppose this is a server issue and not a tasks issue, correct?

@raimund-schluessler
Copy link
Member

cc @raimund-schluessler I suppose this is a server issue and not a tasks issue, correct?

Yes, this is a server issue. The Tasks app is not involved here.

It sounds like an issue that I thought was fixed. Tasks got moved into the trash bin and blocked moving them back into the list. Not sure why they cannot be deleted though.

@tamas646
Copy link
Author

Update:

Emptying the task trash bin from the web UI fixed the problem. :)

Should I keep this issue opened?

@joshtrichards joshtrichards added the feature: caldav Related to CalDAV internals label Aug 24, 2023
@joshtrichards
Copy link
Member

02c84c0f-940b-4a61-a08c-7ea4cc5401df-deleted.ics
[...]
SELECT id, uri, calendarid, uid, deleted_at FROM oc_calendarobjects WHERE calendarid = 10 AND uri like '%-deleted-deleted.ics';

The error comes from this bit of code:

// Try to detect conflicts before the DB does
// As unlikely as it seems, this can happen when the user imports, then deletes, imports and deletes again
$newObject = $this->getCalendarObject($calendarId, $newUri, $calendarType);
if ($newObject !== null) {
throw new Forbidden("A calendar object with URI $newUri already exists in calendar $calendarId, therefore this object can't be moved into the trashbin");
}

It would have been interesting to see the output of a query like SELECT id, uri, calendarid, uid, deleted_at FROM oc_calendarobjects WHERE uri LIKE '%02c84c0f-940b-4a61-a08c-7ea4cc5401df%'; (before the error cleared for you).

I found the URIs above a little bit strange.

I agree that the multiple deleted-deleted is weird.

We append the suffix -deleted to any entry we delete when we keep in in the caldav "trash can", but we also clean it up when we restore so not sure how it ended up duplicated in the uri:

$pathInfo = pathinfo($data['uri']);
if (!empty($pathInfo['extension'])) {
// Append a suffix to "free" the old URI for recreation
$newUri = sprintf(
"%s-deleted.%s",
$pathInfo['filename'],
$pathInfo['extension']
);
} else {
$newUri = sprintf(
"%s-deleted",
$pathInfo['filename']
);
}

public function restoreCalendarObject(array $objectData): void {
$this->cachedObjects = [];
$this->atomic(function () use ($objectData) {
$id = (int) $objectData['id'];
$restoreUri = str_replace("-deleted.ics", ".ics", $objectData['uri']);
$targetObject = $this->getCalendarObject(
$objectData['calendarid'],
$restoreUri
);

Emptying the task trash bin from the web UI fixed the problem. :)
Should I keep this is

That makes sense (for the most part), given the error, but not sure how your old tasks ended up in that state. I'll close this since it's been a year and we haven't had further reports here. Don't hesitate to report if you see it come up anew.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap 26-feedback bug feature: caldav Related to CalDAV internals
Projects
None yet
Development

No branches or pull requests

4 participants