Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing Moderators Requires Restart to Take Effect #7

Closed
miralgj opened this issue Apr 12, 2017 · 30 comments
Closed

Editing Moderators Requires Restart to Take Effect #7

miralgj opened this issue Apr 12, 2017 · 30 comments
Labels
Milestone

Comments

@miralgj
Copy link

miralgj commented Apr 12, 2017

Version: 6.2.14
OS: RHEL 7

When adding, or editing, a list's moderator list in a newsletter list, newly added moderators are rejected by Sympa as not having permission to send to the list until the Sympa software is restarted.

From what I can tell, when the list config changes it's supposed to trigger a cache update in the database but I don't believe this is ocurring.

@racke
Copy link
Contributor

racke commented Apr 12, 2017

IMHO, caching of list owners and moderators is severely flawed in 6.2. Ran into the same problem a while ago and I finally resorted to just disable this sort of caching by a hack in the code.

Thanks for the report.

@miralgj
Copy link
Author

miralgj commented Apr 12, 2017

@racke Can you share the hack that you did? I'd love to work around it the same way if possible.

@ikedas ikedas added the bug label Apr 12, 2017
@racke
Copy link
Contributor

racke commented Apr 12, 2017

Let me stress that it is a hack and may cause problems. Certainly not a proper fix.

Method get_admins in src/lib/Sympa/List.pm:

     # Fill caches.
     $self->{_admin_cache} ||= {};
+    delete $self->{_admin_cache}{$role} if exists $self->{_admin_cache}{$role};
+

I also patched wwsympa.cgi, because changes to moderators etc. didn't end up in the database:

diff --git a/cgi-bin/wwsympa.fcgi b/cgi-bin/wwsympa.fcgi
index b976a1f..0e28f00 100755
--- a/cgi-bin/wwsympa.fcgi
+++ b/cgi-bin/wwsympa.fcgi
@@ -12431,7 +12431,7 @@ sub do_edit_list {
     }

     ## Reload config to clean some empty entries in $list->{'admin'}
