Ah, yes you are right. However, this error isn't occuring in my own code,
could it be an issue with this build of web2py (
2.16.1-stable+timestamp.2017.11.14.05.54.25
(Running on nginx/1.10.3, Python 2.7.12) ) ?
On Wednesday, 6 December 2017 18:59:29 UTC+1, Val K wrote:
>
> Hi!
> Consider that is NameError, not ImportError. i.e. there is trying to use
> urllib without import
>
> On Wednesday, December 6, 2017 at 6:39:11 PM UTC+3, Ryan Herbert wrote:
>>
>> Hello,
>> I am currently experiencing an issue with my scheduler workers crashing
>> on startup with the following error:
>>
>> Exception in thread Thread-1:
>> Traceback (most recent call last):
>> File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
>> self.run()
>> File "/usr/share/vidjil/server/web2py/gluon/scheduler.py", line 637, in
>> run
>> self.send_heartbeat(counter)
>> File "/usr/share/vidjil/server/web2py/gluon/scheduler.py", line 1161,
>> in send_heartbeat
>> self.db._uri, folder=self.db._adapter.folder, decode_credentials=True
>> )
>> File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py"
>> , line 169, in __call__
>> obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>> File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py"
>> , line 474, in __init__
>> "Failure to connect, tried %d times:\n%s" % (attempts, tb)
>> RuntimeError: Failure to connect, tried 5 times:
>> Traceback (most recent call last):
>> File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py"
>> , line 454, in __init__
>> self._adapter = adapter(**kwargs)
>> File
>> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/__init__.py"
>> , line 40, in __call__
>> obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>> File
>> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/base.py"
>> , line 368, in __init__
>> super(SQLAdapter, self).__init__(*args, **kwargs)
>> File
>> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/base.py"
>> , line 50, in __init__
>> self._initialize_(do_connect)
>> File
>> "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/adapters/mysql.py"
>> , line 24, in _initialize_
>> user = self.credential_decoder(m.group('user'))
>> File "/usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py"
>> , line 403, in <lambda>
>> credential_decoder = lambda cred: urllib.unquote(cred)
>> NameError: global name 'urllib' is not defined
>>
>> The workers are running inside a docker container and are started with
>> the following command:
>> /usr/local/bin/gosu www-data python web2py.py -K myapp
>>
>>
>> I have made sure urllib is correctly installed, and as far as I can tell,
>> it is. Or at least running a python shell and importing the module works.
>> Does anyone have any insight as to why this might be happening ?
>>
>> Thanks
>>
>
--
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.