Hi Glenn, it works OK in console. But it does not work in my web2py installation - https://mauricelab.pythonanywhere.com/notalogger/default/ntp_logging
It gives me the following error:
Error ticket for "notalogger"
Ticket ID
155.69.203.167.2013-10-25.05-12-25.fa95554b-2df4-40aa-aa59-cfade61a3368
<class 'socket.gaierror'> [Errno -8] Servname not supported for ai_socktype
Version
web2py™ Version 2.7.4-stable+timestamp.2013.10.14.15.16.29
Python Python 2.7.4: /usr/local/bin/uwsgi (prefix: /usr)
Traceback (most recent call last):
File "/home/mauricelab/web2py/gluon/restricted.py", line 217, in restricted
exec ccode in environment
File "/home/mauricelab/web2py/applications/notalogger/controllers/default.py", line 211, in <module>
File "/home/mauricelab/web2py/gluon/globals.py", line 372, in <lambda>
self._caller = lambda f: f()
File "/home/mauricelab/web2py/applications/notalogger/controllers/default.py", line 175, in ntp_logging
response = client.request(server, version=3)
File "applications/notalogger/modules/ntplib.py", line 265, in request
addrinfo = socket.getaddrinfo(host, port)[0]
gaierror: [Errno -8] Servname not supported for ai_socktype
Error snapshot help
<class 'socket.gaierror'>([Errno -8] Servname not supported for ai_socktype)
inspect attributes
Exception instance attributes
module 'socket'
getslice <method-wrapper 'getslice' of gaierror object>
str <method-wrapper 'str' of gaierror object>
getattribute <method-wrapper 'getattribute' of gaierror object>
dict {}
sizeof <built-in method sizeof of gaierror object>
weakref None
init <method-wrapper 'init' of gaierror object>
setattr <method-wrapper 'setattr' of gaierror object>
reduce_ex <built-in method reduce_ex of gaierror object>
new <built-in method new of type object>
errno -8
format <built-in method format of gaierror object>
class <class 'socket.gaierror'>
filename None
doc None
getitem <method-wrapper 'getitem' of gaierror object>
setstate <built-in method setstate of gaierror object>
reduce <built-in method reduce of gaierror object>
args (-8, 'Servname not supported for ai_socktype')
subclasshook <built-in method subclasshook of type object>
unicode <built-in method unicode of gaierror object>
strerror 'Servname not supported for ai_socktype'
delattr <method-wrapper 'delattr' of gaierror object>
repr <method-wrapper 'repr' of gaierror object>
hash <method-wrapper 'hash' of gaierror object>