Modify

Opened 9 years ago

Last modified 7 years ago

#12167 new defect

Multi-project, same digest, Login buttons disappearing

Reported by: massimo.b@… Owned by:
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

[uwsgi]
plugins = python27
chown-socket = trac:nginx
uid = trac
gid = trac
workers = 2
socket = /run/uwsgi/%n.sock
env = TRAC_ENV_PARENT_DIR=/mnt/data/trac/projects
env = PYTHON_EGG_CACHE=/mnt/data/trac/.python-eggs
module = trac.web.main
callable = dispatch_request

And the account manager using the same htdigest_file in both projects:

[account-manager]
force_passwd_change = true
generated_password_length = 12
htdigest_file = /mnt/data/trac/htpasswd/users.htdigest
htdigest_realm = project-pb
login_attempt_max_count = 3
password_store = HtDigestStore
reset_password = true
user_lock_max_time = 86400
user_lock_time = 15
user_lock_time_progression = 2

However now I got a new problem, that sometimes the Login button is there and sometimes after reload not... Sometimes the Login button appearance switches for every reload.

This is reproducible: Being on projectA, restarting the uWSGI daemon and reloading, the Login button is there and does not disappear after reload. Switching to projectB the Login buttons is missing and does not appear after reloading. After restarting uWSGI the Login button appears after reload and stays, but now switching to projectA it is missing.

I attach the DEBUG log of such a reload without Login button.

Attachments (3)

trac.log (16.9 KB) - added by massimo.b@… 9 years ago.
DEBUG log of reload
uwsgi.log (3.6 KB) - added by massimo.b@… 9 years ago.
uwsgi log
nginx.conf (2.8 KB) - added by massimo.b@… 9 years ago.
nginx.conf

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by massimo.b@…

Attachment: trac.log added

DEBUG log of reload

Changed 9 years ago by massimo.b@…

Attachment: uwsgi.log added

uwsgi log

Changed 9 years ago by massimo.b@…

Attachment: nginx.conf added

nginx.conf

comment:1 Changed 9 years ago by anonymous

Trying to solve this issue from scratch...

  • Because of the many compatibility issue between plugins, I removed all plugins from both trac environments and cleared the complete [components]. Reloading the home page of both trac projects works now, login is there after reload. So this is no trac bug.
  • Trying to get at least any authentication working, so trying default authentication via auth_basic by Nginx. Because digest_auth is not supported natively by Nginx, I tried the basic. I started first with the test project only:
location /trac/trac-test/login {
  auth_basic_user_file /mnt/data/trac/projects/trac-test/trac.htpasswd;
  auth_basic "Login for trac-test";

This does not work, Nginx fails like

2015/01/30 13:01:30 [error] 15589#0: *47 open() "/mnt/data/trac/trac/trac-test/login" failed (2: No such file or directory), client: 192.168.20.131, server: project-pb, request: "GET /trac/trac-test/login HTTP/1.1", host: "project-pb", referrer: "https://project-pb/trac/trac-test"

Of course this directory does not exist, why does Nginx looks for it?

http://trac.edgewall.org/wiki/TracModWSGI#UsingBasicAuthentication says...

Note that neither a file nor a directory named 'login' needs to exist.

  • Next step. I added TracAccountManager-0.5dev_r14363-py2.7.egg to ./plugins in both projects.
    htpasswd_file = /mnt/data/trac/projects/trac-test/trac.htpasswd
    password_store = HtPasswdStore
    

and the other project with a different trac.htpasswd file. The problem is there again.

Switching to the other project and reloading makes the Login disappear until uWSGI is restarted, the the opposite projects has the missing Login.

Database link to postgres is different, htpasswd is different. Now only the .egg-cache is shared between the projects and issue here?

comment:2 Changed 9 years ago by anonymous

Because this seems to be some caching related, maybe this nginx warning could be an issue?

2015/01/30 14:14:53 [warn] 16662#0: *1 an upstream response is buffered to a temporary file //var/lib/nginx/tmp/uwsgi/1/00/0000000001 while reading upstream, client: 192.168.2.13, server: project-pb, request: "GET /trac/trac-test/chrome/common/js/jquery.js HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/trac.sock:", host: "project-pb", referrer: "https://project-pb/trac/trac-test"

comment:3 Changed 9 years ago by anonymous

For now was able to avoid the issue by preparing completly separated uwsgi for the different trac projects, Nginx using 2 separated uwsgi sockets.

I would just prefer to use the multi-project and PARENT_DIR features of Trac in next future.

comment:4 Changed 7 years ago by Ryan J Ollos

Owner: Steffen Hoffmann deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.