unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.46k stars 691 forks source link

default appid issue (trying to use only the rados plugin) #1031

Open PAStheLoD opened 9 years ago

PAStheLoD commented 9 years ago

Hello!

curl http://uwsgi.it/install | bash -s rados /usr/local/bin/uwsgi gets us uwsgi_latest_from_installer.tar.gz (size 782091, md5 087ba7b53bd4afc0f0218f5eb3398809), which says that it's 2.0.11.1)

And for some reason it gives 404 for everything, because using a minimal ini file config:

root@621791dc5b4a:/# cat /etc/uwsgi/rados.ini 
[uwsgi]
  http-socket = :8000
  http-socket-modifier1 = 28
  rados-mount = mountpoint=/static/,pool=prod,config=/etc/ceph/ceph.conf
  threads = 30

And running as uwsgi --ini /etc/uwsgi/rados.ini results in an early return around here

For some reason uwsgi.default_app is -1.

After patching rados.c to force wsgi_req->app_id to be 0 things started to work.

If you could enlighten me what's going on, it'd be great. Thanks!

unbit commented 9 years ago

Thanks for your report, i have checked your workaround too. I'll check why it is happening

funny-falcon commented 8 years ago

I have different workaround within pullrequest #1228 774cee4f129e92ee3beba0c5f22ee2f7978de6b5

PAStheLoD commented 8 years ago

Hello again!

So, I don't know why I've missed it, but it's trivial why it happens. (And it still happens, and this affects all other plugins too, that allow setting mountpoint.)

I guess there is (was) some reason why only apps mounted on '/' can become default, but the problem is, there's no fallback for other apps, and/or no way to force routing directly to app_id.