nextcloud / nextcloud/circles

`RequestNetworkException` thrown by Circles when adding a user to a normal NC group (FederatedEventService->doRequest)

Open
#2,141 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage bug
Dominant language
JavaScript
Stars
177
Forks
68
Avg merge
2d 22h
Merged PRs (30d)
60

Description

App: Circles (aka Teams)
App version: 31.0.0
Nextcloud: 31.0.9.1
Deployment: Nextcloud official image on Docker (behind CapRover reverse proxy)
PHP: (container default for NC 31)
DB: (MariaDB/Postgres — default in stack)
Reverse proxy / TLS: CapRover → HTTPS
Do you use Circles/Teams federation? No (not intentionally)
Are core NC “Groups” used? Yes (admin-managed groups, not user-created circles)

Summary

Whenever I add a user to a normal Nextcloud group (not a circle), the Circles app listens to the UserAddedEvent and tries to broadcast a federated event. That outbound request fails and Circles throws OCA\Circles\Tools\Exceptions\RequestNetworkException. Disabling the Circles app immediately stops the error. This looks like Circles attempting federation even when Circles/Teams federation isn’t configured/used, and the failure isn’t handled gracefully.
Context on what Circles/Teams is: it provides user-defined groups and optional federation/broadcasting for sharing across apps. ([GitHub][1])

Steps to reproduce
  1. Have Circles app enabled on NC 31.0.9.1.
  2. Add a user to a regular NC group (via UI or Provisioning API):
    POST /ocs/v2.php/cloud/users/<uid>/groups with body groupid=<group>.
  3. Check the Nextcloud log.
Expected behavior
  • Adding a user to a normal NC group should not cause Circles to broadcast a federated event unless federation is configured/enabled.
  • Even if an outbound Circles request fails, it should be handled gracefully (no error log at level 3 for a normal group change).
Actual behavior

Log entry is produced at every group membership change:

{
  "time":"2025-09-20T22:16:32+00:00",
  "user":"7KX1o",
  "method":"POST",
  "url":"/ocs/v2.php/cloud/users/omni_portal_virtual_office-mohibullahchowdhuryalif/groups",
  "message":"Exception thrown: OCA\\Circles\\Tools\\Exceptions\\RequestNetworkException",
  "version":"31.0.9.1",
  "exception":{
    "Exception":"OCA\\Circles\\Tools\\Exceptions\\RequestNetworkException",
    "Trace":[
      {"file":"/apps/circles/lib/Service/FederatedEventService.php","line":424,"function":"doRequest"},
      {"file":"/apps/circles/lib/Service/FederatedEventService.php","line":168,"function":"initBroadcast"},
      {"file":"/apps/circles/lib/Service/SyncService.php","line":446,"function":"newEvent"},
      {"file":"/apps/circles/lib/Listeners/GroupMemberAdded.php","line":37,"function":"groupMemberAdded"},
      {"file":"/lib/private/EventDispatcher/ServiceEventListener.php","line":68,"function":"handle"},
      {"file":"/lib/private/Group/Group.php","line":164,"function":"addUser"},
      {"file":"/apps/provisioning_api/lib/Controller/UsersController.php","line":1593,"function":"addToGroup"}
    ]
  }
}

This appears to originate from OCA\Circles\Service\FederatedEventService->doRequest() called during GroupMemberAdded handling, even though we aren’t using Circles federation. Similar reports exist where Circles network requests error with RequestNetworkException.

Workaround

Disabling Circles stops the error:

sudo -u www-data php occ app:disable circles

(official occ app management docs). ([Nextcloud][3])

Additional details / environment notes
  • Files & sharing, Group Folders, etc., work normally.
  • Only the Circles app logs the error on group membership changes.
  • Outbound egress from the host is generally restricted; if Circles requires a specific endpoint for federation, it may be failing to reach it — but it would be ideal if Circles didn’t attempt federation when not configured, or downgraded the severity / provided a clearer admin hint.
Questions / proposals
  • Should Circles detect that federation/broadcasting is not configured and skip federated requests?
  • If federation is optional, could the app avoid hooking normal group events (or no-op) when federation is off?
  • At minimum, could the exception be handled with a clearer admin message (e.g., “Circles federation disabled or unreachable; set XYZ to silence”)?
Logs

(Full log entry included above; more logs available on request.)

Impact
  • Noise in admin logs on every group membership change.
  • Potential confusion for admins who don’t use Circles/Teams but still see Circles errors during normal group operations.

Thanks for looking into it!

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/Service/FederatedEventService.php, especially doRequest() and initBroadcast(), then trace the GroupMemberAdded.php path shown in the stack trace. Reproduce the normal-group membership request through the Provisioning API and inspect when federation is attempted. Done means the normal group operation no longer produces an unhandled Circles network exception when federation is not configured.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.