nginx, basic auth: internal error

37 views
Skip to first unread message

tomasz bandura

unread,
May 8, 2019, 6:49:34 AM5/8/19
to web...@googlegroups.com
Hello,

I use web2py (2.16.1) on 2 environments:
1. Embedded Rocket wsgi server
2. Deployed on nginx+uwsgi

I have the same application on both env, connected to the same database.
The application uses Basic Authentication, like in the example:
def f1():
  auth.basic()
  if auth.user:
        ## do something ...
  else:
        ## raise defined auth exception

What is strange, the problem occures only on nginx+uwsgi: 
1. If I call it without basic authorization it will raise defined exception correctly
2. The problem is when I put header with correct authorization - it raises Internal error Ticked issued: uncoverable, and there is no any traces in logs.

The solution is putting session.forget() before auth.basic(), but why?

Could someone explain me the impact of session.forget() for that behaviour?

According documentation it is used to avoid storing session ( and it is understandable)

Regards,
Tomasz

Tim Nyborg

unread,
May 8, 2019, 8:09:52 AM5/8/19
to web2py-users
My guess is that something is wrong with the file permissions on the sessions folder/subfolders.  If uwsgi is trying to write a session file and failing, you'll get an unrecoverable error.

tomasz bandura

unread,
May 8, 2019, 8:41:38 AM5/8/19
to web...@googlegroups.com
Not sure, because I also use in the same application a standard login/pass form auth and it works perfectly.


--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/069ab380-b514-42e7-92d7-05b0c6c70dd7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jörg Schneider

unread,
May 10, 2019, 11:59:20 AM5/10/19
to web2py-users
Are you logged in in the admin application the same time (same browser) ?

tomasz bandura

unread,
May 10, 2019, 12:10:25 PM5/10/19
to web...@googlegroups.com
No, I also clear the cache of browser to be sure there is no any active session.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web2py+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages