Skip to content

New user creation fails to send welcome email: "no registry found" in async SendMail goroutine #954

Description

@g4w3l

📝 Describe the bug
When creating a new user from the admin console (or via the PutUser REST endpoint) with automatic email notification enabled, the welcome email (containing the generated password) is never sent. The following error and stack trace appear in the logs:

2026-07-06T12:11:16.018Z	ERROR	pydio.rest.user	Could not send email to new user	{"error": "no registry found", "tag": "idm", "tag": "users"}
goroutine 148732 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x5e
runtime/debug.PrintStack()
	runtime/debug/stack.go:18 +0x13
github.com/pydio/cells/v5/common/client/grpc.(*clientConn).resolveConn(0x15a5d4e556e0, {0xc1f0a68, 0x15a5d47963f0})
	github.com/pydio/cells/v5/common/client/grpc/grpc.go:119 +0x4b6
github.com/pydio/cells/v5/common/client/grpc.(*clientConn).getConn(0x15a5d4e556e0, {0xc1f0a68, 0x15a5d47963f0})
	github.com/pydio/cells/v5/common/client/grpc/grpc.go:221 +0x85
github.com/pydio/cells/v5/common/client/grpc.(*clientConn).Invoke(0x15a5d4e556e0, {0xc1f0a68, 0x15a5d47963f0}, {0x606559f, 0x1e}, {0x59e56a0, 0x15a5d4793d40}, {0x58fd080, 0x15a5d4796420}, {0x0, ...})
	github.com/pydio/cells/v5/common/client/grpc/grpc.go:232 +0x6a
github.com/pydio/cells/v5/common/proto/mailer.(*mailerServiceClient).SendMail(0x15a5d34e04e0, {0xc1f0a68, 0x15a5d47963f0}, 0x15a5d4793d40, {0x0, 0x0, 0x0})
	github.com/pydio/cells/v5/common/proto/mailer/cells-mailer_grpc.pb.go:35 +0xc8
github.com/pydio/cells/v5/idm/user/rest.(*UserHandler).PutUser.func2()
	github.com/pydio/cells/v5/idm/user/rest/handler.go:661 +0xd7
created by github.com/pydio/cells/v5/idm/user/rest.(*UserHandler).PutUser in goroutine 20788
	github.com/pydio/cells/v5/idm/user/rest/handler.go:660 +0x4c86

⚙️ How-to Reproduce

Steps to reproduce the behavior:

  1. Deploy Cells v5.0.2 via Docker Compose (single container, MariaDB backend)
  2. Configure a working SMTP mailer in Application Parameters > Mailers
  3. Confirm "Send test email" succeeds
  4. Create a new user via the admin console with "send credentials by email" enabled
  5. Observe: no email is sent, error logged as above

The mailer service itself is correctly configured and reachable: using "Send test email" in Application Parameters > Mailers works without any error. This rules out an SMTP configuration issue.

The failure only happens on the SendMail call triggered from PutUser, which — per the stack trace — is invoked from a goroutine spawned at handler.go:660 (PutUser.func2()), i.e. asynchronously, detached from the original request's context. The synchronous "send test email" path (triggered directly from an admin REST call) works fine.

This strongly suggests that the context passed into this async goroutine does not carry the registry/service-discovery information that resolveConn needs to find the mailer's gRPC connection, whereas the context used in synchronous request handling does.

🩺 Environment / Setup

Complete the following information:

Server Versions:

  • Cells version: v5.0.2 (also reproduced on v5.0.1) — pydio/cells:latest Docker image
  • Deployment: single-container Docker Compose (no clustering, no external registry), MariaDB as backend DB
  • Reverse proxy: external (Nginx), CELLS_SITE_NO_TLS=1, CELLS_SITE_EXTERNAL set

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedIssue has been accepted and is tracked internally

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions