mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-26 01:16:01 +03:00
[GH-ISSUE #1015] Weird get_request() is None #862
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#862
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gawel on GitHub (Feb 2, 2017).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1015
Originally assigned to: @tonioo on GitHub.
Got this traceback (row mail from our production server):
We are using mod_wsgi without threads.
@kryskool commented on GitHub (Feb 10, 2017):
Hi @gawel
Which version of modoboa, apache ?
Regards,
@gawel commented on GitHub (Feb 23, 2017):
Just got this again today.
I'm using modoboa 1.6.3 and waitress as server.
@gawel commented on GitHub (Feb 23, 2017):
It seems like current_user is only used to log the revision...
So I guess the action is done (not aborted by this error) but the user get a traceback.
I think this stuff should be more fault tolerant. eg: if get_request() is None then log as user "unknown"
@tonioo commented on GitHub (Feb 26, 2017):
The get_request() signal is used by other parts of the code but in this
case, it is just used to know the user performing the action.
The original trace you posted occured while creating a new account and
this action requires the current user to be authenticated... Could it be
a waitress issue?
On 23/02/2017 11:41, Gael Pasgrimaud wrote:
@gawel commented on GitHub (Feb 26, 2017):
Yeah, maybe. I think it's more related to multithreaded servers.
github.com/modoboa/modoboa@8db5eefc0c/modoboa/lib/middleware.py (L56)Since you use a singleton, what happens if a thread initialize a middleware (and didn't call process_request yet) but another thread is trying to access the request from the signal ?
Maybe creating a request_accessor by thread id can solve the issue