Edgewall Software
Modify

Opened 13 years ago

Closed 13 years ago

#10302 closed defect (duplicate)

Trac Attachments image break sometime

Reported by: buaa.byl@… Owned by:
Priority: lowest Milestone:
Component: general Version: 0.12-stable
Severity: minor Keywords: needinfo
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Sometime trac can't display image correctly, Only ¼ or ½ image appear, and other part is blank!

I using Firefox Opera Chrome, and this issue still appear.

But after I using apache mod_rewrite, this issus gone. Below is my apache httpd.conf

WSGIScriptAlias /trac "D:/Apache/trachome/loader.wsgi.py"
<Location /trac>
    WSGIApplicationGroup %{GLOBAL}
    Order deny,allow
    Allow from all
</Location>

RewriteEngine on
#Let apache handle static file
RewriteRule  /trac/([^/]*)/chrome/common/(.*) "C:/Python25/Lib/site-packages/trac-0.12.2-py2.5.egg/trac/htdocs/$2"

#Let apache handle raw attachments
RewriteRule  /trac/([^/]*)/raw-attachment/wiki/(.*) "D:/Apache/trachome/$1/attachments/wiki/$2"

I don't know why, anyone can check this? I using windows xp sp3, apache2.2.11, python2.5.4, mod_wsgi2.0. Thanks.

Attachments (1)

test.diff (848 bytes ) - added by buaa.byl@…> 13 years ago.
Simple test to make sure if file size error.

Download all attachments as: .zip

Change History (10)

comment:1 by Remy Blank, 13 years ago

Keywords: needinfo added

Is there anything in your Trac or Apache log that could give us a hint about the issue?

in reply to:  1 comment:2 by buaa.byl@…>, 13 years ago

Replying to rblank:

Is there anything in your Trac or Apache log that could give us a hint about the issue?

Ok, I will enable log and check it. Thanks.

in reply to:  1 comment:3 by buaa.byl@…>, 13 years ago

Replying to rblank:

Is there anything in your Trac or Apache log that could give us a hint about the issue?

I enable apache log and trac log. When using mod_rewrite, apache log is

127.0.0.1 - - [05/Aug/2011:16:56:11 +0800] "GET /trac/project/raw-attachment/wiki/xxx/6309fc78gw1djni1pak5sj.jpg HTTP/1.1" 200 119947

When disable mod)rewrite, apache log is

127.0.0.1 - - [05/Aug/2011:16:58:00 +0800] "GET /trac/project/raw-attachment/wiki/xxx/6309fc78gw1djni1pak5sj.jpg HTTP/1.1" 200 94208

It appear that just 94208 transfer! But actual file size is 119947 bytes(So transfer right when use mod_rewrite)!

comment:4 by buaa.byl@…>, 13 years ago

And this patch work fine.

  • attachment.py

     
    754754                if 'charset=' not in mime_type:
    755755                    charset = mimeview.get_charset(str_data, mime_type)
    756756                    mime_type = mime_type + '; charset=' + charset
    757                 req.send_file(attachment.path, mime_type)
     757                #req.send_file(attachment.path, mime_type)
     758                filedata = fd.read()
     759                req.send_header('Content-Type',  mime_type)
     760                req.send_header('Content-Length', fd.tell())
     761                req.end_headers()
     762                req.write(filedata)
    758763
    759764            # add ''Plain Text'' alternate link if needed
    760765            if (self.render_unsafe_content and

comment:5 by Christian Boos, 13 years ago

Looks like this is mod-wsgi-issue:100. Can you please try to upgrade?

by buaa.byl@…>, 13 years ago

Attachment: test.diff added

Simple test to make sure if file size error.

in reply to:  5 comment:6 by buaa.byl@…>, 13 years ago

Replying to cboos:

Looks like this is mod-wsgi-issue:100. Can you please try to upgrade?

Thanke, now, I upgrade to mod_wsgi-3.3, issue still.

comment:7 by Christian Boos, 13 years ago

Please double check you really have that version number in your About page of Trac and in the Apache logs.

in reply to:  7 comment:8 by buaa.byl@…>, 13 years ago

Replying to cboos:

Please double check you really have that version number in your About page of Trac and in the Apache logs.

I am sorry, I recompile mod_wsgi-3.3 and install again, and issue gone. Thanks for your help.

comment:9 by Christian Boos, 13 years ago

Resolution: duplicate
Status: newclosed

No problem, thanks for the feedback.

I wanted to add a note in the wiki, but the problem is already well documented: TracModWSGI#Usearecentversion.

Duplicate of #7205.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.