strange error pydal_connection

28 views
Skip to first unread message

黄祥

unread,
Jun 3, 2019, 10:15:14 PM6/3/19
to web2py-users
first attempt
Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web2py/gluon/restricted.py", line 219, in restricted
   
exec(ccode, environment)
 
File "/Users/sugizo/learn/python/web2py/applications/mutualfunds/controllers/install_demo.py", line 630, in <module>
 
File "/Users/sugizo/learn/python/web2py/gluon/globals.py", line 421, in <lambda>
   
self._caller = lambda f: f()
 
File "/Users/sugizo/learn/python/web2py/applications/mutualfunds/controllers/install_demo.py", line 413, in index
   
'nav_per_unit' : 1317.3918, 'previous_nav_per_unit' : 1316.93},
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 875, in bulk_insert
   
for f in self._after_insert]
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 875, in <listcomp>
   
for f in self._after_insert]
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 874, in <listcomp>
   
[f(el, ret[k]) for k, el in enumerate(data)]
 
File "/Users/sugizo/learn/python/web2py/applications/mutualfunds/modules/mutualfunds_callback.py", line 206, in after_insert_nav
   
if row_account.investor.notification:
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/helpers/classes.py", line 220, in __getattr__
   
self.__allocate()
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/helpers/classes.py", line 209, in __allocate
   
self._record = self._table[long(self)]
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 546, in __getitem__
    orderby_on_limitby
=False
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 2395, in select
   
return adapter.select(self.query, fields, attributes)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/sqlite.py", line 82, in select
   
return super(SQLite, self).select(query, fields, attributes)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/base.py", line 763, in select
   
return self._select_aux(sql, fields, attributes, colnames)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/base.py", line 719, in _select_aux
    rows
= self._select_aux_execute(sql)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/base.py", line 713, in _select_aux_execute
   
self.execute(sql)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 63, in wrap
   
if not args[0].connection:
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/connection.py", line 38, in connection
   
return getattr(THREAD_LOCAL, self._connection_uname_)
AttributeError: '_thread._local' object has no attribute '_pydal_connection_4363584456_2285'

second attempt
Traceback (most recent call last):
 
File "/Users/sugizo/learn/python/web2py/gluon/restricted.py", line 219, in restricted
   
exec(ccode, environment)
 
File "/Users/sugizo/learn/python/web2py/applications/mutualfunds/controllers/install_demo.py", line 630, in <module>
 
File "/Users/sugizo/learn/python/web2py/gluon/globals.py", line 421, in <lambda>
   
self._caller = lambda f: f()
 
File "/Users/sugizo/learn/python/web2py/applications/mutualfunds/controllers/install_demo.py", line 413, in index
   
'nav_per_unit' : 1317.3918, 'previous_nav_per_unit' : 1316.93},
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 875, in bulk_insert
   
for f in self._after_insert]
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 875, in <listcomp>
   
for f in self._after_insert]
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 874, in <listcomp>
   
[f(el, ret[k]) for k, el in enumerate(data)]
 
File "/Users/sugizo/learn/python/web2py/applications/mutualfunds/modules/mutualfunds_callback.py", line 206, in after_insert_nav
   
if row_account.investor.notification:
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/helpers/classes.py", line 220, in __getattr__
   
self.__allocate()
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/helpers/classes.py", line 209, in __allocate
   
self._record = self._table[long(self)]
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 546, in __getitem__
    orderby_on_limitby
=False
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/objects.py", line 2395, in select
   
return adapter.select(self.query, fields, attributes)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/sqlite.py", line 82, in select
   
return super(SQLite, self).select(query, fields, attributes)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/base.py", line 763, in select
   
return self._select_aux(sql, fields, attributes, colnames)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/base.py", line 719, in _select_aux
    rows
= self._select_aux_execute(sql)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/base.py", line 713, in _select_aux_execute
   
self.execute(sql)
 
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 65, in wrap
   
raise ValueError(args[1])
ValueError: SELECT investor.id, investor.is_auth, investor.auth_user, investor.username, investor.first_name, investor.last_name, investor.sid, investor.sre, investor.id_card, investor.tax_no, investor.address, investor.religion, investor.marital_status, investor.occupation, investor.spouse_name, investor.mother_name, investor.heir_name, investor.heir_relation, investor.educational_background, investor.phone, investor.mobile_phone, investor.fax_number, investor.email, investor.ym, investor.bank, investor.bank_account, investor.investor_fund_bank, investor.investor_fund_account, investor.whatsapp, investor.telegram, investor.telegram_bot_token, investor.telegram_bot_chat_id, investor.notes, investor.notification, investor.created_from, investor.modified_from, investor.is_active, investor.created_on, investor.created_by, investor.modified_on, investor.modified_by FROM investor WHERE ((investor.id = 2) AND (investor.is_active = 'T')) LIMIT 1 OFFSET 0;

web2py Version 2.18.5-stable+timestamp.2019.04.08.04.22.03
Python Python 3.7.3: /Users/sugizo/miniconda3/envs/python3_test/bin/python (prefix: /Users/sugizo/miniconda3/envs/python3_test)

steps
rm -rf ~/learn/python/web2py/applications/mutualfunds
cp
-R ~/learn/python/web2py/applications/welcome/ ~/learn/python/web2py/applications/mutualfunds
rsync
-zavr ~/git/web2py/mutualfunds ~/learn/python/web2py/applications/
rsync
-zavur ~/git/web2py/mutualfunds ~/learn/python/web2py/applications/
curl http
://127.0.0.1:8000/mutualfunds/install_demo

any way out to face this ?
same code works well in previous version with python2 
try third and fourth face either first attempt error traceback (mostly) or second attempt error traceback

best regards,
stifan
Reply all
Reply to author
Forward
0 new messages