Exception: Errors occured, please see log files for more informations

444 views
Skip to first unread message

Alexander

unread,
Nov 30, 2009, 3:31:54 AM11/30/09
to Pisa XHTML2PDF Support
Hi Everybody,

I've a big problem wit miy Installation of Pisa.

I've to Servers one is my Development System the other one the
producion Server. I installed pisa, pyPdf, reportlab and html5lib on
both servers on the Development server erything works fine but the
same installation on the Production Server fails. The OS is Windows
2003 Server Standard .

<code>
MOD_PYTHON ERROR

ProcessId: 5360
Interpreter: 'localhost'

ServerName: 'localhost'
DocumentRoot: 'C:/xampp/htdocs'

URI: '/src/pdf.py/pdf'
Location: None
Directory: None
Filename: 'C:\\xampp\\htdocs\\src\\pdf.py'
PathInfo: '/pdf'

Phase: 'PythonHandler'
Handler: 'mod_python.publisher'

Traceback (most recent call last):

File "C:\Python25\lib\site-packages\mod_python\importer.py", line
1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)

File "C:\Python25\lib\site-packages\mod_python\importer.py", line
1229, in _process_target
result = _execute_target(config, req, object, arg)

File "C:\Python25\lib\site-packages\mod_python\importer.py", line
1128, in _execute_target
result = object(arg)

File "C:\Python25\lib\site-packages\mod_python\publisher.py", line
213, in handler
published = publish_object(req, object)

File "C:\Python25\lib\site-packages\mod_python\publisher.py", line
425, in publish_object
return publish_object(req,util.apply_fs_data(object, req.form,
req=req))

File "C:\Python25\lib\site-packages\mod_python\util.py", line 554,
in apply_fs_data
return object(**args)

File "C:\xampp\htdocs\src\pdf.py", line 95, in pdf
pdf = pisa.CreatePDF(string, f)

File "C:\Python25\lib\site-packages\pisa-3.0.32-py2.5.egg\sx
\pisa3\pisa_document.py", line 218, in pisaDocument
raise Exception("Errors occured, please see log files for more
informations")

Exception: Errors occured, please see log files for more informations


MODULE CACHE DETAILS

Accessed: Mon Nov 30 09:16:20 2009
Generation: 5

_mp_a90bd51276083169503c9b04c3edcd39 {
FileName: 'C:\\xampp\\htdocs\\src\\pdf.py'
Instance: 1
Generation: 3
Modified: Mon Nov 30 08:21:02 2009
Imported: Mon Nov 30 09:15:50 2009
Children: 'C:\\xampp\\htdocs\\src\\utils\\utils.py',
'C:\\xampp\\htdocs\\src\\view.py'
}

_mp_0da44dc0364af9bf6352034239406fee {
FileName: 'C:\\xampp\\htdocs\\src\\utils\\utils.py'
Instance: 1
Generation: 1
Modified: Thu Nov 26 11:05:58 2009
Imported: Mon Nov 30 09:15:50 2009
}

_mp_9f593690cde47d360db6fc7f650f1d19 {
FileName: 'C:\\xampp\\htdocs\\src\\view.py'
Instance: 1
Generation: 2
Modified: Mon Nov 30 07:27:01 2009
Imported: Mon Nov 30 09:15:50 2009
Children: 'C:\\xampp\\htdocs\\src\\utils\\utils.py'
}

</pre>

</code>

What is going wrong here?

Greetings
Alexander

Luc Saffre

unread,
Nov 30, 2009, 5:09:02 AM11/30/09
to xhtm...@googlegroups.com
Yes, but what do the log files say? I think you will find the solution
there.

Luc

Alexander

unread,
Nov 30, 2009, 5:14:51 AM11/30/09
to Pisa XHTML2PDF Support
Hi Luc,

the question is which Logfile does it mean? the appache Error log?

<code>
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] mod_python
(pid=8656, interpreter='localhost', phase='PythonHandler',
handler='mod_python.publisher'): Application error, referer:
http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] ServerName:
'localhost', referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] DocumentRoot:
'C:/xampp/htdocs', referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] URI: '/src/
pdf.py/pdf', referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] Location: None,
referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] Directory: None,
referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] Filename: 'C:\\\
\xampp\\\\htdocs\\\\src\\\\pdf.py', referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] PathInfo: '/
pdf', referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] Traceback (most
recent call last):, referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] File "C:\
\Python25\\lib\\site-packages\\mod_python\\importer.py", line 1537, in
HandlerDispatch\n default=default_handler, arg=req,
silent=hlist.silent), referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] File "C:\
\Python25\\lib\\site-packages\\mod_python\\importer.py", line 1229, in
_process_target\n result = _execute_target(config, req, object,
arg), referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] File "C:\
\Python25\\lib\\site-packages\\mod_python\\importer.py", line 1128, in
_execute_target\n result = object(arg), referer:
http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] File "C:\
\Python25\\lib\\site-packages\\mod_python\\publisher.py", line 213, in
handler\n published = publish_object(req, object), referer:
http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] File "C:\
\Python25\\lib\\site-packages\\mod_python\\publisher.py", line 425, in
publish_object\n return publish_object(req,util.apply_fs_data
(object, req.form, req=req)), referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] File "C:\
\Python25\\lib\\site-packages\\mod_python\\util.py", line 554, in
apply_fs_data\n return object(**args), referer:
http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] File "C:\\xampp
\\htdocs\\src\\pdf.py", line 95, in pdf\n pdf = pisa.CreatePDF
(string, f), referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] File "C:\
\Python25\\lib\\site-packages\\pisa-3.0.32-py2.5.egg\\sx\\pisa3\
\pisa_document.py", line 218, in pisaDocument\n raise Exception
("Errors occured, please see log files for more informations"),
referer: http://localhost:735/src/index.py/?id=overview
[Mon Nov 30 10:58:35 2009] [error] [client 127.0.0.1] Exception:
Errors occured, please see log files for more informations, referer:
http://localhost:735/src/index.py/?id=overview
</code>

its nearly the same as the standard exception msg.

If there is a specific pisa logfile I can't find it...

Greetings
Alexander

Luc Saffre

unread,
Nov 30, 2009, 9:58:54 AM11/30/09
to xhtm...@googlegroups.com
On 30.11.2009 12:14, Alexander wrote:
>
> the question is which Logfile does it mean? the appache Error log?

No, you need the Pisa logfile. This is indeed not well documented. Maybe
it is just enough to add one line in your Python code:

import pisa
pisa.showLogging(debug=True)

But you can do trickery because Pisa uses the standard Python 'logging'
module. Here is an excerpt from code that works for me to create a log
file per document:

import logging
import cStringIO
import pisa
html = '<html>...</html>'
filename = 'test.pdf'
h = logging.FileHandler(filename+'.log','w')
pisa.log.addHandler(h)
pdf = pisa.pisaDocument(cStringIO.StringIO(html), result)
pisa.log.removeHandler(h)

hth,
Luc

Reply all
Reply to author
Forward
0 new messages