Web2py won't start with getLogger error

93 views
Skip to first unread message

Omi Chiba

unread,
Oct 6, 2017, 6:26:14 PM10/6/17
to web...@googlegroups.com
Help!

I was running old version (2015) of web2py on my hosting server as our company's portal site and it stopped working suddenly. It's Windows 2012 server with Uniserver(Apache). Apache start fine but shows error message. 



Here's some related files including error log.

I also tried if I can just start up web2py with rocket server by excuting web2py.py but I got a following error. I really don't know what to do... this is production server for our customer and need to be fixed as soon as possible.I restored the entire folder for Uniserver and web2py but same error. 

C:\web2py>web2py.py
Traceback (most recent call last):
  File "C:\web2py\web2py.py", line 18, in <module>
    import gluon.widget
  File "C:\web2py\gluon\__init__.py", line 15, in <module>
    from globals import current
  File "C:\web2py\gluon\globals.py", line 17, in <module>
    from storage import Storage, List
  File "C:\web2py\gluon\storage.py", line 16, in <module>
    import portalocker
  File "C:\web2py\gluon\portalocker.py", line 46, in <module>
    logger = logging.getLogger("web2py")
AttributeError: 'module' object has no attribute 'getLogger'

Dave S

unread,
Oct 6, 2017, 6:56:24 PM10/6/17
to web2py-users



The logging module is standard python for 2.7 and earlier ... what version of python are you using, and has that changed recently?


/dps

Massimo Di Pierro

unread,
Oct 6, 2017, 7:07:48 PM10/6/17
to web2py-users
The file in question no longer exists. It has been moved to a subfolder long ago. 
The error you are getting makes no sense since 

python

>>> import logging

>>> logging.getLogger

<function getLogger at 0x101de4ed8>


 that is a function from the python module logging, and not a web2py function.

to diagnose this it is important to understand:
which python version?
what has changed?

Dave S

unread,
Oct 6, 2017, 7:15:56 PM10/6/17
to web2py-users


On Friday, October 6, 2017 at 3:56:24 PM UTC-7, Dave S wrote:


On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote:
Help!

I was running old version (2015) of web2py on my hosting server as our company's portal site and it stopped working suddenly. It's Windows 2012 server with Uniserver(Apache). Apache start fine but shows error message. 
[...]
AttributeError: 'module' object has no attribute 'getLogger'



The logging module is standard python for 2.7 and earlier ... what version of python are you using, and has that changed recently?


Or did your PYTHONPATH variable change.

import logging
dir
(logging)



shows getLogger in python 3.6.2, also.

/dps

 

Omi Chiba

unread,
Oct 6, 2017, 7:32:51 PM10/6/17
to web2py-users
My Python version is 2.7.4. and My Web2py is Version 2.4.7-stable+timestamp.2013.05.24.17.48.47

Nothing changed since I setup my server in 2013 but it looks like something happened at 10/2 per error log. Remote Access to the server was down. My hosting company told me they did some kind of update and working fine now but my web2py doesn't work...

Omi Chiba

unread,
Oct 6, 2017, 7:43:18 PM10/6/17
to web2py-users
I have C:\Python27 in my "Path" System variables and I can run the pyson module (*.py) from command prompt.

Dave S

unread,
Oct 6, 2017, 7:48:39 PM10/6/17
to web2py-users


On Friday, October 6, 2017 at 4:07:48 PM UTC-7, Massimo Di Pierro wrote:
The file in question no longer exists. It has been moved to a subfolder long ago. 

"Long ago"  is after 2.14.6  :-)

The error you are getting makes no sense since 

python

>>> import logging

>>> logging.getLogger

<function getLogger at 0x101de4ed8>


 that is a function from the python module logging, and not a web2py function.

to diagnose this it is important to understand:
which python version?
what has changed?


And to repeat ... PYTHONPATH value?

/dps
 

Dave S

unread,
Oct 6, 2017, 7:50:16 PM10/6/17
to web2py-users


On Friday, October 6, 2017 at 3:26:14 PM UTC-7, Omi Chiba wrote:

Dave S

unread,
Oct 6, 2017, 7:50:44 PM10/6/17
to web2py-users


On Friday, October 6, 2017 at 4:43:18 PM UTC-7, Omi Chiba wrote:
I have C:\Python27 in my "Path" System variables and I can run the pyson module (*.py) from command prompt.


can you, at that prompt, do
import logging
dir
(logging)



?

/dps
 

Omi Chiba

