#12228 closed defect (fixed)
With Trac 1.0.3 or later user email validation often fails because of caching in the env.get_known_users() function
Reported by: | sammcz | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | high | Component: | AccountManagerPlugin |
Severity: | critical | Keywords: | |
Cc: | Ryan J Ollos | Trac Release: | 1.0 |
Description
After upgrading TRAC to 1.0.4 i got many reports about broken email validation. In SMTP server logs i found that TRAC is not attempting to send email in many cases. In the trac log i found many records like this:
Mar 8 03:46:35 sphere Trac[api] INFO: Email verification requested for user: BrigittMcewen Mar 8 03:46:35 sphere Trac[notification] INFO: Email address w/o domain: BrigittMcewen Mar 8 03:46:35 sphere Trac[notification] INFO: no recipient for a ticket notification Mar 8 03:46:35 sphere Trac[session] INFO: Refreshing session BrigittMcewen
This is not happens on every registration, but in about 50% cases. Of course this user have valid email and not only username. Then i wrote a test script to repeat the issue and found that it is caused by recent changes in the trac caching. AccountManager edits attributes directly, so at some point cached records are not valid anymore. After adding few self.env.invalidate_known_users_cache() calls to the code issue was resolved.
Attachments (2)
Change History (14)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
I was able to find that bug is trigged only when notification is enabled, e.g. notify_actions = new,change,delete
in the trac.ini. So probably during notification it updates users cache with a wrong data. My patch fixing issue, however i think it is not accurate or complete. I will try to provide better patch soon.
Changed 10 years ago by
Attachment: | accmgr_v2.patch added |
---|
This patch invalidates cache if there are any actions with users database
comment:3 Changed 9 years ago by
Cc: | Ryan J Ollos added |
---|
comment:7 Changed 8 years ago by
Owner: | changed from Steffen Hoffmann to Ryan J Ollos |
---|---|
Status: | new → accepted |
comment:8 Changed 8 years ago by
#13000 closed as a duplicate, reporting no email sent when using reset password from the admin panel.
comment:10 Changed 7 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
Please test r16869 and let me know if it's not working for you. I think the issue is resolved.
JFYI - i am using Trac 1.0.4 and TracAccountManager 0.4.4.