On 17/12/2013 14:34, Moritz Schlarb wrote:

Hi there,

how to investiguate
well, if you get Error 500's, your Apache error log should contain
tracebacks etc. that could help us find the problem!

I'm trapped :

* If I want TG to log into apache logs, then I add this to my .wsgi file:

    logging.basicConfig(stream=sys.stderr)

then it works.

* So I put back my logging configuration (in the .wsgi):

    logging.config.fileConfig(APP_CONFIG)

resulting in error 500 without any log.

I also investigate in an interactive manner :

root@39377hd52094:~# python

Python 2.7.3 (default, Jan  2 2013, 13:56:14)

[GCC 4.7.2] on linux2

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

import logging
import logging.config
logging.config.fileConfig("/opt/pod/pboard/production.ini")
logging.getLogger().info("agaga")

This is working... but... If I run the same code through the www-data user (which is, I suppose, the one running wsgi applications), I get an exception:

logging.config.fileConfig("/opt/pod/pboard/production.ini")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.2/logging/config.py", line 78, in fileConfig
    handlers = _install_handlers(cp, formatters)
File "/usr/lib/python3.2/logging/config.py", line 144, in _install_handlers
    h = klass(*args)
  File "/usr/lib/python3.2/logging/handlers.py", line 117, in __init__
    BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python3.2/logging/handlers.py", line 64, in __init__
    logging.FileHandler.__init__(self, filename, mode, encoding, delay)
  File "/usr/lib/python3.2/logging/__init__.py", line 970, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python3.2/logging/__init__.py", line 993, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/apache2/pod.log'

Note: the file already exists and it has been chmod-ed 777

An extra investigation is the following one:

The folder /var/log/apache2 seems to be owned by root (and in the adm group)...

drwxr-x---  2 root     adm         4096 déc.  15 06:25 apache2

I believe this is a problem of rights but don't know yet which one... I will investigate.

Thanks for your answer which pointed me to another way to log into apache logs and to make these new steps.


--
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to