[rt-users] Abnormal number of groups
Haim Dimer
haim at dimer.org
Tue Feb 7 10:17:20 EST 2012
Hello,
Check this out:
mysql> SELECT COUNT(id) FROM Groups;
+-----------+
| count(id) |
+-----------+
| 4674 |
+-----------+
I don't think this is normal behavior since, as the administrator, I have
not created this many groups (at least not intentionally). I may have an
idea as to where they come from, look at this:
mysql> SELECT COUNT(id) FROM Groups WHERE Domain = "RT::Ticket-Role";
+-----------+
| COUNT(id) |
+-----------+
| 4496 |
+-----------+
We currently have about 1,100 tickets in the database. Every time a ticket
is created, a scrip runs using a template that contains the following code:
--- CUT HERE
my $GroupName = ''Computer Support;
# instantiate a group object
my $addGroupObj = RT::Group->new($RT::SystemUser);
$addGroupObj->LoadUserDefinedGroup($GroupName);
return undef unless $addGroupObj;
my $addGroupMembersObj = $addGroupObj->UserMembersObj;
my $res = '';
# walk through members of group to do stuff
while ( my $userObj = $addGroupMembersObj->Next) {
--- CUT HERE
It seems that my $addGroupObj = RT::Group->new($RT::SystemUser) creates a
real group in the database. Can someone confirm?
I figuredit could be the case so after I'm done with that $addGroupObj, I
tried to clean things up by using
$addGroupObj->Delete();
Here is the error I got in the logs:
[Sun Jan 1 22:50:54 2012] [crit]: Deleting groups violates referential
integrity until we go through and fix this
(/usr/local/rt4/sbin/../lib/RT/Group.pm:627)
I do not believe it's healthy. I need to know if it's really my template
that is causing the issue and if so, how can I gather the email addresses
for each member of an existing group without creating a new one.
I use RT 4.0.4. Thank you for your help.
Haïm Dimermanas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120207/790fe174/attachment.htm>
More information about the rt-users
mailing list