Is in your issue web2py the only moving part?? Nothing change on OS and
Redis side??

As it mention in the final trace back above there seems to need a password
to be setup in your redis connection string... Perhap you forgot that you
set one or there is a default one defined in you Linux box or in the new
version of Redis????

Richard

On Tue, Jun 19, 2018 at 9:17 PM, 黄祥 <[email protected]> wrote:

> it seems session with redis not work in 2.16.1
> *e.g. create web2py from scratch name redis*
> *models/db.py*
> from gluon.contrib.redis_utils import RConn
> from gluon.contrib.redis_cache import RedisCache
> from gluon.contrib.redis_session import RedisSession
> rconn = RConn('localhost', 6379)
> cache.redis = RedisCache(redis_conn = rconn, debug = True)
> sessiondb = RedisSession(redis_conn = rconn, session_expiry = False)
> session.connect(request, response, db = sessiondb)
>
> *result in browser http://localhost:8000/redis/default/index
> <http://localhost:8000/redis/default/index>*
> Traceback (most recent call last):
>   File "/Users/sugizo/web2py/gluon/main.py", line 461, in wsgibase
>     session._try_store_in_db(request, response)
>   File "/Users/sugizo/web2py/gluon/globals.py", line 1224, in
> _try_store_in_db
>     record_id = table.insert(**dd)
>   File "/Users/sugizo/web2py/gluon/contrib/redis_session.py", line 137, in
> insert
>     newid = str(self.db.r_server.incr(self.serial))
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/client.py", line 1011, in incr
>     return self.execute_command('INCRBY', name, amount)
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/client.py", line 667, in execute_command
>     connection.send_command(*args)
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 610, in send_command
>     self.send_packed_command(self.pack_command(*args))
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 585, in send_packed_command
>     self.connect()
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 493, in connect
>     self.on_connect()
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 567, in on_connect
>     if nativestr(self.read_response()) != 'OK':
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 629, in read_response
>     raise response
> ResponseError: invalid DB index
>
> also, is it possible to use redis secured with password in web2py?
> *e.g.*
> *redis.conf*
> requirepass password
>
> *models/db.py*
> rconn = RConn('localhost', 6379, 'password')
> #sessiondb = RedisSession(redis_conn = rconn, session_expiry = False)
> #session.connect(request, response, db = sessiondb)
>
> *result in browser http://localhost:8000/redis/default/index
> <http://localhost:8000/redis/default/index>*
> Traceback (most recent call last):
>   File "/Users/sugizo/web2py/gluon/main.py", line 461, in wsgibase
>     session._try_store_in_db(request, response)
>   File "/Users/sugizo/web2py/gluon/globals.py", line 1224, in
> _try_store_in_db
>     record_id = table.insert(**dd)
>   File "/Users/sugizo/web2py/gluon/contrib/redis_session.py", line 137, in
> insert
>     newid = str(self.db.r_server.incr(self.serial))
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/client.py", line 1011, in incr
>     return self.execute_command('INCRBY', name, amount)
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/client.py", line 667, in execute_command
>     connection.send_command(*args)
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 610, in send_command
>     self.send_packed_command(self.pack_command(*args))
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 585, in send_packed_command
>     self.connect()
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 493, in connect
>     self.on_connect()
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 567, in on_connect
>     if nativestr(self.read_response()) != 'OK':
>   File "/Users/MacBookPro/miniconda3/envs/python2_prod/lib/python2.
> 7/site-packages/redis/connection.py", line 629, in read_response
>     raise response
> ResponseError: NOAUTH Authentication required.
>
> any hints?
>
> thx and best regards,
> stifan
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to