Running into an error in Groups > Membership > Automatic field complaining that An error occurred: Automatic membership email domains is too long (maximum is 1000 characters)
Our list of domains is increasing and the number of users is increasing as a result as well. Can this limit be removed or sustainably increased please? Or is there another work around for this error?
Most folks don’t bump into this issue, so it means it isn’t an apparent use. Describing how you are using the automatic group (there are several reasons to do so) will allow us to think of alternatives.
@maiki thanks for your response. We are using this particular group to allow for additional access to support area(s) of our community. So anyone within the domain name that we add to this should have that access. A rough count in that list is about 60 domain names which I don’t think is all that unreasonable. But it looks like it’s not only including the actual domain name but also the , delimiter that it puts automatically there together with the character lengths of these 60 domain names. Seems strange to have such a character limit when using domain names in this kind of field. Some domain names are many characters and some not. If there had to be this character limit for some reason, perhaps increasing it to 100K characters would be a better choice.
The immediate workaround is to create some more groups, but you’ll also need to add those to the support categories.
(When I’m not providing free support) I’m working on a plugin that will add a user to a group if they are a member of another (set of) group(s). If it existed, and you are hosted in such a way that you could use it, it might help.
If you’re self-hosted, I think you could modify your app.yml such that it edited settings.yml and made the limit whatever you wanted.
@pfaffman thanks, yeah I thought of doing additional groups as a workaround too. This particular community is self-hosted, I’ve not seen such a setting in app.yml but if you can provide sample of what that would look like I’d be willing to try it.
You can look at some other templates that change other files. The ssl template changes some stuff in the nginx config. You’d use that as a model and do something similar to change.
You need to change validates :automatic_membership_email_domains, length: { maximum: 1000 } that is in app/models/group.rb.
This is not a recommended practice and will probably break upgrades in the UX.
I see. Yeah not too keen on causing potential issues with upgrades. Hopeful native solution to increase this limit on number of characters in a domain list. Would maybe have been sense if it was a domain count limit of say 1000 domains but why a character limit in a list like this, seems pretty arbitrary or just a re-use of an existing component that has it else where.
Because it’s easy to count characters and 1000 seems like a lot. I think that whoever choose 1000 would agree that it’s arbitrary, but that it’s arbitrarily high. I think most people who have your use case are using SSO/DiscourseConnect and have groups updated that way.
When we initially applied the limits we had a much lower limit (100 characters). But someone ran into that limit, and we raised it on the assumption that the longest domains in the world are only in the 70s of characters long, and most domains will be much shorter, so it seemed like a good number that would strike the balance between advanced use-cases and performance.
For this particular setting, that list of domains is checked every time a new user is created. If the number of allowed characters is too high the operation is going to cause trouble for your site.
Are these like partner vendors or a network or sites? Please describe them with as much detail as you feel comfortable.
If you are hitting the limit of 1,000 characters with 60 domains, I’m not sure raising that value is going to help you in the long run. However, we see folks using groups for really interesting things, so knowing how you use email domains to organize your community gives us insight on improvements to make to the interface.