nextcloud / nextcloud/circles

Can't delete circle "In CircleDestroy.php line 105: Circle is managed from an other app"

Open
#1,580 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop bug
Dominant language
JavaScript
Stars
177
Forks
68
Avg merge
2d 22h
Merged PRs (30d)
60

Description

I have made several attempts from the web interface to delete a circle, which always failed with the error message "cannot delete contact". This error message persisted even after I manually removed all members from the circle

Next I tried to delete the circle through OCC

That's where I got the above error message.

Apparently, the error is generated by this function:

      public function verify(FederatedEvent $event): void {
                $circle = $event->getCircle();
                if ($circle->isConfig(Circle::CFG_APP)) {
                        throw new FederatedItemBadRequestException(
                                StatusCode::$CIRCLE_DESTROY[120],
                                120
                        );
                }

                $initiator = $circle->getInitiator();

                $initiatorHelper = new MemberHelper($initiator);
                $initiatorHelper->mustBeOwner();

                $event->setOutcome($this->serialize($circle));
        }

This is what I see in nextcloud.log:

{"reqId":"1YY35kFLsWcn7CHRIUyr","level":3,"time":"2024-05-08T07:28:51+00:00","remoteAddr":"172.70.231.17","user":"jr","app":"circles","method":"DELETE","url":"/ocs/v2.php/apps/circles/circles/lXekW33g9T66L76k9eF1QDRA4SvqBow","message":"{\"circleId\":\"lXekW33g9T66L76k9eF1QDRA4SvqBow\"}","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0","version":"28.0.5.1","exception":{"Exception":"OCA\\Circles\\Exceptions\\FederatedItemBadRequestException","Message":"Circle is managed from an other app","Code":120,"Trace":[{"file":"/var/www/cloud.****/apps/circles/lib/Service/FederatedEventService.php","line":178,"function":"verify","class":"OCA\\Circles\\FederatedItems\\CircleDestroy","type":"->"},{"file":"/var/www/cloud.***/apps/circles/lib/Service/CircleService.php","line":265,"function":"newEvent","class":"OCA\\Circles\\Service\\FederatedEventService","type":"->"},{"file":"/var/www/cloud.***/apps/circles/lib/Controller/LocalController.php","line":172,"function":"destroy","class":"OCA\\Circles\\Service\\CircleService","type":"->"},{"file":"/var/www/cloud.*/lib/private/AppFramework/Http/Dispatcher.php","line":230,"function":"destroy","class":"OCA\\Circles\\Controller\\LocalController","type":"->"},{"file":"/var/www/cloud.****/lib/private/AppFramework/Http/Dispatcher.php","line":137,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud.*/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/cloud*/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/cloud.*/ocs/v1.php","line":65,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/cloud.*/ocs/v2.php","line":23,"args":["/var/www/cloud.*/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/cloud.*/apps/circles/lib/FederatedItems/CircleDestroy.php","Line":105,"message":"{\"circleId\":\"lXekW33g9T66L76k9eF1QDRA4SvqBow\"}","exception":{"class":"OCA\\Circles\\Exceptions\\FederatedItemBadRequestException","status":400,"code":120,"message":"Circle is managed from an other app"},"CustomMessage":"{\"circleId\":\"lXekW33g9T66L76k9eF1QDRA4SvqBow\"}"}}

This is what I see when I try to delete the circle using occ:

$ occ circles:manage:destroy ***

In CircleDestroy.php line 105:

  Circle is managed from an other app

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/circles/lib/FederatedItems/CircleDestroy.php at line 105, then trace the deletion flow through FederatedEventService.php, CircleService.php, and LocalController.php as shown in the log. Reproduce the failure through the web interface and occ circles:manage:destroy, and determine what should allow deletion when the circle is no longer managed by another app.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.