circles icon indicating copy to clipboard operation
circles copied to clipboard

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

Open alif1010 opened this issue 3 months ago • 0 comments

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!

alif1010 avatar Sep 20 '25 23:09 alif1010