unread,
Oct 6, 2017, 7:54:53 PM10/6/17
to web2py-users
Python comand console? 

Yes, it looks ok I think.

Dave S

unread,
Oct 6, 2017, 8:19:10 PM10/6/17
to web2py-users


On Friday, October 6, 2017 at 4:54:53 PM UTC-7, Omi Chiba wrote:
Python comand console? 

Yes, it looks ok I think.

Not so good.

It should be more like

>> dir(logging)
['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR', 'FATAL', 'FileHandler', 'Filter', 'Filterer', 'Formatter', 'Handler', 'INFO', 'LogRecord', 'Logger', 'LoggerAdapter', 'Manager', 'NOTSET', 'NullHandler', 'PlaceHolder', 'RootLogger', 'StreamHandler', 'WARN', 'WARNING', '__all__', '__author__', '__builtins__', '__date__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__status__', '__version__', '_acquireLock', '_addHandlerRef', '_checkLevel', '_defaultFormatter', '_handlerList', '_handlers', '_levelNames', '_lock', '_loggerClass', '_releaseLock', '_removeHandlerRef', '_showwarning', '_srcfile', '_startTime', '_unicode', '_warnings_showwarning', 'addLevelName', 'atexit', 'basicConfig', 'cStringIO', 'captureWarnings', 'codecs', 'critical', 'currentframe', 'debug', 'disable', 'error', 'exception', 'fatal', 'getLevelName', 'getLogger', 'getLoggerClass', 'info', 'log', 'logMultiprocessing', 'logProcesses', 'logThreads', 'makeLogRecord', 'os', 'raiseExceptions', 'root', 'setLoggerClass', 'shutdown', 'sys', 'thread', 'threading', 'time', 'traceback', 'warn', 'warning', 'warnings', 'weakref']
>>>


 /dps

Omi Chiba

unread,
Oct 6, 2017, 8:20:00 PM10/6/17
to web2py-users
But I realized the same error happen when I follow the code in python console... I don't understand because nothing changed python, web2py... since 2013.

C:\>python
Python 2.7.4 (default, Apr  6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import logging
>>> import platform
>>> logger = logging.getLogger("web2py")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>

Omi Chiba

unread,
Oct 6, 2017, 8:21:22 PM10/6/17
to web2py-users
Really????

Do you think I should uninstall and reinstall the same version of python?

Dave S

unread,
Oct 6, 2017, 8:47:48 PM10/6/17
to web2py-users


On Friday, October 6, 2017 at 5:21:22 PM UTC-7, Omi Chiba wrote:
Really????

And even more entries for the 3.6 version.
 

Do you think I should uninstall and reinstall the same version of python?


Worth looking at.  Was that touched when  your hosts were updated?

/dps

Omi Chiba

unread,
Oct 6, 2017, 9:40:36 PM10/6/17
to web2py-users
I don't think my hosting company did something on python but it looks like my python is broken just like you ahowd me... I will reinstall python and add in modules next Monday. Thank you for your help!!!

--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/6vmk64T1810/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Omi Chiba

unread,
Oct 9, 2017, 10:05:14 AM10/9/17
to web2py-users
Just let you guys know it's solved after re-installing Python!! Thank you for your help again! 

Massimo Di Pierro

unread,
Oct 11, 2017, 12:55:25 PM10/11/17
to web2py-users
This is what I get:

Python 2.7.13 |Anaconda 2.2.0 (x86_64)| (default, Dec 20 2016, 23:05:08) 

[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

Anaconda is brought to you by Continuum Analytics.

Please check out: http://continuum.io/thanks and https://anaconda.org

>>> import logging

>>> import platform

>>> logger = logging.getLogger("web2py")



python 2.7.4 is 4 years old. I suspect they installed a "logging" module that conflicts with the standard logging one. This is not a web2py issue.

Omi Chiba

unread,
Oct 11, 2017, 1:01:15 PM10/11/17
to web2py-users
Thank you for checking! It's working now after reinstalling python.

--

Massimo Di Pierro

unread,
Oct 18, 2017, 10:57:45 PM10/18/17
to web2py-users
All I can offer is help you debug. Are you still in Chicago? Stop by my office on Tuesday afternoon.

Omi Chiba

unread,
Oct 18, 2017, 11:02:51 PM10/18/17
to web2py-users
Massimo, thank you. Everything is ok now after reinstalling python. Yes, I'm still on chicago : )

--
Reply all
Reply to author
Forward
0 new messages