-    $list = Sympa::List->new($list->{'name'}, $robot, {'reload_config' => 1});
+    $list = Sympa::List->new($list->{'name'}, $robot, {'reload_config' => 1,'force_sync_admin' => 1});

     unless (defined $list) {
         Sympa::Report::reject_report_web('intern', 'list_reload', {},

@miralgj
Copy link
Author

miralgj commented Apr 12, 2017

@racke Thank you very much!

@ikedas
Copy link
Member

ikedas commented Apr 14, 2017

@racke May we apply your hack?

@racke
Copy link
Contributor

racke commented Apr 15, 2017 via email

@racke
Copy link
Contributor

racke commented Apr 22, 2017

@ikedas: actually the patch to wwsympa should be fine and we could apply that one.

@ikedas
Copy link
Member

ikedas commented Apr 23, 2017

@racke, thanks for investigating. I have no objection to apply it.

@moschlar
Copy link

moschlar commented Jun 1, 2017

I think it would be good to also add force_sync_admin in bin/sympa.pl in the block for reload_list_config...
At least, that fixed it for me.

racke added a commit that referenced this issue Jun 1, 2017
Thanks to Moritz Schlarb for the suggestion.
@racke
Copy link
Contributor

racke commented Jun 1, 2017

Thanks for the suggestion, I added this through ec77aaa.
@moschlar, @ikedas could you check whether I got it correct?

@moschlar
Copy link

moschlar commented Jun 1, 2017

I think so - but I'm really not an expert at all. I know neither Perl nor Sympa that well. ;-)

@ikedas ikedas added this to the 6.2.17 milestone Jun 2, 2017
ikedas pushed a commit that referenced this issue Jun 7, 2017
Thanks to Moritz Schlarb for the suggestion.
@ikedas
Copy link
Member

ikedas commented Jun 11, 2017

Are there any more fixes on this issue? If not, I'd like to close.

@racke
Copy link
Contributor

racke commented Jun 11, 2017

@ikedas Go ahead, we can open new issues if this or a similar problem pops up again with 6.2.17 release.

@ikedas
Copy link
Member

ikedas commented Jun 11, 2017

Okey, closed. Thanks for reporting and fixing bugs!

@ikedas ikedas closed this as completed Jun 11, 2017
@MargoM
Copy link

MargoM commented Aug 26, 2017

Still facing with this problem.

While refreshing wws/lists page, sometimes shows list@domain (Owner) and sometimes without owner. After restarting spawn-fcgi service, everything works fine.

Sympa version: Sympa 6.2.19b.1
OS: CentOS Linux release 7.3.1611

// Okey, after applying manually this line: "delete $self->{_admin_cache}{$role} if exists $self->{_admin_cache}{$role};" to src/lib/Sympa/List.pm:. Seems to work, I expected, it already have submitted to newer verision source code.

@MargoM
Copy link

MargoM commented Sep 10, 2017

@ikedas

Why change in List.pm is not applied to code? Is it hack or?
I mean this change in List.pm that racke commented: #7 (comment). I have to change it manually, otherwise it's not working properly.

@ikedas ikedas reopened this Sep 10, 2017
@ikedas
Copy link
Member

ikedas commented Sep 14, 2017

@MargoM, the change you suggested is the same as stopping use of {_admin_cache}.

In fact {_admin_cache} is the root of evil, however, we should consider how the change will affect performance. Firstly, would you check a minor change below?

ikedas added a commit to ikedas/sympa that referenced this issue Sep 14, 2017
@MargoM
Copy link

MargoM commented Sep 14, 2017

@ikedas, unfortunately, this minor change didn't helped me. I can still reproduce this bug.

@ikedas
Copy link
Member

ikedas commented Sep 14, 2017

@MargoM, owners sometimes shown or not shown is included from data source, or owners set in list config page?

  • In former case, delay of update may be controled by ttl (Inclusions timeout), 3600s by default.
  • In latter case, delay may be usually at least a few seconds.

This is the feature at this moment. I guess radical fix will be done in the future.

@MargoM
Copy link

MargoM commented Sep 14, 2017

@ikedas, while logging in as "normal owner" sometimes I can change list configuration and sometimes shows red textbox "AUTHORIZATION REJECT (edit_list_request) This action is restricted to list owners. ".
While logging in as "listmaster", in list configuration page, in textfields owner values are stable, but in left menu ("List Options") where the Owners are described this line is changing almost everytime I refresh the page.

@racke
Copy link
Contributor

racke commented Oct 12, 2017

At this point I would suggest to add a global/list option to switch off the admin cache, which probably should to on by default.

@MargoM
Copy link

MargoM commented Oct 12, 2017

@racke how I can switch off the admin cache? You mean this: src/lib/Sympa/List.pm, #7 (comment)? I'm using this change in List.pm and it seems to be working fine.
I'm planning to upgrade Sympa vers. 3 to 6, so will see how this affect the performance.

ikedas added a commit to ikedas/sympa that referenced this issue Oct 17, 2017
Fixed by publishing the last change and sync by .last_chage.member and .last_sync.member files in list directory so that the last time of update may be shared among processes.

This change possiblly can solve issue sympa-community#7.
@ikedas
Copy link
Member

ikedas commented Oct 23, 2017

The PR above can solve the problem. Please check it (it will be included in next beta, 6.2.23b.1).

ikedas added a commit to ikedas/sympa that referenced this issue Oct 25, 2017
Fixed by publishing the last change and sync by .last_chage.member and .last_sync.member files in list directory so that the last time of update may be shared among processes.

This change possiblly can solve issue sympa-community#7.
@ikedas
Copy link
Member

ikedas commented Dec 6, 2017

If problem will not be reported reproducing with 6.2.23b.2 by 14 Dec., I'll close this issue.

@tannevaled
Copy link

[root@listes ~]# yum info sympa
Modules complémentaires chargés : security
Paquets installés
Nom : sympa
Architecture : x86_64
Version : 6.2.23b.2
Révision : 1.20171130.RHEL6
Taille : 18 M
Dépôt  : installed
Depuis le dépôt : sympa-ja.org
Résumé  : Gestionnaire de listes électroniques
URL : http://www.sympa.org
Licence  : GPLv2+
Description :

same error here -> ERREUR INTERNE (edit_list) - Impossible de synchroniser les administrateurs de la liste

@ikedas
Copy link
Member

ikedas commented Dec 13, 2017

@tannevaled, could you please show the Sympa log (syslog)?

@tannevaled
Copy link

sympa_log.txt

@tannevaled
Copy link

L'utilisateur lismaster@domain.tld a été confronté à une erreur
interne
(Interface web - ACTION : Command process - LIST :
xdev@listes.domain.tld) :

Problème de synchronisation des administrateurs de la liste 'xdev'

Consultez les logs pour plus de détails.

@ikedas
Copy link
Member

ikedas commented Dec 15, 2017

@tannevaled,

Dec 14 12:12:13 listes wwsympa[12358]: err main::#1606 > main::do_edit_list#10559 > Sympa::List::new#399 > Sympa::List::sync_include_admin#7165 > Sympa::List::add_list_admin#3978 > Sympa::DatabaseDriver::PostgreSQL::do_prepared_query#98 > Sympa::Database::do_prepared_query#382 Unable to execute SQL statement "INSERT INTO admin_table (user_admin, comment_admin, list_admin, robot_admin, date_admin, update_admin, reception_admin, visibility_admin, subscribed_admin, included_admin, include_sources_admin, role_admin, info_admin, profile_admin) VALUES (?, ?, ?, ?, 'epoch'::timestamp with time zone + '1513249933 sec', 'epoch'::timestamp with time zone + '1513249933 sec', ?, ?, ?, ?, ?, ?, ?, ?)": (23505) ERROR:  duplicate key value violates unique constraint "ind_admin"
Dec 14 12:12:13 listes wwsympa[12358]: err main::#1606 > main::do_edit_list#10559 > Sympa::List::new#399 > Sympa::List::sync_include_admin#7165 > Sympa::List::add_list_admin#4009 Unable to add admin listmaster@domain.tld to table admin_table for list Sympa::List <xdev@listes.domain.tld>:
Dec 14 12:12:13 listes wwsympa[12358]: err main::#1606 > main::do_edit_list#10559 > Sympa::List::new#399 > Sympa::List::sync_include_admin#7167 Failed to add new owner(s) to list Sympa::List <xdev@listes.domain.tld>
Dec 14 12:12:13 listes wwsympa[12358]: err main::#1606 > main::do_edit_list#10559 > Sympa::List::new#399

The error duplicate key value violates unique constraint "ind_admin" is what issue #11 deals with. Please continue there. Merci.

@ikedas
Copy link
Member

ikedas commented Dec 15, 2017

Problem has no longer been reported. Issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants