You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The scheduler fails to connect to the db after starting up if the connection string does not provide an explicit password.
Filing reference for similar issue [https://github.com/web2py/web2py/issues/2335]
To Reproduce
Steps to reproduce the behavior:
With a postgresql database, create a .pgpass file that stores the db credential such
Launch application with scheduler using
python web2py.py -K
See error
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2020
Version 2.20.4-stable+timestamp.2020.05.02.22.03.36
Database drivers available: psycopg2, imaplib, pymysql, pyodbc
starting single-scheduler for "app"...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/var/www/web2py/gluon/scheduler.py", line 792, in run
self.send_heartbeat(counter)
File "/var/www/web2py/gluon/scheduler.py", line 1175, in send_heartbeat
self.db_thread = DAL(
File "/var/www/web2py/gluon/packages/dal/pydal/base.py", line 208, in call
obj = super(MetaDAL, cls).call(*args, **kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/base.py", line 524, in init
raise RuntimeError(
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
File "/var/www/web2py/gluon/packages/dal/pydal/base.py", line 506, in init
self._adapter = adapter(**kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 28, in call
return AdapterMeta.call(cls, *args, **kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/init.py", line 41, in call
obj = super(AdapterMeta, cls).call(*args, **kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 58, in init
super(Postgre, self).init(
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 417, in init
super(SQLAdapter, self).init(*args, **kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 86, in init
self.initialize()
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 78, in initialize
password = self.credential_decoder(m.group("password"))
File "/var/www/web2py/gluon/packages/dal/pydal/base.py", line 454, in
credential_decoder = lambda cred: unquote(cred)
File "/usr/local/lib/python3.8/urllib/parse.py", line 634, in unquote
if '%' not in string:
TypeError: argument of type 'NoneType' is not iterable
Expected behavior
Scheduler task should run...
The text was updated successfully, but these errors were encountered:
Describe the bug
The scheduler fails to connect to the db after starting up if the connection string does not provide an explicit password.
Filing reference for similar issue [https://github.com/web2py/web2py/issues/2335]
To Reproduce
Steps to reproduce the behavior:
With a postgresql database, create a .pgpass file that stores the db credential such
Launch application with scheduler using
python web2py.py -K
See error
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2020
Version 2.20.4-stable+timestamp.2020.05.02.22.03.36
Database drivers available: psycopg2, imaplib, pymysql, pyodbc
starting single-scheduler for "app"...
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/var/www/web2py/gluon/scheduler.py", line 792, in run
self.send_heartbeat(counter)
File "/var/www/web2py/gluon/scheduler.py", line 1175, in send_heartbeat
self.db_thread = DAL(
File "/var/www/web2py/gluon/packages/dal/pydal/base.py", line 208, in call
obj = super(MetaDAL, cls).call(*args, **kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/base.py", line 524, in init
raise RuntimeError(
RuntimeError: Failure to connect, tried 5 times:
Traceback (most recent call last):
File "/var/www/web2py/gluon/packages/dal/pydal/base.py", line 506, in init
self._adapter = adapter(**kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 28, in call
return AdapterMeta.call(cls, *args, **kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/init.py", line 41, in call
obj = super(AdapterMeta, cls).call(*args, **kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 58, in init
super(Postgre, self).init(
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 417, in init
super(SQLAdapter, self).init(*args, **kwargs)
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 86, in init
self.initialize()
File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line 78, in initialize
password = self.credential_decoder(m.group("password"))
File "/var/www/web2py/gluon/packages/dal/pydal/base.py", line 454, in
credential_decoder = lambda cred: unquote(cred)
File "/usr/local/lib/python3.8/urllib/parse.py", line 634, in unquote
if '%' not in string:
TypeError: argument of type 'NoneType' is not iterable
Expected behavior
Scheduler task should run...
The text was updated successfully, but these errors were encountered: