Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB fails to connect in scheduler when no explicit credential is in the connection string #635

Open
onetwomani opened this issue Jul 4, 2020 · 0 comments

Comments

@onetwomani
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant