From d2188ce1dd22bf8ae5c1d9a43fa36c0049a1f099 Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Wed, 2 Jul 2025 13:29:48 -0300 Subject: [PATCH] remove spurious user limits log (#33038) Only log a warning when the created user exceeds the `MaxUserLimits` if `MaxUsersLimit > 0`. This was showing up spuriously on licensed servers for which no limit applied. Note that this is distinct from blocking user creation past `MaxHardUsersLimit`. --- server/channels/app/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/channels/app/user.go b/server/channels/app/user.go index c478e0cf241..53cf946c013 100644 --- a/server/channels/app/user.go +++ b/server/channels/app/user.go @@ -335,7 +335,7 @@ func (a *App) createUserOrGuest(c request.CTX, user *model.User, guest bool) (*m // So, we log the error, not return c.Logger().Error("Error fetching user limits in createUserOrGuest", mlog.Err(limitErr)) } else { - if userLimits.ActiveUserCount > userLimits.MaxUsersLimit { + if userLimits.MaxUsersLimit > 0 && userLimits.ActiveUserCount > userLimits.MaxUsersLimit { // Use different warning messages based on whether server is licensed if a.License() != nil { c.Logger().Warn("ERROR_LICENSED_USERS_LIMIT_EXCEEDED: Created user exceeds the maximum licensed users.", mlog.Int("user_limit", userLimits.MaxUsersLimit))