Opened 10 years ago
Closed 10 years ago
#12155 closed defect (fixed)
mod_python.version is not version string on mod_python 3.5
| Reported by: | Owned by: | Jun Omae | |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.9 |
| Component: | web frontend/mod_python | Version: | 1.0.8 |
| Severity: | normal | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Fix Internal Error page crashing with mod_python 3.5. |
||
| API Changes: | |||
| Internal Changes: | |||
Description
Since updated from 1.0.6 ⇒ 1.0.8 Attachment does not work
Apache log
PythonHandler trac.web.modpython_frontend: AttributeError: 'module' object has no attribute 'replace', referer: http://server.simplesestudio.com.br/trac/entouragelab/attachment/ticket/2/?action=new
Attachments (1)
Change History (17)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
| Component: | general → attachment |
|---|---|
| Summary: | Attachment File 1.0.8 → "Attach file" on ticket page doesn't work with Trac 1.0.8 |
| Version: | → 1.0.8 |
Stack trace from comment:1.
File "/usr/lib64/python2.7/site-packages/mod_python/apache.py", line 398, in HandlerDispatch
result = obj(req)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/modpython_frontend.py", line 148, in handler
gateway.run(dispatch_request)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/wsgi.py", line 92, in run
response = application(self.environ, self._start_response)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 519, in dispatch_request
return _dispatch_request(req, env, env_error)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 558, in _dispatch_request
send_internal_error(env, req, sys.exc_info())
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 659, in send_internal_error
description_en = get_description(lambda s, **kw: safefmt(s, kw))
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 623, in get_description
for k, v in env.get_systeminfo())
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 623, in <genexpr>
for k, v in env.get_systeminfo())
AttributeError: 'module' object has no attribute 'replace'
Could you please post the following?
- Internal Server Error: … with stack trace in your trac.log file after TracLogging is enabled. That error is logged with Internal Server Error: .
- System Information and Installed Plugins from "About Trac" page in your Trac.
comment:3 by , 10 years ago
logging log_file trac.log log_format log_level DEBUG log_type none milestone stats_provider DefaultTicketGroupStatsProvider
But i could not find the file i'm on an multi-trac env
Apache is
LoadModule python_module /usr/local/apache/modules/mod_python.so
<Location /trac>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /trac
PythonOption TracUriRoot /trac
AuthType Basic
AuthName "Rede Desenvolvimento"
AuthUserFile /srv/user
Require valid-user
</Location>
comment:4 by , 10 years ago
Trac[amt:session] DEBUG: Retrieving session for ID u'renato'
Trac[amt:main] ERROR: Internal Server Error:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 551, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 244, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/attachment.py", line 529, in process_request
data = self._do_save(req, attachment)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/attachment.py", line 782, in _do_save
attachment.insert(filename, upload.file, size)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/attachment.py", line 330, in insert
os.makedirs(dir)
File "/usr/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: 13 Permissão negada
comment:5 by , 10 years ago
Chmod -rf 777 /usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/
And now new log
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 551, in _dispatch_request
dispatcher.dispatch(req)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/web/main.py", line 244, in dispatch
resp = chosen_handler.process_request(req)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/attachment.py", line 529, in process_request
data = self._do_save(req, attachment)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/attachment.py", line 782, in _do_save
attachment.insert(filename, upload.file, size)
File "/usr/lib/python2.7/site-packages/Trac-1.0.8-py2.7.egg/trac/attachment.py", line 330, in insert
os.makedirs(dir)
File "/usr/lib64/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: 13 Permissão negada
follow-up: 11 comment:6 by , 10 years ago
Please post System Information and Installed Plugins from "About Trac" page in your Trac. I consider that one of ISystemInfoProvider components wrongly returns module instance instead of version string.
It seems that your $ENV/files directory is writable from Apache. Make sure that the $ENV/files directory is readable and writable from Apache.
by , 10 years ago
follow-up: 8 comment:7 by , 10 years ago
File has been attached to you see
when you say $ENV/files you say trac-env dir ?
/trac/asdddasa?
comment:8 by , 10 years ago
File has been attached to you see
Thanks!
when you say $ENV/files you say trac-env dir ?
/trac/asdddasa?
Yeah. $ENV/file directory means files directory in directory of your Trac Environment.
comment:9 by , 10 years ago
Working fine now, chmod 777 when i migrated from the one server to another get lost on files folder
Thanks for the help i'm not a linux expert ! sorry
comment:10 by , 10 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:11 by , 10 years ago
Replying to jomae:
Please post System Information and Installed Plugins from "About Trac" page in your Trac. I consider that one of
ISystemInfoProvidercomponents wrongly returns module instance instead of version string.
I found root cause of that issue. The version variable is renamed to mp_version in mod_python module, in
https://github.com/grisha/mod_python/commit/b5d9472c437edf06232f0d3a6500c959e17497c7#diff-717482277127bd065ed935e7b183bdd2.
Could you please apply the following patch and post screenshot of About Trac page?
-
trac/web/modpython_frontend.py
diff --git a/trac/web/modpython_frontend.py b/trac/web/modpython_frontend.py index 60daa8998..6dc25355e 100644
a b except ImportError: 29 29 30 30 from mod_python import apache 31 31 try: 32 from mod_python import version 32 try: 33 from mod_python import mp_version as version # 3.5 and later 34 except ImportError: 35 from mod_python import version 33 36 except ImportError: 34 37 version = "< 3.2" 35 38
comment:13 by , 10 years ago
| Component: | attachment → web frontend/mod_python |
|---|---|
| Milestone: | → 1.0.9 |
| Resolution: | fixed |
| Status: | closed → reopened |
Replying to renato <tonarer@…>:
But for what its working fine
Please post screenshot of "About Trac" page after the patch.
comment:14 by , 10 years ago
| Owner: | set to |
|---|---|
| Status: | reopened → assigned |
I'll push the patch in comment:11 after I confirm with mod_python 3.3 and 3.5.
comment:15 by , 10 years ago
| Summary: | "Attach file" on ticket page doesn't work with Trac 1.0.8 → mod_python.version is not version string on mod_python 3.5 |
|---|
comment:16 by , 10 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |



Full Log